Auto merge of #76931 - oli-obk:const_prop_inline_lint_madness, r=wesleywiser
Properly handle lint spans after MIR inlining The first commit shows what happens when we apply mir inlining and then cause lints on the inlined MIR. The second commit fixes that. r? `@wesleywiser`
This commit is contained in:
commit
5cdf5b882d
40 changed files with 400 additions and 350 deletions
|
@ -299,7 +299,7 @@ pub trait Emitter {
|
|||
|
||||
// Skip past non-macro entries, just in case there
|
||||
// are some which do actually involve macros.
|
||||
ExpnKind::Desugaring(..) | ExpnKind::AstPass(..) => None,
|
||||
ExpnKind::Inlined | ExpnKind::Desugaring(..) | ExpnKind::AstPass(..) => None,
|
||||
|
||||
ExpnKind::Macro(macro_kind, _) => Some(macro_kind),
|
||||
}
|
||||
|
@ -359,7 +359,10 @@ pub trait Emitter {
|
|||
continue;
|
||||
}
|
||||
|
||||
if always_backtrace {
|
||||
if matches!(trace.kind, ExpnKind::Inlined) {
|
||||
new_labels
|
||||
.push((trace.call_site, "in the inlined copy of this code".to_string()));
|
||||
} else if always_backtrace {
|
||||
new_labels.push((
|
||||
trace.def_site,
|
||||
format!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue