Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/body/lower.rs')
-rw-r--r--crates/hir-def/src/body/lower.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/hir-def/src/body/lower.rs b/crates/hir-def/src/body/lower.rs
index 145afc1b61..9c547574ec 100644
--- a/crates/hir-def/src/body/lower.rs
+++ b/crates/hir-def/src/body/lower.rs
@@ -1,6 +1,8 @@
//! Transforms `ast::Expr` into an equivalent `hir_def::expr::Expr`
//! representation.
+mod asm;
+
use std::mem;
use base_db::CrateId;
@@ -35,8 +37,8 @@ use crate::{
FormatPlaceholder, FormatSign, FormatTrait,
},
Array, Binding, BindingAnnotation, BindingId, BindingProblems, CaptureBy, ClosureKind,
- Expr, ExprId, InlineAsm, Label, LabelId, Literal, LiteralOrConst, MatchArm, Movability,
- OffsetOf, Pat, PatId, RecordFieldPat, RecordLitField, Statement,
+ Expr, ExprId, Label, LabelId, Literal, LiteralOrConst, MatchArm, Movability, OffsetOf, Pat,
+ PatId, RecordFieldPat, RecordLitField, Statement,
},
item_scope::BuiltinShadowMode,
lang_item::LangItem,
@@ -693,10 +695,7 @@ impl ExprCollector<'_> {
}
}
ast::Expr::UnderscoreExpr(_) => self.alloc_expr(Expr::Underscore, syntax_ptr),
- ast::Expr::AsmExpr(e) => {
- let e = self.collect_expr_opt(e.expr());
- self.alloc_expr(Expr::InlineAsm(InlineAsm { e }), syntax_ptr)
- }
+ ast::Expr::AsmExpr(e) => self.lower_inline_asm(e, syntax_ptr),
ast::Expr::OffsetOfExpr(e) => {
let container = Interned::new(TypeRef::from_ast_opt(&self.ctx(), e.ty()));
let fields = e.fields().map(|it| it.as_name()).collect();
@@ -1848,7 +1847,7 @@ impl ExprCollector<'_> {
},
syntax_ptr,
);
- self.source_map.format_args_template_map.insert(idx, mappings);
+ self.source_map.template_map.get_or_insert_with(Default::default).0.insert(idx, mappings);
idx
}
@@ -2061,6 +2060,7 @@ impl ExprCollector<'_> {
is_assignee_expr: false,
})
}
+
// endregion: format
fn lang_path(&self, lang: LangItem) -> Option<Path> {