Skip to content

Commit ba8079d

Browse files
Make a fake body to store typeck results for global_asm
1 parent e5dbcc2 commit ba8079d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

clippy_lints/src/operators/numeric_arithmetic.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl Context {
8282
}
8383
self.const_span = Some(body_span);
8484
},
85-
hir::BodyOwnerKind::Fn | hir::BodyOwnerKind::Closure => (),
85+
hir::BodyOwnerKind::Fn | hir::BodyOwnerKind::Closure | hir::BodyOwnerKind::GlobalAsm => (),
8686
}
8787
}
8888

clippy_utils/src/hir_utils.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -968,7 +968,10 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
968968
self.hash_expr(out_expr);
969969
}
970970
},
971-
InlineAsmOperand::Const { anon_const } | InlineAsmOperand::SymFn { anon_const } => {
971+
InlineAsmOperand::SymFn { expr } => {
972+
self.hash_expr(expr);
973+
}
974+
InlineAsmOperand::Const { anon_const } => {
972975
self.hash_body(anon_const.body);
973976
},
974977
InlineAsmOperand::SymStatic { path, def_id: _ } => self.hash_qpath(path),

0 commit comments

Comments
 (0)