1
Fork 0

Add a method to check if type is a CStr

This commit is contained in:
Celina G. Val 2023-12-15 13:18:41 -08:00
parent 3f39cae119
commit 86451badf1
4 changed files with 37 additions and 0 deletions

View file

@ -220,6 +220,12 @@ impl<'tcx> Context for TablesWrapper<'tcx> {
def.internal(&mut *tables).repr().simd()
}
fn adt_is_cstr(&self, def: AdtDef) -> bool {
let mut tables = self.0.borrow_mut();
let def_id = def.0.internal(&mut *tables);
tables.tcx.lang_items().c_str() == Some(def_id)
}
fn fn_sig(&self, def: FnDef, args: &GenericArgs) -> PolyFnSig {
let mut tables = self.0.borrow_mut();
let def_id = def.0.internal(&mut *tables);