@@ -1017,34 +1017,25 @@ impl<'tcx> ty::TyS<'tcx> {
10171017}
10181018
10191019fn is_copy_raw < ' tcx > ( tcx : TyCtxt < ' tcx > , query : ty:: ParamEnvAnd < ' tcx , Ty < ' tcx > > ) -> bool {
1020- let ( param_env, ty) = query. into_parts ( ) ;
1021- let trait_def_id = tcx. require_lang_item ( lang_items:: CopyTraitLangItem , None ) ;
1022- tcx. infer_ctxt ( )
1023- . enter ( |infcx| traits:: type_known_to_meet_bound_modulo_regions (
1024- & infcx,
1025- param_env,
1026- ty,
1027- trait_def_id,
1028- DUMMY_SP ,
1029- ) )
1020+ is_item_raw ( tcx, query, lang_items:: CopyTraitLangItem )
10301021}
10311022
10321023fn is_sized_raw < ' tcx > ( tcx : TyCtxt < ' tcx > , query : ty:: ParamEnvAnd < ' tcx , Ty < ' tcx > > ) -> bool {
1033- let ( param_env, ty) = query. into_parts ( ) ;
1034- let trait_def_id = tcx. require_lang_item ( lang_items:: SizedTraitLangItem , None ) ;
1035- tcx. infer_ctxt ( )
1036- . enter ( |infcx| traits:: type_known_to_meet_bound_modulo_regions (
1037- & infcx,
1038- param_env,
1039- ty,
1040- trait_def_id,
1041- DUMMY_SP ,
1042- ) )
1024+ is_item_raw ( tcx, query, lang_items:: SizedTraitLangItem )
1025+
10431026}
10441027
10451028fn is_freeze_raw < ' tcx > ( tcx : TyCtxt < ' tcx > , query : ty:: ParamEnvAnd < ' tcx , Ty < ' tcx > > ) -> bool {
1029+ is_item_raw ( tcx, query, lang_items:: FreezeTraitLangItem )
1030+ }
1031+
1032+ fn is_item_raw < ' tcx > (
1033+ tcx : TyCtxt < ' tcx > ,
1034+ query : ty:: ParamEnvAnd < ' tcx , Ty < ' tcx > > ,
1035+ item : LangItem
1036+ ) -> bool {
10461037 let ( param_env, ty) = query. into_parts ( ) ;
1047- let trait_def_id = tcx. require_lang_item ( lang_items :: FreezeTraitLangItem , None ) ;
1038+ let trait_def_id = tcx. require_lang_item ( item , None ) ;
10481039 tcx. infer_ctxt ( )
10491040 . enter ( |infcx| traits:: type_known_to_meet_bound_modulo_regions (
10501041 & infcx,
0 commit comments