Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-expand/src/builtin/fn_macro.rs')
-rw-r--r--crates/hir-expand/src/builtin/fn_macro.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/hir-expand/src/builtin/fn_macro.rs b/crates/hir-expand/src/builtin/fn_macro.rs
index 9962677a9d..eb7175c686 100644
--- a/crates/hir-expand/src/builtin/fn_macro.rs
+++ b/crates/hir-expand/src/builtin/fn_macro.rs
@@ -357,7 +357,7 @@ fn cfg_select_expand(
tt: &tt::TopSubtree,
span: Span,
) -> ExpandResult<tt::TopSubtree> {
- let loc = db.lookup_intern_macro_call(id);
+ let loc = id.loc(db);
let cfg_options = loc.krate.cfg_options(db);
let mut iter = tt.iter();
@@ -446,7 +446,7 @@ fn cfg_expand(
tt: &tt::TopSubtree,
span: Span,
) -> ExpandResult<tt::TopSubtree> {
- let loc = db.lookup_intern_macro_call(id);
+ let loc = id.loc(db);
let expr = CfgExpr::parse(tt);
let enabled = loc.krate.cfg_options(db).check(&expr) != Some(false);
let expanded = if enabled { quote!(span=>true) } else { quote!(span=>false) };
@@ -518,7 +518,7 @@ fn use_panic_2021(db: &dyn ExpandDatabase, span: Span) -> bool {
let Some(expn) = span.ctx.outer_expn(db) else {
break false;
};
- let expn = db.lookup_intern_macro_call(expn.into());
+ let expn = crate::MacroCallId::from(expn).loc(db);
// FIXME: Record allow_internal_unstable in the macro def (not been done yet because it
// would consume quite a bit extra memory for all call locs...)
// if let Some(features) = expn.def.allow_internal_unstable {
@@ -764,7 +764,7 @@ fn relative_file(
allow_recursion: bool,
err_span: Span,
) -> Result<EditionedFileId, ExpandError> {
- let lookup = db.lookup_intern_macro_call(call_id);
+ let lookup = call_id.loc(db);
let call_site = lookup.kind.file_id().original_file_respecting_includes(db).file_id(db);
let path = AnchoredPath { anchor: call_site, path: path_str };
let res: FileId = db
@@ -900,7 +900,7 @@ fn include_str_expand(
}
fn get_env_inner(db: &dyn ExpandDatabase, arg_id: MacroCallId, key: &Symbol) -> Option<String> {
- let krate = db.lookup_intern_macro_call(arg_id).krate;
+ let krate = arg_id.loc(db).krate;
krate.env(db).get(key.as_str())
}