Skip to content

Commit

Permalink
Merge commit 'af40101841c45aa75b56f4e9ca745369da8fb4ba' into sync-fro…
Browse files Browse the repository at this point in the history
…m-ra
  • Loading branch information
lnicola committed Jan 8, 2024
1 parent 79fa976 commit 3afeb24
Show file tree
Hide file tree
Showing 115 changed files with 3,088 additions and 3,605 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[workspace]
members = ["xtask/", "lib/*", "crates/*"]
exclude = ["crates/proc-macro-srv/proc-macro-test/"]
exclude = ["crates/proc-macro-srv/proc-macro-test/imp"]
resolver = "2"

[workspace.package]
Expand Down Expand Up @@ -138,4 +138,4 @@ dashmap = { version = "=5.5.3", features = ["raw-api"] }
collapsible_if = "allow"
needless_pass_by_value = "allow"
nonminimal_bool = "allow"
redundant_pattern_matching = "allow"
redundant_pattern_matching = "allow"
7 changes: 4 additions & 3 deletions crates/hir-def/src/body/lower.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use smallvec::SmallVec;
use syntax::{
ast::{
self, ArrayExprKind, AstChildren, BlockExpr, HasArgList, HasAttrs, HasLoopBody, HasName,
SlicePatComponents,
RangeItem, SlicePatComponents,
},
AstNode, AstPtr, SyntaxNodePtr,
};
Expand Down Expand Up @@ -622,7 +622,8 @@ impl ExprCollector<'_> {
ast::Expr::IndexExpr(e) => {
let base = self.collect_expr_opt(e.base());
let index = self.collect_expr_opt(e.index());
self.alloc_expr(Expr::Index { base, index }, syntax_ptr)
let is_assignee_expr = self.is_lowering_assignee_expr;
self.alloc_expr(Expr::Index { base, index, is_assignee_expr }, syntax_ptr)
}
ast::Expr::RangeExpr(e) => {
let lhs = e.start().map(|lhs| self.collect_expr(lhs));
Expand Down Expand Up @@ -1609,7 +1610,7 @@ impl ExprCollector<'_> {
|name| self.alloc_expr_desugared(Expr::Path(Path::from(name))),
|name, span| {
if let Some(span) = span {
mappings.push((span, name.clone()))
mappings.push((span, name))
}
},
),
Expand Down
2 changes: 1 addition & 1 deletion crates/hir-def/src/body/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ impl Printer<'_> {
w!(self, ") ");
}
}
Expr::Index { base, index } => {
Expr::Index { base, index, is_assignee_expr: _ } => {
self.print_expr(*base);
w!(self, "[");
self.print_expr(*index);
Expand Down
2 changes: 1 addition & 1 deletion crates/hir-def/src/data/adt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ fn parse_repr_tt(tt: &Subtree) -> Option<ReprOptions> {
} else {
0
};
let pack = Align::from_bytes(pack).unwrap();
let pack = Align::from_bytes(pack).unwrap_or(Align::ONE);
min_pack =
Some(if let Some(min_pack) = min_pack { min_pack.min(pack) } else { pack });
ReprFlags::empty()
Expand Down
3 changes: 2 additions & 1 deletion crates/hir-def/src/hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ pub enum Expr {
Index {
base: ExprId,
index: ExprId,
is_assignee_expr: bool,
},
Closure {
args: Box<[PatId]>,
Expand Down Expand Up @@ -432,7 +433,7 @@ impl Expr {
f(rhs);
}
}
Expr::Index { base, index } => {
Expr::Index { base, index, .. } => {
f(*base);
f(*index);
}
Expand Down
Loading

0 comments on commit 3afeb24

Please sign in to comment.