@@ -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 ;
@@ -1342,10 +1344,8 @@ fn check_fn<'a, 'tcx>(
13421344 // C-variadic fns also have a `VaList` input that's not listed in `fn_sig`
13431345 // (as it's created inside the body itself, not passed in from outside).
13441346 let maybe_va_list = if fn_sig. c_variadic {
1345- let va_list_did = tcx. require_lang_item (
1346- lang_items:: VaListTypeLangItem ,
1347- Some ( body. params . last ( ) . unwrap ( ) . span ) ,
1348- ) ;
1347+ let va_list_did =
1348+ tcx. require_lang_item ( VaListTypeLangItem , Some ( body. params . last ( ) . unwrap ( ) . span ) ) ;
13491349 let region = tcx. mk_region ( ty:: ReScope ( region:: Scope {
13501350 id : body. value . hir_id . local_id ,
13511351 data : region:: ScopeData :: CallSite ,
@@ -3303,7 +3303,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
33033303 code : traits:: ObligationCauseCode < ' tcx > ,
33043304 ) {
33053305 if !ty. references_error ( ) {
3306- let lang_item = self . tcx . require_lang_item ( lang_items :: SizedTraitLangItem , None ) ;
3306+ let lang_item = self . tcx . require_lang_item ( SizedTraitLangItem , None ) ;
33073307 self . require_type_meets ( ty, span, code, lang_item) ;
33083308 }
33093309 }
@@ -5142,7 +5142,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
51425142 _ => { }
51435143 }
51445144 let boxed_found = self . tcx . mk_box ( found) ;
5145- let new_found = self . tcx . mk_lang_item ( boxed_found, lang_items :: PinTypeLangItem ) . unwrap ( ) ;
5145+ let new_found = self . tcx . mk_lang_item ( boxed_found, PinTypeLangItem ) . unwrap ( ) ;
51465146 if let ( true , Ok ( snippet) ) = (
51475147 self . can_coerce ( new_found, expected) ,
51485148 self . sess ( ) . source_map ( ) . span_to_snippet ( expr. span ) ,
@@ -5298,7 +5298,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
52985298 let sp = expr. span ;
52995299 // Check for `Future` implementations by constructing a predicate to
53005300 // prove: `<T as Future>::Output == U`
5301- let future_trait = self . tcx . lang_items ( ) . future_trait ( ) . unwrap ( ) ;
5301+ let future_trait = self . tcx . require_lang_item ( FutureTraitLangItem , Some ( sp ) ) ;
53025302 let item_def_id = self
53035303 . tcx
53045304 . associated_items ( future_trait)
0 commit comments