-
Notifications
You must be signed in to change notification settings - Fork 13k
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
remove pointless allowed_through_unstable_modules on TryFromSliceError #135489
base: master
Are you sure you want to change the base?
Conversation
…able_modules to more items
The rustc-dev-guide subtree was changed. If this PR only touches the dev guide consider submitting a PR directly to rust-lang/rustc-dev-guide otherwise thank you for updating the dev guide with your changes. |
The point of adding this atrribute was to make the "since" version on the rustdoc page show up correctly: https://doc.rust-lang.org/nightly/core/array/struct.TryFromSliceError.html
Usually, we want to show the stability of the "most unstable" path component in rustdoc, this is important for example for But by that logic
This seems plausible to me, and there are probably very few crates that still use MSRV 1.34.0 and name this type dicectly, so I'm fine with removing this again. |
It is news to me that rustdoc actually uses the attribute when computing the information shown there, but maybe it does? Cc @notriddle I am not sure if there is some other way to get rustdoc to show the correct information here, but whatever we do should be rustdoc-only and not affect how rustc behaves on current stable releases. But it's probably not worth worrying about this tiny mistake only affecting a single version released five years ago...
TBH I find that page confusing since it is not at all clear that the "Since 1.81.0" refers to the path rather than the item. |
I don't think the https://github.com/rust-lang/rust/blob/master/src/librustdoc/passes/propagate_stability.rs If the item was inlined, it'll pick the version number from the import, but
Assuming we want the number there to refer to the item, where should the stability of the path be specified? We don't want someone to copy a path into their code, with a "stable since 1.0" badge on it, only to actually try it in the 1.73 compiler and get rug-pulled when it turns out not to actually be stable. That's pretty bad for people's confidence in the docs. The clearest, most explicit option of flat-out adding another attribute, like this?
It's unambiguous, but it's also not great for progressive disclosure, because that's a pretty complex concept that most people don't need to care about. |
This got added in #132482 but the PR does not explain why. @lukas-code do you still remember? Also Cc @Noratrieb as reviewer of that PR.
If I understand the issue description correctly, all paths under which this type is exported are stable now:
core::array::TryFromSliceError
andstd::array::TryFromSliceError
. If that is the case, we shouldn't have the attribute; it's a terrible hack that should only be used when needed to maintain backward compatibility. Getting some historic information right is IMO not sufficient justification to risk accidentally exposing this type via more unstable paths today or in the future.