1
Fork 0

Add is_intrinsic helper

This commit is contained in:
Oli Scherer 2024-02-19 22:51:45 +00:00
parent 7606c13961
commit aa2ae6b491
6 changed files with 15 additions and 4 deletions

View file

@ -0,0 +1,10 @@
use rustc_span::{def_id::DefId, Symbol};
use super::TyCtxt;
impl TyCtxt<'_> {
pub fn is_intrinsic(self, def_id: DefId, name: Symbol) -> bool {
let Some(i) = self.intrinsic(def_id) else { return false };
i == name
}
}

View file

@ -149,6 +149,7 @@ mod generic_args;
mod generics;
mod impls_ty;
mod instance;
mod intrinsic;
mod list;
mod opaque_types;
mod parameterized;