Add is_intrinsic
helper
This commit is contained in:
parent
7606c13961
commit
aa2ae6b491
6 changed files with 15 additions and 4 deletions
10
compiler/rustc_middle/src/ty/intrinsic.rs
Normal file
10
compiler/rustc_middle/src/ty/intrinsic.rs
Normal 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
|
||||
}
|
||||
}
|
|
@ -149,6 +149,7 @@ mod generic_args;
|
|||
mod generics;
|
||||
mod impls_ty;
|
||||
mod instance;
|
||||
mod intrinsic;
|
||||
mod list;
|
||||
mod opaque_types;
|
||||
mod parameterized;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue