@@ -100,7 +100,9 @@ use rustc_hir::def::{CtorOf, DefKind, Res};
100
100
use rustc_hir:: def_id:: { CrateNum , DefId , DefIdMap , DefIdSet , LocalDefId , LOCAL_CRATE } ;
101
101
use rustc_hir:: intravisit:: { self , NestedVisitorMap , Visitor } ;
102
102
use rustc_hir:: itemlikevisit:: ItemLikeVisitor ;
103
- use rustc_hir:: lang_items;
103
+ use rustc_hir:: lang_items:: {
104
+ FutureTraitLangItem , PinTypeLangItem , SizedTraitLangItem , VaListTypeLangItem ,
105
+ } ;
104
106
use rustc_hir:: { ExprKind , GenericArg , HirIdMap , Item , ItemKind , Node , PatKind , QPath } ;
105
107
use rustc_index:: bit_set:: BitSet ;
106
108
use rustc_index:: vec:: Idx ;
@@ -1335,10 +1337,8 @@ fn check_fn<'a, 'tcx>(
1335
1337
// C-variadic fns also have a `VaList` input that's not listed in `fn_sig`
1336
1338
// (as it's created inside the body itself, not passed in from outside).
1337
1339
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 ) ) ;
1342
1342
let region = tcx. mk_region ( ty:: ReScope ( region:: Scope {
1343
1343
id : body. value . hir_id . local_id ,
1344
1344
data : region:: ScopeData :: CallSite ,
@@ -3296,7 +3296,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
3296
3296
code : traits:: ObligationCauseCode < ' tcx > ,
3297
3297
) {
3298
3298
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 ) ;
3300
3300
self . require_type_meets ( ty, span, code, lang_item) ;
3301
3301
}
3302
3302
}
@@ -5135,7 +5135,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
5135
5135
_ => { }
5136
5136
}
5137
5137
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 ( ) ;
5139
5139
if let ( true , Ok ( snippet) ) = (
5140
5140
self . can_coerce ( new_found, expected) ,
5141
5141
self . sess ( ) . source_map ( ) . span_to_snippet ( expr. span ) ,
@@ -5292,7 +5292,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
5292
5292
let sp = expr. span ;
5293
5293
// Check for `Future` implementations by constructing a predicate to
5294
5294
// 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 ) ) ;
5296
5296
let item_def_id = self
5297
5297
. tcx
5298
5298
. associated_items ( future_trait)
0 commit comments