Skip to content

Commit cc05892

Browse files
committed
Auto merge of #161731 - jhpratt:rollup-cUfsCoq, r=jhpratt
Rollup of 5 pull requests Successful merges: - #156749 (remove `box_patterns`) - #161411 (avoid overlapping const suggestions) - #161484 (Discard `.pdr` in the PSP linker script) - #161663 (Reduce dependency on implicit paths in bootstrap) - #161720 (rename rust_target_features query to make it clear that these are *all* target features)
2 parents 26747db + e0f4541 commit cc05892

137 files changed

Lines changed: 557 additions & 1073 deletions

File tree

Some content is hidden

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

compiler/rustc_ast/src/ast.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -686,8 +686,7 @@ impl Pat {
686686
| PatKind::Or(s) => s.iter().for_each(|p| p.walk(it)),
687687

688688
// Trivial wrappers over inner patterns.
689-
PatKind::Box(s)
690-
| PatKind::Deref(s)
689+
PatKind::Deref(s)
691690
| PatKind::Ref(s, _, _)
692691
| PatKind::Paren(s)
693692
| PatKind::Guard(s, _) => s.walk(it),
@@ -901,9 +900,6 @@ pub enum PatKind {
901900
/// A tuple pattern (`(a, b)`).
902901
Tuple(ThinVec<Pat>),
903902

904-
/// A `box` pattern.
905-
Box(Box<Pat>),
906-
907903
/// A `deref` pattern (currently `deref!()` macro-based syntax).
908904
Deref(Box<Pat>),
909905

compiler/rustc_ast_lowering/src/pat.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
116116
let (pats, ddpos) = self.lower_pat_tuple(pats, "tuple");
117117
break hir::PatKind::Tuple(pats, ddpos);
118118
}
119-
PatKind::Box(inner) => {
120-
break hir::PatKind::Box(self.lower_pat(inner));
121-
}
122119
PatKind::Deref(inner) => {
123120
break hir::PatKind::Deref(self.lower_pat(inner));
124121
}

compiler/rustc_ast_passes/src/feature_gate.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,9 +339,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
339339
}
340340
}
341341
}
342-
PatKind::Box(..) => {
343-
gate!(self, box_patterns, pattern.span, "box pattern syntax is experimental");
344-
}
345342
_ => {}
346343
}
347344
visit::walk_pat(self, pattern)
@@ -596,7 +593,6 @@ pub fn check_crate(krate: &ast::Crate, sess: &Session, features: &Features) {
596593

597594
// tidy-alphabetical-start
598595
soft_gate_all_legacy_dont_use!(auto_traits, "`auto` traits are unstable");
599-
soft_gate_all_legacy_dont_use!(box_patterns, "box pattern syntax is experimental");
600596
soft_gate_all_legacy_dont_use!(decl_macro, "`macro` is experimental");
601597
soft_gate_all_legacy_dont_use!(negative_impls, "negative impls are experimental");
602598
soft_gate_all_legacy_dont_use!(specialization, "specialization is experimental");

compiler/rustc_ast_pretty/src/pprust/state.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2011,10 +2011,6 @@ impl<'a> State<'a> {
20112011
}
20122012
self.pclose();
20132013
}
2014-
PatKind::Box(inner) => {
2015-
self.word("box ");
2016-
self.print_pat_paren_if_or(inner);
2017-
}
20182014
PatKind::Deref(inner) => {
20192015
self.word("deref!");
20202016
self.popen();

compiler/rustc_codegen_ssa/src/codegen_attrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ fn process_builtin_attrs(
6464
codegen_fn_attrs: &mut CodegenFnAttrs,
6565
) -> InterestingAttributeDiagnosticSpans {
6666
let mut interesting_spans = InterestingAttributeDiagnosticSpans::default();
67-
let rust_target_features = tcx.rust_target_features(LOCAL_CRATE);
67+
let rust_target_features = tcx.all_rust_target_features(LOCAL_CRATE);
6868

6969
let parsed_attrs = attrs
7070
.iter()

compiler/rustc_codegen_ssa/src/target_features.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ pub fn sanitizer_features_by_flags(sess: &Session, features: &mut Vec<String>) {
528528

529529
pub(crate) fn provide(providers: &mut Providers) {
530530
*providers = Providers {
531-
rust_target_features: |tcx, cnum| {
531+
all_rust_target_features: |tcx, cnum| {
532532
assert_eq!(cnum, LOCAL_CRATE);
533533
if tcx.sess.opts.actually_rustdoc {
534534
// HACK: rustdoc would like to pretend that we have all the target features, so we

compiler/rustc_feature/src/removed.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ declare_features! (
6565
Some("merged into `min_generic_const_args`")),
6666
(removed, await_macro, "1.38.0", Some(50547),
6767
Some("subsumed by `.await` syntax"), 62293),
68+
/// Allows using `box` in patterns (RFC 469).
69+
(removed, box_patterns, "CURRENT_RUSTC_VERSION", Some(29641), Some("superseded by `deref_patterns`")),
6870
/// Allows using the `box $expr` syntax.
6971
(removed, box_syntax, "1.70.0", Some(49733), Some("replaced with `#[rustc_box]`"), 108471),
7072
/// Allows capturing disjoint fields in a closure/coroutine (RFC 2229).

compiler/rustc_feature/src/unstable.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,6 @@ declare_features! (
313313
/// Allows features specific to auto traits.
314314
/// Renamed from `optin_builtin_traits`.
315315
(unstable, auto_traits, "1.50.0", Some(13231)),
316-
/// Allows using `box` in patterns (RFC 469).
317-
(unstable, box_patterns, "1.0.0", Some(29641)),
318316
/// Allows builtin # foo() syntax
319317
(internal, builtin_syntax, "1.71.0", Some(110680)),
320318
/// Allows `#[doc(notable_trait)]`.

compiler/rustc_hir/src/hir.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1535,9 +1535,7 @@ impl<'hir> Pat<'hir> {
15351535
match self.kind {
15361536
Missing => unreachable!(),
15371537
Wild | Never | Expr(_) | Range(..) | Binding(.., None) | Err(_) => true,
1538-
Box(s) | Deref(s) | Ref(s, _, _) | Binding(.., Some(s)) | Guard(s, _) => {
1539-
s.walk_short_(it)
1540-
}
1538+
Deref(s) | Ref(s, _, _) | Binding(.., Some(s)) | Guard(s, _) => s.walk_short_(it),
15411539
Struct(_, fields, _) => fields.iter().all(|field| field.pat.walk_short_(it)),
15421540
TupleStruct(_, s, _) | Tuple(s, _) | Or(s) => s.iter().all(|p| p.walk_short_(it)),
15431541
Slice(before, slice, after) => {
@@ -1564,7 +1562,7 @@ impl<'hir> Pat<'hir> {
15641562
use PatKind::*;
15651563
match self.kind {
15661564
Missing | Wild | Never | Expr(_) | Range(..) | Binding(.., None) | Err(_) => {}
1567-
Box(s) | Deref(s) | Ref(s, _, _) | Binding(.., Some(s)) | Guard(s, _) => s.walk_(it),
1565+
Deref(s) | Ref(s, _, _) | Binding(.., Some(s)) | Guard(s, _) => s.walk_(it),
15681566
Struct(_, fields, _) => fields.iter().for_each(|field| field.pat.walk_(it)),
15691567
TupleStruct(_, s, _) | Tuple(s, _) | Or(s) => s.iter().for_each(|p| p.walk_(it)),
15701568
Slice(before, slice, after) => {
@@ -1646,7 +1644,6 @@ impl<'hir> Pat<'hir> {
16461644
| PatKind::Struct(_, _, _)
16471645
| PatKind::TupleStruct(_, _, _)
16481646
| PatKind::Tuple(_, _)
1649-
| PatKind::Box(_)
16501647
| PatKind::Ref(_, _, _)
16511648
| PatKind::Deref(_)
16521649
| PatKind::Expr(_)
@@ -1792,9 +1789,6 @@ pub enum PatKind<'hir> {
17921789
/// `0 <= position <= subpats.len()`
17931790
Tuple(&'hir [Pat<'hir>], DotDotPos),
17941791

1795-
/// A `box` pattern.
1796-
Box(&'hir Pat<'hir>),
1797-
17981792
/// A `deref` pattern (currently `deref!()` macro-based syntax).
17991793
Deref(&'hir Pat<'hir>),
18001794

compiler/rustc_hir/src/intravisit.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -746,9 +746,7 @@ pub fn walk_pat<'v, V: Visitor<'v>>(visitor: &mut V, pattern: &'v Pat<'v>) -> V:
746746
PatKind::Tuple(tuple_elements, _) => {
747747
walk_list!(visitor, visit_pat, tuple_elements);
748748
}
749-
PatKind::Box(ref subpattern)
750-
| PatKind::Deref(ref subpattern)
751-
| PatKind::Ref(ref subpattern, _, _) => {
749+
PatKind::Deref(ref subpattern) | PatKind::Ref(ref subpattern, _, _) => {
752750
try_visit!(visitor.visit_pat(subpattern));
753751
}
754752
PatKind::Binding(_, _hir_id, ident, ref optional_subpattern) => {

0 commit comments

Comments
 (0)