-
Notifications
You must be signed in to change notification settings - Fork 14k
Add support for removed library features #146554
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
Conversation
|
Some changes occurred to the CTFE machinery Some changes occurred to constck cc @fee1-dead Some changes occurred in compiler/rustc_attr_parsing Some changes occurred in exhaustiveness checking cc @Nadrieril |
|
r? @nnethercote rustbot has assigned @nnethercote. Use |
|
Note that this is not the design that was proposed at #141617 (comment). The proposal was to have a crate-level attribute ( What is the point of marking an existing item as being removed? The item clearly still exists, otherwise it couldn't carry the attribute.^^ I already noted on your previous PR that having a new |
|
The job Click to see the possible cause of the failure (guessed by this bot) |
This comment was marked as spam.
This comment was marked as spam.
|
Sorry, I don't have the time to give a lot of detailed guidance here. You can always ask on Zulip. |
PR: Add support for removed library features
Overview
This PR extends the Rust stability system to handle removed library features. The new attribute
#[unstable_removed]can be applied to APIs that have been permanently removed from the standard library. This ensures removed items always produce an error when referenced.The approach follows the existing stability infrastructure (
#[unstable],#[stable]), introducing a newRemovedstate with dedicated compiler diagnostics.Implementation details
New attribute:
Library integration:
library/core/src/removed_lib_features.rs.Compiler changes:
Extended stability handling to include
StabilityLevel::Removed.Updated checks in:
rustc_const_eval→ reports errors on evaluation of removed consts.rustc_hir_analysis→ enforces removed status during analysis.rustc_passes→ detects duplicates and unused/invalid declarations.rustc_resolve→ reports errors for removed macros and intrinsic resolution.Validation: Missing fields (
since,issue) are rejected with compiler errors.Flow
#[unstable_removed].Removed.E0658).Testing
Location: UI tests under
tests/ui/stability-attribute/.Coverage:
since,issue).What’s left / To Fix
E0658). Explicit, dedicated error codes should be added for clarity.Issue: #141617