Add a method to check if type is a CStr
This commit is contained in:
parent
3f39cae119
commit
86451badf1
4 changed files with 37 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue