Skip to content

Commit 2627e9f

Browse files
committedMar 21, 2024
Auto merge of #122822 - matthiaskrgr:rollup-rjgmnbe, r=matthiaskrgr
Rollup of 8 pull requests Successful merges: - #122222 (deref patterns: bare-bones feature gate and typechecking) - #122358 (Don't ICE when encountering bound regions in generator interior type) - #122696 (Add bare metal riscv32 target.) - #122773 (make "expected paren or brace" error translatable) - #122795 (Inherit `RUSTC_BOOTSTRAP` when testing wasm) - #122799 (Replace closures with `_` when suggesting fully qualified path for method call) - #122801 (Fix misc printing issues in emit=stable_mir) - #122806 (Make `type_ascribe!` not a built-in) Failed merges: - #122771 (add some comments to hir::ModuleItems) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 03994e4 + 62e414d commit 2627e9f

File tree

60 files changed

+751
-719
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+751
-719
lines changed
 

‎compiler/rustc_ast_passes/src/feature_gate.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,10 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
413413
}
414414
}
415415
PatKind::Box(..) => {
416-
gate!(&self, box_patterns, pattern.span, "box pattern syntax is experimental");
416+
if !self.features.deref_patterns {
417+
// Allow box patterns under `deref_patterns`.
418+
gate!(&self, box_patterns, pattern.span, "box pattern syntax is experimental");
419+
}
417420
}
418421
PatKind::Range(_, Some(_), Spanned { node: RangeEnd::Excluded, .. }) => {
419422
gate!(
@@ -607,13 +610,16 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
607610
};
608611
}
609612

613+
if !visitor.features.deref_patterns {
614+
// Allow box patterns under `deref_patterns`.
615+
gate_all_legacy_dont_use!(box_patterns, "box pattern syntax is experimental");
616+
}
610617
gate_all_legacy_dont_use!(trait_alias, "trait aliases are experimental");
611618
// Despite being a new feature, `where T: Trait<Assoc(): Sized>`, which is RTN syntax now,
612619
// used to be gated under associated_type_bounds, which are right above, so RTN needs to
613620
// be too.
614621
gate_all_legacy_dont_use!(return_type_notation, "return type notation is experimental");
615622
gate_all_legacy_dont_use!(decl_macro, "`macro` is experimental");
616-
gate_all_legacy_dont_use!(box_patterns, "box pattern syntax is experimental");
617623
gate_all_legacy_dont_use!(
618624
exclusive_range_pattern,
619625
"exclusive range pattern syntax is experimental"

‎compiler/rustc_builtin_macros/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ mod log_syntax;
4949
mod source_util;
5050
mod test;
5151
mod trace_macros;
52-
mod type_ascribe;
5352
mod util;
5453

5554
pub mod asm;
@@ -99,7 +98,6 @@ pub fn register_builtin_macros(resolver: &mut dyn ResolverExpand) {
9998
std_panic: edition_panic::expand_panic,
10099
stringify: source_util::expand_stringify,
101100
trace_macros: trace_macros::expand_trace_macros,
102-
type_ascribe: type_ascribe::expand_type_ascribe,
103101
unreachable: edition_panic::expand_unreachable,
104102
// tidy-alphabetical-end
105103
}

0 commit comments

Comments
 (0)
Please sign in to comment.