Skip to content

Commit

Permalink
Make a fake body to store typeck results for global_asm
Browse files Browse the repository at this point in the history
  • Loading branch information
compiler-errors committed Feb 22, 2025
1 parent e5dbcc2 commit ba8079d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion clippy_lints/src/operators/numeric_arithmetic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl Context {
}
self.const_span = Some(body_span);
},
hir::BodyOwnerKind::Fn | hir::BodyOwnerKind::Closure => (),
hir::BodyOwnerKind::Fn | hir::BodyOwnerKind::Closure | hir::BodyOwnerKind::GlobalAsm => (),
}
}

Expand Down
5 changes: 4 additions & 1 deletion clippy_utils/src/hir_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,10 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
self.hash_expr(out_expr);
}
},
InlineAsmOperand::Const { anon_const } | InlineAsmOperand::SymFn { anon_const } => {
InlineAsmOperand::SymFn { expr } => {
self.hash_expr(expr);
}
InlineAsmOperand::Const { anon_const } => {
self.hash_body(anon_const.body);
},
InlineAsmOperand::SymStatic { path, def_id: _ } => self.hash_qpath(path),
Expand Down

0 comments on commit ba8079d

Please sign in to comment.