Skip to content

Commit 21a1ced

Browse files
Merge #10193
10193: fix: fix type mismatches with `panic!()` on Rust 1.55.0 r=jonas-schievink a=jonas-schievink This addresses the regression mentioned in #8961 (comment) (no test because #10192 makes that rather hard, but I've checked that the analysis-stats are back to normal) bors r+ Co-authored-by: Jonas Schievink <[email protected]>
2 parents 8e47e35 + 9a320bc commit 21a1ced

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

crates/hir_def/src/nameres/collector.rs

+14-1
Original file line numberDiff line numberDiff line change
@@ -1812,7 +1812,20 @@ impl ModCollector<'_, '_> {
18121812
name = tt::Ident { text: it.clone(), id: tt::TokenId::unspecified() }.as_name();
18131813
&name
18141814
}
1815-
None => &mac.name,
1815+
None => {
1816+
match attrs.by_key("rustc_builtin_macro").tt_values().next().and_then(|tt| {
1817+
match tt.token_trees.first() {
1818+
Some(tt::TokenTree::Leaf(tt::Leaf::Ident(name))) => Some(name),
1819+
_ => None,
1820+
}
1821+
}) {
1822+
Some(ident) => {
1823+
name = ident.as_name();
1824+
&name
1825+
}
1826+
None => &mac.name,
1827+
}
1828+
}
18161829
};
18171830
let krate = self.def_collector.def_map.krate;
18181831
match find_builtin_macro(name, krate, ast_id) {

0 commit comments

Comments
 (0)