1
Fork 0

Show the inline stack of MIR lints that only occur after inlining

This commit is contained in:
Oliver Scherer 2020-09-19 18:56:32 +02:00 committed by oli
parent 4445e46518
commit c8a866ea17
40 changed files with 378 additions and 353 deletions

View file

@ -358,7 +358,9 @@ pub fn struct_lint_level<'s, 'd>(
pub fn in_external_macro(sess: &Session, span: Span) -> bool {
let expn_data = span.ctxt().outer_expn_data();
match expn_data.kind {
ExpnKind::Root | ExpnKind::Desugaring(DesugaringKind::ForLoop(_)) => false,
ExpnKind::Inlined | ExpnKind::Root | ExpnKind::Desugaring(DesugaringKind::ForLoop(_)) => {
false
}
ExpnKind::AstPass(_) | ExpnKind::Desugaring(_) => true, // well, it's "external"
ExpnKind::Macro(MacroKind::Bang, _) => {
// Dummy span for the `def_site` means it's an external macro.