@@ -18,10 +18,12 @@ use rustc_type_ir::{CollectAndApply, Interner, TypeFoldable, search_graph};
1818use crate :: dep_graph:: { DepKind , DepNodeIndex } ;
1919use crate :: infer:: canonical:: CanonicalVarKinds ;
2020use crate :: query:: IntoQueryParam ;
21+ use crate :: traits:: ObligationCause ;
2122use crate :: traits:: cache:: WithDepNode ;
2223use crate :: traits:: solve:: {
2324 self , CanonicalInput , ExternalConstraints , ExternalConstraintsData , QueryResult , inspect,
2425} ;
26+ use crate :: ty:: util:: Discr ;
2527use crate :: ty:: {
2628 self , AdtDef , Clause , Const , List , ParamTy , Pattern , PolyExistentialPredicate , Predicate ,
2729 Region , Ty , TyCtxt , VariantDef ,
@@ -50,6 +52,8 @@ impl<'tcx> Interner for TyCtxt<'tcx> {
5052 type Interned < T : Copy + Clone + std:: fmt:: Debug + std:: hash:: Hash + Eq + PartialEq > =
5153 Interned < ' tcx , T > ;
5254 type VariantIdx = VariantIdx ;
55+ type Discr = Discr ;
56+ type ObligationCause = ObligationCause ;
5357
5458 type GenericArgs = ty:: GenericArgsRef < ' tcx > ;
5559
@@ -471,6 +475,10 @@ impl<'tcx> Interner for TyCtxt<'tcx> {
471475 self . is_lang_item ( def_id, solver_lang_item_to_lang_item ( lang_item) )
472476 }
473477
478+ pub fn is_c_void ( self , adt : AdtDef ) -> bool {
479+ self . is_c_void ( adt)
480+ }
481+
474482 fn is_trait_lang_item ( self , def_id : DefId , lang_item : SolverTraitLangItem ) -> bool {
475483 self . is_lang_item ( def_id, solver_trait_lang_item_to_lang_item ( lang_item) )
476484 }
@@ -743,10 +751,36 @@ impl<'tcx> Interner for TyCtxt<'tcx> {
743751 } )
744752 }
745753
754+ #[ inline]
755+ fn i8_type ( self ) -> Ty < ' tcx > {
756+ self . types . i8
757+ }
758+
759+ #[ inline]
760+ fn i16_type ( self ) -> Ty < ' tcx > {
761+ self . types . i16
762+ }
763+
764+ #[ inline]
765+ fn i32_type ( self ) -> Ty < ' tcx > {
766+ self . types . i32
767+ }
768+
769+ #[ inline]
746770 fn u8_type ( self ) -> Ty < ' tcx > {
747771 self . types . u8
748772 }
749773
774+ #[ inline]
775+ fn usize_type ( self ) -> Ty < ' tcx > {
776+ self . types . usize
777+ }
778+
779+ #[ inline]
780+ fn unit_type ( self ) -> Ty < ' tcx > {
781+ self . types . unit
782+ }
783+
750784 fn is_async_drop_in_place_coroutine ( self , def_id : DefId ) -> bool {
751785 self . is_lang_item ( self . parent ( def_id) , LangItem :: AsyncDropInPlace )
752786 }
@@ -759,6 +793,16 @@ impl<'tcx> Interner for TyCtxt<'tcx> {
759793 ) -> Range < VariantIdx > {
760794 self . coroutine_variant_range ( def_id, coroutine_args)
761795 }
796+
797+ fn struct_tail_raw (
798+ self ,
799+ mut ty : Ty < ' tcx > ,
800+ cause : & ObligationCause < ' tcx > ,
801+ mut normalize : impl FnMut ( Ty < ' tcx > ) -> Ty < ' tcx > ,
802+ mut f : impl FnMut ( ) -> ( ) ,
803+ ) -> Ty < ' tcx > {
804+ self . struct_tail_raw ( ty, cause, normalize, f)
805+ }
762806}
763807
764808/// Defines trivial conversion functions between the main [`LangItem`] enum,
0 commit comments