Skip to content

Commit

Permalink
Merge #10193
Browse files Browse the repository at this point in the history
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 <jonasschievink@gmail.com>
  • Loading branch information
bors[bot] and jonas-schievink committed Sep 9, 2021
2 parents 8e47e35 + 9a320bc commit 21a1ced
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion crates/hir_def/src/nameres/collector.rs
Expand Up @@ -1812,7 +1812,20 @@ impl ModCollector<'_, '_> {
name = tt::Ident { text: it.clone(), id: tt::TokenId::unspecified() }.as_name();
&name
}
None => &mac.name,
None => {
match attrs.by_key("rustc_builtin_macro").tt_values().next().and_then(|tt| {
match tt.token_trees.first() {
Some(tt::TokenTree::Leaf(tt::Leaf::Ident(name))) => Some(name),
_ => None,
}
}) {
Some(ident) => {
name = ident.as_name();
&name
}
None => &mac.name,
}
}
};
let krate = self.def_collector.def_map.krate;
match find_builtin_macro(name, krate, ast_id) {
Expand Down

0 comments on commit 21a1ced

Please sign in to comment.