@@ -1055,7 +1055,7 @@ impl DefCollector<'_> {
1055
1055
};
1056
1056
let mut res = ReachedFixedPoint::Yes;
1057
1057
macros.retain(|directive| {
1058
- let resolver2 = |path| {
1058
+ let resolver = |path| {
1059
1059
let resolved_res = self.def_map.resolve_path_fp_with_macro(
1060
1060
self.db,
1061
1061
ResolveMode::Other,
@@ -1068,7 +1068,7 @@ impl DefCollector<'_> {
1068
1068
.take_macros()
1069
1069
.map(|it| (it, macro_id_to_def_id(self.db, it)))
1070
1070
};
1071
- let resolver = |path| resolver2 (path).map(|(_, it)| it);
1071
+ let resolver_def_id = |path| resolver (path).map(|(_, it)| it);
1072
1072
1073
1073
match &directive.kind {
1074
1074
MacroDirectiveKind::FnLike { ast_id, expand_to } => {
@@ -1077,7 +1077,7 @@ impl DefCollector<'_> {
1077
1077
ast_id,
1078
1078
*expand_to,
1079
1079
self.def_map.krate,
1080
- &resolver ,
1080
+ &resolver_def_id ,
1081
1081
&mut |_err| (),
1082
1082
);
1083
1083
if let Ok(Ok(call_id)) = call_id {
@@ -1093,7 +1093,7 @@ impl DefCollector<'_> {
1093
1093
*derive_attr,
1094
1094
*derive_pos as u32,
1095
1095
self.def_map.krate,
1096
- &resolver2 ,
1096
+ &resolver ,
1097
1097
);
1098
1098
1099
1099
if let Ok((macro_id, def_id, call_id)) = id {
@@ -1158,7 +1158,7 @@ impl DefCollector<'_> {
1158
1158
}
1159
1159
}
1160
1160
1161
- let def = match resolver (path.clone()) {
1161
+ let def = match resolver_def_id (path.clone()) {
1162
1162
Some(def) if def.is_attribute() => def,
1163
1163
_ => return true,
1164
1164
};
@@ -1292,7 +1292,8 @@ impl DefCollector<'_> {
1292
1292
true
1293
1293
});
1294
1294
// Attribute resolution can add unresolved macro invocations, so concatenate the lists.
1295
- self.unresolved_macros.extend(macros);
1295
+ macros.extend(mem::take(&mut self.unresolved_macros));
1296
+ self.unresolved_macros = macros;
1296
1297
1297
1298
for (module_id, depth, container, macro_call_id) in resolved {
1298
1299
self.collect_macro_expansion(module_id, macro_call_id, depth, container);
0 commit comments