-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename LayoutErr to LayoutError #73
Comments
If and when this WG and the Libs team agree on a new name, I think there is no need to mess with As to deprecation warnings, if we want them emitted we should use the However another option is to not emit any deprecation warning, and only soft-deprecate the old name in docs. What do we really gain by nudging existing code bases to actively migrate to the new name? Additionally I personally don’t feel strongly that the naming consistency is worth bothering in the first place. Not renaming at all is also an option. |
Thanks for the feedback Simon. It's good to hear that there is no need to use As for deprecating the old name, given that the As for whether this change is worth it, since we have also renamed Additionally, doing some searches on github, there are approximately 370 uses of I think it makes sense to make this change for the sake of polish and consistency, this feature is not yet highly utilized, and the impact to existing users should be very low (they can continue to use |
Rename/Deprecate LayoutErr in favor of LayoutError Implements rust-lang/wg-allocators#73. This patch renames LayoutErr to LayoutError, and uses a type alias to support users using the old name. The new name will be instantly stable in release 1.49 (current nightly), the type alias will become deprecated in release 1.51 (so that when the current nightly is 1.51, 1.49 will be stable). This is the only error type in `std` that ends in `Err` rather than `Error`, if this PR lands all stdlib error types will end in `Error` 🥰
We should rename
LayoutErr
toLayoutError
incore::alloc
. See prior discussion here: #57 (comment)Since
LayoutErr
is stable, we can provide a type aliasI've implemented this change here, rust-lang/rust@master...exrook:rename-layouterr. Some things that are still unclear to me are:
LayoutErr
be deprecatedLayoutError
be behind a feature flag at firstIf
LayoutErr
is deprecated or marked for deprecation in a later version, it can no longer be used instd
because of#[deny(deprecated,deprecated_in_future)]
being in effect. I don't think it makes sense to haveLayoutError
replaceLayoutErr
instd
, but then be behind a feature flag, only usable on nightly. This is mainly a usability issue because crates can of course continue to useLayoutErr
despite the stdlib rustdocs showingLayoutError
.Option 1
Is it possible to make
LayoutError
immediately stable, then deprecateLayoutErr
in the same or a later release? The following would then be possible:Option 2
I think this would make more sense than trying to do a staged approach of adding
LayoutError
as unstable, then marking it stable, then deprecating theLayoutErr
type alias.Stage 1 - release 1.N
Stage 2 - release 1.N+1
Stage 3 - release 1.N+2
The text was updated successfully, but these errors were encountered: