Add a query for checking whether a function is an intrinsic.

This commit is contained in:
Oli Scherer
2022-05-13 13:50:21 +00:00
parent 18bd2dd5cd
commit 0a6b69106e
17 changed files with 52 additions and 45 deletions

View File

@@ -706,8 +706,6 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
#[instrument(level = "debug", skip(self))]
fn visit_terminator(&mut self, terminator: &Terminator<'tcx>, location: Location) {
use rustc_target::spec::abi::Abi::RustIntrinsic;
self.super_terminator(terminator, location);
match &terminator.kind {
@@ -889,7 +887,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
return;
}
let is_intrinsic = tcx.fn_sig(callee).abi() == RustIntrinsic;
let is_intrinsic = tcx.is_intrinsic(callee);
if !tcx.is_const_fn_raw(callee) {
if tcx.trait_of_item(callee).is_some() {