summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_ast_passes/src/feature_gate.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /compiler/rustc_ast_passes/src/feature_gate.rs
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'compiler/rustc_ast_passes/src/feature_gate.rs')
-rw-r--r--compiler/rustc_ast_passes/src/feature_gate.rs25
1 files changed, 16 insertions, 9 deletions
diff --git a/compiler/rustc_ast_passes/src/feature_gate.rs b/compiler/rustc_ast_passes/src/feature_gate.rs
index 10c9c3ef1..62dc7ae58 100644
--- a/compiler/rustc_ast_passes/src/feature_gate.rs
+++ b/compiler/rustc_ast_passes/src/feature_gate.rs
@@ -570,6 +570,7 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
gate_all!(builtin_syntax, "`builtin #` syntax is unstable");
gate_all!(explicit_tail_calls, "`become` expression is experimental");
gate_all!(generic_const_items, "generic const items are experimental");
+ gate_all!(unnamed_fields, "unnamed fields are not yet fully implemented");
if !visitor.features.negative_bounds {
for &span in spans.get(&sym::negative_bounds).iter().copied().flatten() {
@@ -577,11 +578,11 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
}
}
- // All uses of `gate_all!` below this point were added in #65742,
+ // All uses of `gate_all_legacy_dont_use!` below this point were added in #65742,
// and subsequently disabled (with the non-early gating readded).
// We emit an early future-incompatible warning for these.
// New syntax gates should go above here to get a hard error gate.
- macro_rules! gate_all {
+ macro_rules! gate_all_legacy_dont_use {
($gate:ident, $msg:literal) => {
for span in spans.get(&sym::$gate).unwrap_or(&vec![]) {
gate_feature_post!(future_incompatible; &visitor, $gate, *span, $msg);
@@ -589,13 +590,19 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
};
}
- gate_all!(trait_alias, "trait aliases are experimental");
- gate_all!(associated_type_bounds, "associated type bounds are unstable");
- gate_all!(return_type_notation, "return type notation is experimental");
- gate_all!(decl_macro, "`macro` is experimental");
- gate_all!(box_patterns, "box pattern syntax is experimental");
- gate_all!(exclusive_range_pattern, "exclusive range pattern syntax is experimental");
- gate_all!(try_blocks, "`try` blocks are unstable");
+ gate_all_legacy_dont_use!(trait_alias, "trait aliases are experimental");
+ gate_all_legacy_dont_use!(associated_type_bounds, "associated type bounds are unstable");
+ // Despite being a new feature, `where T: Trait<Assoc(): Sized>`, which is RTN syntax now,
+ // used to be gated under associated_type_bounds, which are right above, so RTN needs to
+ // be too.
+ gate_all_legacy_dont_use!(return_type_notation, "return type notation is experimental");
+ gate_all_legacy_dont_use!(decl_macro, "`macro` is experimental");
+ gate_all_legacy_dont_use!(box_patterns, "box pattern syntax is experimental");
+ gate_all_legacy_dont_use!(
+ exclusive_range_pattern,
+ "exclusive range pattern syntax is experimental"
+ );
+ gate_all_legacy_dont_use!(try_blocks, "`try` blocks are unstable");
visit::walk_crate(&mut visitor, krate);
}