@@ -100,7 +100,9 @@ use rustc_hir::def::{CtorOf, DefKind, Res};
100100use rustc_hir:: def_id:: { CrateNum , DefId , DefIdMap , DefIdSet , LocalDefId , LOCAL_CRATE } ;
101101use rustc_hir:: intravisit:: { self , NestedVisitorMap , Visitor } ;
102102use rustc_hir:: itemlikevisit:: ItemLikeVisitor ;
103- use rustc_hir:: lang_items;
103+ use rustc_hir:: lang_items:: {
104+ FutureTraitLangItem , PinTypeLangItem , SizedTraitLangItem , VaListTypeLangItem ,
105+ } ;
104106use rustc_hir:: { ExprKind , GenericArg , HirIdMap , Item , ItemKind , Node , PatKind , QPath } ;
105107use rustc_index:: bit_set:: BitSet ;
106108use rustc_index:: vec:: Idx ;
@@ -1335,10 +1337,8 @@ fn check_fn<'a, 'tcx>(
13351337 // C-variadic fns also have a `VaList` input that's not listed in `fn_sig`
13361338 // (as it's created inside the body itself, not passed in from outside).
13371339 let maybe_va_list = if fn_sig. c_variadic {
1338- let va_list_did = tcx. require_lang_item (
1339- lang_items:: VaListTypeLangItem ,
1340- Some ( body. params . last ( ) . unwrap ( ) . span ) ,
1341- ) ;
1340+ let va_list_did =
1341+ tcx. require_lang_item ( VaListTypeLangItem , Some ( body. params . last ( ) . unwrap ( ) . span ) ) ;
13421342 let region = tcx. mk_region ( ty:: ReScope ( region:: Scope {
13431343 id : body. value . hir_id . local_id ,
13441344 data : region:: ScopeData :: CallSite ,
@@ -3296,7 +3296,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
32963296 code : traits:: ObligationCauseCode < ' tcx > ,
32973297 ) {
32983298 if !ty. references_error ( ) {
3299- let lang_item = self . tcx . require_lang_item ( lang_items :: SizedTraitLangItem , None ) ;
3299+ let lang_item = self . tcx . require_lang_item ( SizedTraitLangItem , None ) ;
33003300 self . require_type_meets ( ty, span, code, lang_item) ;
33013301 }
33023302 }
@@ -5135,7 +5135,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
51355135 _ => { }
51365136 }
51375137 let boxed_found = self . tcx . mk_box ( found) ;
5138- let new_found = self . tcx . mk_lang_item ( boxed_found, lang_items :: PinTypeLangItem ) . unwrap ( ) ;
5138+ let new_found = self . tcx . mk_lang_item ( boxed_found, PinTypeLangItem ) . unwrap ( ) ;
51395139 if let ( true , Ok ( snippet) ) = (
51405140 self . can_coerce ( new_found, expected) ,
51415141 self . sess ( ) . source_map ( ) . span_to_snippet ( expr. span ) ,
@@ -5292,7 +5292,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
52925292 let sp = expr. span ;
52935293 // Check for `Future` implementations by constructing a predicate to
52945294 // prove: `<T as Future>::Output == U`
5295- let future_trait = self . tcx . lang_items ( ) . future_trait ( ) . unwrap ( ) ;
5295+ let future_trait = self . tcx . require_lang_item ( FutureTraitLangItem , Some ( sp ) ) ;
52965296 let item_def_id = self
52975297 . tcx
52985298 . associated_items ( future_trait)
0 commit comments