Skip to content

Commit a399117

Browse files
committed
Auto merge of #119732 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer` r? ghost
2 parents d6affcf + fd63ff0 commit a399117

File tree

115 files changed

+3088
-3605
lines changed

Some content is hidden

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

115 files changed

+3088
-3605
lines changed

src/tools/rust-analyzer/Cargo.lock

+1
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,7 @@ dependencies = [
569569
"expect-test",
570570
"hir-def",
571571
"hir-expand",
572+
"indexmap",
572573
"intern",
573574
"itertools",
574575
"la-arena 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",

src/tools/rust-analyzer/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[workspace]
22
members = ["xtask/", "lib/*", "crates/*"]
3-
exclude = ["crates/proc-macro-srv/proc-macro-test/"]
3+
exclude = ["crates/proc-macro-srv/proc-macro-test/imp"]
44
resolver = "2"
55

66
[workspace.package]
@@ -138,4 +138,4 @@ dashmap = { version = "=5.5.3", features = ["raw-api"] }
138138
collapsible_if = "allow"
139139
needless_pass_by_value = "allow"
140140
nonminimal_bool = "allow"
141-
redundant_pattern_matching = "allow"
141+
redundant_pattern_matching = "allow"

src/tools/rust-analyzer/crates/hir-def/src/body/lower.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use smallvec::SmallVec;
1717
use syntax::{
1818
ast::{
1919
self, ArrayExprKind, AstChildren, BlockExpr, HasArgList, HasAttrs, HasLoopBody, HasName,
20-
SlicePatComponents,
20+
RangeItem, SlicePatComponents,
2121
},
2222
AstNode, AstPtr, SyntaxNodePtr,
2323
};
@@ -622,7 +622,8 @@ impl ExprCollector<'_> {
622622
ast::Expr::IndexExpr(e) => {
623623
let base = self.collect_expr_opt(e.base());
624624
let index = self.collect_expr_opt(e.index());
625-
self.alloc_expr(Expr::Index { base, index }, syntax_ptr)
625+
let is_assignee_expr = self.is_lowering_assignee_expr;
626+
self.alloc_expr(Expr::Index { base, index, is_assignee_expr }, syntax_ptr)
626627
}
627628
ast::Expr::RangeExpr(e) => {
628629
let lhs = e.start().map(|lhs| self.collect_expr(lhs));
@@ -1609,7 +1610,7 @@ impl ExprCollector<'_> {
16091610
|name| self.alloc_expr_desugared(Expr::Path(Path::from(name))),
16101611
|name, span| {
16111612
if let Some(span) = span {
1612-
mappings.push((span, name.clone()))
1613+
mappings.push((span, name))
16131614
}
16141615
},
16151616
),

src/tools/rust-analyzer/crates/hir-def/src/body/pretty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ impl Printer<'_> {
376376
w!(self, ") ");
377377
}
378378
}
379-
Expr::Index { base, index } => {
379+
Expr::Index { base, index, is_assignee_expr: _ } => {
380380
self.print_expr(*base);
381381
w!(self, "[");
382382
self.print_expr(*index);

src/tools/rust-analyzer/crates/hir-def/src/data/adt.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ fn parse_repr_tt(tt: &Subtree) -> Option<ReprOptions> {
128128
} else {
129129
0
130130
};
131-
let pack = Align::from_bytes(pack).unwrap();
131+
let pack = Align::from_bytes(pack).unwrap_or(Align::ONE);
132132
min_pack =
133133
Some(if let Some(min_pack) = min_pack { min_pack.min(pack) } else { pack });
134134
ReprFlags::empty()

src/tools/rust-analyzer/crates/hir-def/src/hir.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ pub enum Expr {
265265
Index {
266266
base: ExprId,
267267
index: ExprId,
268+
is_assignee_expr: bool,
268269
},
269270
Closure {
270271
args: Box<[PatId]>,
@@ -432,7 +433,7 @@ impl Expr {
432433
f(rhs);
433434
}
434435
}
435-
Expr::Index { base, index } => {
436+
Expr::Index { base, index, .. } => {
436437
f(*base);
437438
f(*index);
438439
}

0 commit comments

Comments
 (0)