Skip to content

Commit f7af19c

Browse files
committed
Auto merge of #63592 - Centril:rollup-7c6dg3e, r=Centril
Rollup of 9 pull requests Successful merges: - #63155 (Add UWP MSVC targets) - #63165 (Add builtin targets for mips64(el)-unknown-linux-muslabi64) - #63306 (Adapt AddRetag for shallow retagging) - #63467 (Add Catalyst (iOS apps running on macOS) target) - #63546 (Remove uses of `mem::uninitialized()` from cloudabi) - #63572 (remove unused Level::PhaseFatal) - #63577 (Test HRTB issue accepted by compiler) - #63582 (Fix ICE #63226) - #63586 (cleanup: Remove `Spanned` where possible) Failed merges: r? @ghost
2 parents 1cdcea9 + 6e8fabb commit f7af19c

Some content is hidden

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

66 files changed

+501
-223
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ then you may need to force rustbuild to use an older version. This can be done
144144
by manually calling the appropriate vcvars file before running the bootstrap.
145145
146146
```batch
147-
> CALL "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
147+
> CALL "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
148148
> python x.py build
149149
```
150150

src/librustc/cfg/construct.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
136136
}
137137

138138
PatKind::Struct(_, ref subpats, _) => {
139-
let pats_exit = self.pats_all(subpats.iter().map(|f| &f.node.pat), pred);
139+
let pats_exit = self.pats_all(subpats.iter().map(|f| &f.pat), pred);
140140
self.add_ast_node(pat.hir_id.local_id, &[pats_exit])
141141
}
142142

src/librustc/hir/intravisit.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -704,9 +704,9 @@ pub fn walk_pat<'v, V: Visitor<'v>>(visitor: &mut V, pattern: &'v Pat) {
704704
PatKind::Struct(ref qpath, ref fields, _) => {
705705
visitor.visit_qpath(qpath, pattern.hir_id, pattern.span);
706706
for field in fields {
707-
visitor.visit_id(field.node.hir_id);
708-
visitor.visit_ident(field.node.ident);
709-
visitor.visit_pat(&field.node.pat)
707+
visitor.visit_id(field.hir_id);
708+
visitor.visit_ident(field.ident);
709+
visitor.visit_pat(&field.pat)
710710
}
711711
}
712712
PatKind::Tuple(ref tuple_elements, _) => {

src/librustc/hir/lowering.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2691,16 +2691,12 @@ impl<'a> LoweringContext<'a> {
26912691

26922692
let fs = fields
26932693
.iter()
2694-
.map(|f| {
2695-
Spanned {
2696-
span: f.span,
2697-
node: hir::FieldPat {
2698-
hir_id: self.next_id(),
2699-
ident: f.node.ident,
2700-
pat: self.lower_pat(&f.node.pat),
2701-
is_shorthand: f.node.is_shorthand,
2702-
},
2703-
}
2694+
.map(|f| hir::FieldPat {
2695+
hir_id: self.next_id(),
2696+
ident: f.ident,
2697+
pat: self.lower_pat(&f.pat),
2698+
is_shorthand: f.is_shorthand,
2699+
span: f.span,
27042700
})
27052701
.collect();
27062702
hir::PatKind::Struct(qpath, fs, etc)

src/librustc/hir/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ impl Pat {
877877
match self.node {
878878
PatKind::Binding(.., Some(ref p)) => p.walk_(it),
879879
PatKind::Struct(_, ref fields, _) => {
880-
fields.iter().all(|field| field.node.pat.walk_(it))
880+
fields.iter().all(|field| field.pat.walk_(it))
881881
}
882882
PatKind::TupleStruct(_, ref s, _) | PatKind::Tuple(ref s, _) => {
883883
s.iter().all(|p| p.walk_(it))
@@ -923,6 +923,7 @@ pub struct FieldPat {
923923
/// The pattern the field is destructured to.
924924
pub pat: P<Pat>,
925925
pub is_shorthand: bool,
926+
pub span: Span,
926927
}
927928

928929
/// Explicit binding annotations given in the HIR for a binding. Note
@@ -968,7 +969,7 @@ pub enum PatKind {
968969

969970
/// A struct or struct variant pattern (e.g., `Variant {x, y, ..}`).
970971
/// The `bool` is `true` in the presence of a `..`.
971-
Struct(QPath, HirVec<Spanned<FieldPat>>, bool),
972+
Struct(QPath, HirVec<FieldPat>, bool),
972973

973974
/// A tuple struct/variant pattern `Variant(x, y, .., z)`.
974975
/// If the `..` pattern fragment is present, then `Option<usize>` denotes its position.

src/librustc/hir/print.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1670,14 +1670,14 @@ impl<'a> State<'a> {
16701670
&fields[..],
16711671
|s, f| {
16721672
s.cbox(INDENT_UNIT);
1673-
if !f.node.is_shorthand {
1674-
s.print_ident(f.node.ident);
1673+
if !f.is_shorthand {
1674+
s.print_ident(f.ident);
16751675
s.word_nbsp(":");
16761676
}
1677-
s.print_pat(&f.node.pat);
1677+
s.print_pat(&f.pat);
16781678
s.end()
16791679
},
1680-
|f| f.node.pat.span);
1680+
|f| f.pat.span);
16811681
if etc {
16821682
if !fields.is_empty() {
16831683
self.word_space(",");

src/librustc/ich/impls_hir.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,6 @@ impl<'a> HashStable<StableHashingContext<'a>> for hir::Ty {
153153
}
154154
}
155155

156-
impl_stable_hash_for_spanned!(hir::FieldPat);
157-
158156
impl_stable_hash_for_spanned!(hir::BinOpKind);
159157

160158
impl_stable_hash_for!(struct hir::Stmt {
@@ -187,8 +185,6 @@ impl<'a> HashStable<StableHashingContext<'a>> for hir::Expr {
187185

188186
impl_stable_hash_for_spanned!(usize);
189187

190-
impl_stable_hash_for_spanned!(ast::Ident);
191-
192188
impl_stable_hash_for!(struct ast::Ident {
193189
name,
194190
span,

src/librustc/lint/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1345,7 +1345,7 @@ impl<'a, T: EarlyLintPass> ast_visit::Visitor<'a> for EarlyContextAndPass<'a, T>
13451345
// part of `walk_mac`, and (b) we should be calling
13461346
// `visit_path`, *but* that would require a `NodeId`, and I
13471347
// want to get #53686 fixed quickly. -nmatsakis
1348-
ast_visit::walk_path(self, &mac.node.path);
1348+
ast_visit::walk_path(self, &mac.path);
13491349

13501350
run_early_pass!(self, check_mac, mac);
13511351
}

src/librustc/middle/dead.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ use crate::util::nodemap::FxHashSet;
1717

1818
use rustc_data_structures::fx::FxHashMap;
1919

20-
use syntax::{ast, source_map};
21-
use syntax::attr;
20+
use syntax::{ast, attr};
2221
use syntax::symbol::sym;
2322
use syntax_pos;
2423

@@ -119,17 +118,16 @@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> {
119118
}
120119
}
121120

122-
fn handle_field_pattern_match(&mut self, lhs: &hir::Pat, res: Res,
123-
pats: &[source_map::Spanned<hir::FieldPat>]) {
121+
fn handle_field_pattern_match(&mut self, lhs: &hir::Pat, res: Res, pats: &[hir::FieldPat]) {
124122
let variant = match self.tables.node_type(lhs.hir_id).sty {
125123
ty::Adt(adt, _) => adt.variant_of_res(res),
126124
_ => span_bug!(lhs.span, "non-ADT in struct pattern")
127125
};
128126
for pat in pats {
129-
if let PatKind::Wild = pat.node.pat.node {
127+
if let PatKind::Wild = pat.pat.node {
130128
continue;
131129
}
132-
let index = self.tcx.field_index(pat.node.hir_id, self.tables);
130+
let index = self.tcx.field_index(pat.hir_id, self.tables);
133131
self.insert_def_id(variant.fields[index].did);
134132
}
135133
}

src/librustc/middle/liveness.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,8 @@ fn add_from_pat<'tcx>(ir: &mut IrMaps<'tcx>, pat: &P<hir::Pat>) {
418418
}
419419
Struct(_, ref fields, _) => {
420420
for field in fields {
421-
if field.node.is_shorthand {
422-
shorthand_field_ids.insert(field.node.pat.hir_id);
421+
if field.is_shorthand {
422+
shorthand_field_ids.insert(field.pat.hir_id);
423423
}
424424
}
425425
}

0 commit comments

Comments
 (0)