-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Tracking issue for migrating all remaining post-expansion feature gates to pre-expansion ones #154045
Copy link
Copy link
Open
Labels
A-grammarArea: The grammar of RustArea: The grammar of RustA-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language team
Description
TODO(fmease): Brief introduction.
Steps
TODO(fmease): Find & link to all earlier attempts (PRs & crater runs).
- Find the most recent relevant crater runs and manually reaudit affected crates
- check if at least some crates have been fixed downstream by now
- Collect all features where the crater run has happened a long time ago & issue a single crater run for all of them at once
- For all the other ones that also don't emit a pre-expansion warning yet, add warnings immediately
- no further input from T-compiler/T-lang should be needed since it's already legitimized by MCP 535.
Affected Syntactic Constructs
- item modifier
default(featurespecializationormin_specializationfor fns only)- we potentially want to drop this feature in favor of a different approach...
- ...so a syntax gate would make it easier to phase out the syntax later on
- issue a pre-expansion feature gate warning (legitimized by MCP 535)
- turn the warning into a hard error (needs crater, T-lang FCP)
- trait impl modifier
!(featurenegative_impls)- likely to be stabilized in 1–3 years, so a syntax gate isn't super pressing
- issue a pre-expansion feature gate warning (legitimized by MCP 535)
- turn the warning into a hard error (needs crater, T-lang FCP)
- expression
try { … }(featuretry_blocks)- already has a pre-expansion feature gate warning
- incredibly likely to be stabilized this year...
- ...so a syntax gate would be counterproductive / harmful (!)
- turn the warning into a hard error (needs crater, T-lang FCP)
- pattern
box $pat(featurebox_patterns)- already has a pre-expansion feature gate warning
- incredibly likely to be replaced with explicit or implicit deref patterns...
- ...so a syntax gate would make it easier to phase out the syntax later on
- turn the warning into a hard error (needs crater, T-lang FCP)
- pattern
$patpath { box $ident }, pseudo binding mode (featurebox_patterns)- incredibly likely to be replaced with explicit or implicit deref patterns...
- ...so a syntax gate would make it easier to phase out the syntax later on
- issue a pre-expansion feature gate warning (legitimized by MCP 535)
- turn the warning into a hard error (needs crater, T-lang FCP)
- item
trait $ident $genericparams = $bounds;(featuretrait_alias)- already has a pre-expansion feature gate warning
- turn the warning into a hard error (needs crater, T-lang FCP)
- trait item modifier
auto(featureauto_traits)- already has a pre-expansion feature gate warning
- turn the warning into a hard error (needs crater, T-lang FCP)
- (not fitting 100%) syntax
impl $traitref for .. {}(early version of a now removed predecessor of featureauto_traits)- most recent crater run: PR RUST-121072
- issue a pre-expansion feature gate warning (legitimized by MCP 535, maybe?)
- reevaluate RUST-121072's crater report & send downstream patches
- turn the warning into a hard error (needs T-lang FCP, maybe another crater run)
- item
macro $ident$macroparams { $ttstar }(featuredecl_macro)- already has a pre-expansion feature gate warning
- turn the warning into a hard error (needs crater, T-lang FCP)
- (not fitting 100%) predicates
$ty = $tyand$ty == $ty(no corresp. feature was ever added (cc RUST-22074, RUST-87471))- straight up hard error (crater: 0 regressions, needs T-lang FCP): PR RUST-153513
Pre-History (Incomplete)
- Pre-expansion gate most of the things #65742
- Re-land early syntax feature gating (was: Some features can no longer be controlled by conditional compilation) #65860
- Partially revert the early feature-gatings added in #65742. #66004
- Re-add most early unstable syntax gates as future-compat lints compiler-team#535
- Reenable disabled early syntax gates as future-incompatibility lints #99935
- Emit feature gate *warning* for
autotraits pre-expansion #116393 - Remove special handling of obsolete
impl Trait for ..syntax #121072
Implementation History
- Syntactically reject equality predicates #153513
- Emit a pre-expansion feature gate warning for
box'ed struct field patterns #154475 - Emit pre-expansion feature gate warnings for negative impls and specialization #154527
Downstream Patches
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-grammarArea: The grammar of RustArea: The grammar of RustA-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language team
Type
Fields
Give feedbackNo fields configured for issues without a type.