-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Track stability of path components #15702
Comments
cc #8962 |
cc #8967 as well. We will also need to think carefully about the user experience for the lint for mostly-stable libraries. We may want opt-out at the crate level, or a way of coalescing warnings. |
Nominating for 1.0. This is an important feature that possibly affects several libraries over the course of stabilization after 1.0 (I've already hit this twice with rust-encoding, see above). Also note that this doesn't have a simple workaround with an exception of function. |
P-high, not 1.0. (This is highly desired, but it is not going to block a release.) |
Renominating because the ability to correctly detect the stability level of user code has a high impact on the guarantees we can provide. |
Assigning 1.0 milestone (it is considered polish, rather than a deep backwards compat issue). |
@alexcrichton did your patch address this? For some reason it seemed it would be harder, but I don't really know. |
Unfortunately no, my patch didn't address this. For any path we still only track the stability of the last component. |
We need to investigate how much of the stdlib is potentially affected by this to decide what to do next (and how to do it). |
Unfortunately not having this bug fixed means that paths like If we fix this we probably need to have at least a cycle of warnings before turning on the infrastructure. |
cc @jseyfried, @petrochenkov, do either of you know if recent work has made this easy to knock out? Also removing @aturon as assignee as it's not actively being worked on |
I don't think this can be done now, too much breakage (?).
Nothing that I know about. |
Perhaps we could have |
I wouldn't necessarily be too worried about the breakage here as we could turn these new stability violations into warnings for quite some time. We basically just want to communicate to people that the API they are accidentally using is actually stable somewhere else, and it's in their own best interest to use that instead. If it's very difficult to implement in the compiler, though, this could just be something the libs team keeps in mind when stabilizing APIs and we can avoid having unstable modules with stable contents as much as possible. |
`std::panic` is already stable. `core::panic::PanicInfo` and `core::panic::Location` are stable and can be used through that path because of a bug in stability checking: rust-lang#15702
Stabilize the `core::panic` module `std::panic` is already stable. `core::panic::PanicInfo` and `core::panic::Location` are stable and can be used through that path because of a bug in stability checking: rust-lang#15702
@rustbot label: +lang-team-202x-edition (I think this got forgotten for 2021, but adding the label so it doesn't get missed for 2024 or whatever) |
Error: Label lang-team-202x-edition can only be set by Rust team members Please let |
Oh well, was worth a shot. |
add missing feature in core/tests rust-lang#104265 introduced the `ip_in_core` feature. For some reason core tests seem to still build without that feature -- no idea how that is possible. Might be related to rust-lang#15702? I was under the impression that `pub use` with different stability doesn't actually work. That's why `intrinsics::transmute` is stable, for example. Either way, core tests fail to build in miri-test-libstd, and adding the feature fixes that. r? `@thomcc`
add missing feature in core/tests rust-lang#104265 introduced the `ip_in_core` feature. For some reason core tests seem to still build without that feature -- no idea how that is possible. Might be related to rust-lang#15702? I was under the impression that `pub use` with different stability doesn't actually work. That's why `intrinsics::transmute` is stable, for example. Either way, core tests fail to build in miri-test-libstd, and adding the feature fixes that. r? ``@thomcc``
add missing feature in core/tests rust-lang#104265 introduced the `ip_in_core` feature. For some reason core tests seem to still build without that feature -- no idea how that is possible. Might be related to rust-lang#15702? I was under the impression that `pub use` with different stability doesn't actually work. That's why `intrinsics::transmute` is stable, for example. Either way, core tests fail to build in miri-test-libstd, and adding the feature fixes that. r? ```@thomcc```
can this be closed since #95956 landed? |
Looks like it, yeah. We do have some items with |
add missing feature in core/tests rust-lang/rust#104265 introduced the `ip_in_core` feature. For some reason core tests seem to still build without that feature -- no idea how that is possible. Might be related to rust-lang/rust#15702? I was under the impression that `pub use` with different stability doesn't actually work. That's why `intrinsics::transmute` is stable, for example. Either way, core tests fail to build in miri-test-libstd, and adding the feature fixes that. r? ```@thomcc```
Closing as done – please reopen if you disagree.
I'm not sure I understand this – my understanding is that the item is intended to be reachable through some other stable path, which should be fine? What needs cleaning up in that case? |
|
I think it would be a breaking change to "fix" |
Thanks for the pointers – I've opened #113387 to track this. |
…olnay Soft-destabilize `RustcEncodable` & `RustcDecodable`, remove from prelude in next edition cc rust-lang/libs-team#272 Any use of `RustcEncodable` and `RustcDecodable` now triggers a deny-by-default lint. The derives have been removed from the 2024 prelude. I specifically chose **not** to document this in the module-level documentation, as the presence in existing preludes is not documented (which I presume is intentional). This does not implement the proposed change for `rustfix`, which I will be looking into shortly. With regard to the items in the preludes being stable, this should not be an issue because rust-lang#15702 has been resolved. r? libs-api
…olnay Soft-destabilize `RustcEncodable` & `RustcDecodable`, remove from prelude in next edition cc rust-lang/libs-team#272 Any use of `RustcEncodable` and `RustcDecodable` now triggers a deny-by-default lint. The derives have been removed from the 2024 prelude. I specifically chose **not** to document this in the module-level documentation, as the presence in existing preludes is not documented (which I presume is intentional). This does not implement the proposed change for `rustfix`, which I will be looking into shortly. With regard to the items in the preludes being stable, this should not be an issue because rust-lang#15702 has been resolved. r? libs-api
Soft-destabilize `RustcEncodable` & `RustcDecodable`, remove from prelude in next edition cc rust-lang/libs-team#272 Any use of `RustcEncodable` and `RustcDecodable` now triggers a deny-by-default lint. The derives have been removed from the 2024 prelude. I specifically chose **not** to document this in the module-level documentation, as the presence in existing preludes is not documented (which I presume is intentional). This does not implement the proposed change for `rustfix`, which I will be looking into shortly. With regard to the items in the preludes being stable, this should not be an issue because rust-lang#15702 has been resolved. r? libs-api
Soft-destabilize `RustcEncodable` & `RustcDecodable`, remove from prelude in next edition cc rust-lang/libs-team#272 Any use of `RustcEncodable` and `RustcDecodable` now triggers a deny-by-default lint. The derives have been removed from the 2024 prelude. I specifically chose **not** to document this in the module-level documentation, as the presence in existing preludes is not documented (which I presume is intentional). This does not implement the proposed change for `rustfix`, which I will be looking into shortly. With regard to the items in the preludes being stable, this should not be an issue because rust-lang#15702 has been resolved. r? libs-api
The current stability check only checks a few uses: functions and methods. There is much more needed for the coverage to be complete. In particular, every path contains multiple components which should all be checked. Simply checking paths would improve the accuracy of the analysis greatly.
This requires modifying resolve to record the def_id's of path components, not just the entire path.
cc @aturon
The text was updated successfully, but these errors were encountered: