@@ -17,7 +17,7 @@ use rustc_lint::LateContext;
17
17
use rustc_middle:: mir:: interpret:: { ConstValue , Scalar } ;
18
18
use rustc_middle:: ty:: {
19
19
self , AdtDef , AssocKind , Binder , BoundRegion , DefIdTree , FnSig , IntTy , List , ParamEnv , Predicate , PredicateKind ,
20
- ProjectionTy , Region , RegionKind , SubstsRef , Ty , TyCtxt , TypeSuperVisitable , TypeVisitable , TypeVisitor , UintTy ,
20
+ AliasTy , Region , RegionKind , SubstsRef , Ty , TyCtxt , TypeSuperVisitable , TypeVisitable , TypeVisitor , UintTy ,
21
21
VariantDef , VariantDiscr ,
22
22
} ;
23
23
use rustc_middle:: ty:: { GenericArg , GenericArgKind } ;
@@ -79,7 +79,7 @@ pub fn contains_ty_adt_constructor_opaque<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'
79
79
return true ;
80
80
}
81
81
82
- if let ty:: Opaque ( ty:: OpaqueTy { def_id, substs : _ } ) = * inner_ty. kind ( ) {
82
+ if let ty:: Opaque ( ty:: AliasTy { def_id, substs : _ } ) = * inner_ty. kind ( ) {
83
83
for & ( predicate, _span) in cx. tcx . explicit_item_bounds ( def_id) {
84
84
match predicate. kind ( ) . skip_binder ( ) {
85
85
// For `impl Trait<U>`, it will register a predicate of `T: Trait<U>`, so we go through
@@ -250,7 +250,7 @@ pub fn is_must_use_ty<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> bool {
250
250
is_must_use_ty ( cx, * ty)
251
251
} ,
252
252
ty:: Tuple ( substs) => substs. iter ( ) . any ( |ty| is_must_use_ty ( cx, ty) ) ,
253
- ty:: Opaque ( ty:: OpaqueTy { def_id, substs : _ } ) => {
253
+ ty:: Opaque ( ty:: AliasTy { def_id, substs : _ } ) => {
254
254
for ( predicate, _) in cx. tcx . explicit_item_bounds ( * def_id) {
255
255
if let ty:: PredicateKind :: Clause ( ty:: Clause :: Trait ( trait_predicate) ) = predicate. kind ( ) . skip_binder ( ) {
256
256
if cx. tcx . has_attr ( trait_predicate. trait_ref . def_id , sym:: must_use) {
@@ -631,7 +631,7 @@ pub fn ty_sig<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> Option<ExprFnSig<'t
631
631
Some ( ExprFnSig :: Closure ( decl, subs. as_closure ( ) . sig ( ) ) )
632
632
} ,
633
633
ty:: FnDef ( id, subs) => Some ( ExprFnSig :: Sig ( cx. tcx . bound_fn_sig ( id) . subst ( cx. tcx , subs) , Some ( id) ) ) ,
634
- ty:: Opaque ( ty:: OpaqueTy { def_id, substs : _ } ) => sig_from_bounds ( cx, ty, cx. tcx . item_bounds ( def_id) , cx. tcx . opt_parent ( def_id) ) ,
634
+ ty:: Opaque ( ty:: AliasTy { def_id, substs : _ } ) => sig_from_bounds ( cx, ty, cx. tcx . item_bounds ( def_id) , cx. tcx . opt_parent ( def_id) ) ,
635
635
ty:: FnPtr ( sig) => Some ( ExprFnSig :: Sig ( sig, None ) ) ,
636
636
ty:: Dynamic ( bounds, _, _) => {
637
637
let lang_items = cx. tcx . lang_items ( ) ;
@@ -701,7 +701,7 @@ fn sig_from_bounds<'tcx>(
701
701
inputs. map ( |ty| ExprFnSig :: Trait ( ty, output, predicates_id) )
702
702
}
703
703
704
- fn sig_for_projection < ' tcx > ( cx : & LateContext < ' tcx > , ty : ProjectionTy < ' tcx > ) -> Option < ExprFnSig < ' tcx > > {
704
+ fn sig_for_projection < ' tcx > ( cx : & LateContext < ' tcx > , ty : AliasTy < ' tcx > ) -> Option < ExprFnSig < ' tcx > > {
705
705
let mut inputs = None ;
706
706
let mut output = None ;
707
707
let lang_items = cx. tcx . lang_items ( ) ;
@@ -980,13 +980,13 @@ pub fn make_projection<'tcx>(
980
980
container_id : DefId ,
981
981
assoc_ty : Symbol ,
982
982
substs : impl IntoIterator < Item = impl Into < GenericArg < ' tcx > > > ,
983
- ) -> Option < ProjectionTy < ' tcx > > {
983
+ ) -> Option < AliasTy < ' tcx > > {
984
984
fn helper < ' tcx > (
985
985
tcx : TyCtxt < ' tcx > ,
986
986
container_id : DefId ,
987
987
assoc_ty : Symbol ,
988
988
substs : SubstsRef < ' tcx > ,
989
- ) -> Option < ProjectionTy < ' tcx > > {
989
+ ) -> Option < AliasTy < ' tcx > > {
990
990
let Some ( assoc_item) = tcx
991
991
. associated_items ( container_id)
992
992
. find_by_name_and_kind ( tcx, Ident :: with_dummy_span ( assoc_ty) , AssocKind :: Type , container_id)
@@ -1039,7 +1039,7 @@ pub fn make_projection<'tcx>(
1039
1039
}
1040
1040
}
1041
1041
1042
- Some ( ProjectionTy {
1042
+ Some ( AliasTy {
1043
1043
substs,
1044
1044
def_id : assoc_item. def_id ,
1045
1045
} )
@@ -1065,7 +1065,7 @@ pub fn make_normalized_projection<'tcx>(
1065
1065
assoc_ty : Symbol ,
1066
1066
substs : impl IntoIterator < Item = impl Into < GenericArg < ' tcx > > > ,
1067
1067
) -> Option < Ty < ' tcx > > {
1068
- fn helper < ' tcx > ( tcx : TyCtxt < ' tcx > , param_env : ParamEnv < ' tcx > , ty : ProjectionTy < ' tcx > ) -> Option < Ty < ' tcx > > {
1068
+ fn helper < ' tcx > ( tcx : TyCtxt < ' tcx > , param_env : ParamEnv < ' tcx > , ty : AliasTy < ' tcx > ) -> Option < Ty < ' tcx > > {
1069
1069
#[ cfg( debug_assertions) ]
1070
1070
if let Some ( ( i, subst) ) = ty
1071
1071
. substs
0 commit comments