@@ -41,7 +41,7 @@ use std::collections::BTreeSet;
41
41
use std:: iter;
42
42
use std:: slice;
43
43
44
- use super :: { allow_type_alias_enum_variants } ;
44
+ use super :: { check_type_alias_enum_variants_enabled } ;
45
45
46
46
pub trait AstConv < ' gcx , ' tcx > {
47
47
fn tcx < ' a > ( & ' a self ) -> TyCtxt < ' a , ' gcx , ' tcx > ;
@@ -1263,7 +1263,6 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
1263
1263
ref_id : ast:: NodeId ,
1264
1264
span : Span ,
1265
1265
ty : Ty < ' tcx > ,
1266
- qself : & hir:: Ty ,
1267
1266
ty_path_def : Def ,
1268
1267
item_segment : & hir:: PathSegment )
1269
1268
-> ( Ty < ' tcx > , Def )
@@ -1282,10 +1281,11 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
1282
1281
tcx. hygienic_eq ( assoc_name, vd. ident , adt_def. did )
1283
1282
} ) ;
1284
1283
if let Some ( variant_def) = variant_def {
1285
- if allow_type_alias_enum_variants ( tcx, qself, span) {
1286
- let def = Def :: Variant ( variant_def. did ) ;
1287
- return ( ty, def) ;
1288
- }
1284
+ check_type_alias_enum_variants_enabled ( tcx, span) ;
1285
+
1286
+ let def = Def :: Variant ( variant_def. did ) ;
1287
+ tcx. check_stability ( def. def_id ( ) , Some ( ref_id) , span) ;
1288
+ return ( ty, def) ;
1289
1289
}
1290
1290
}
1291
1291
}
@@ -1362,8 +1362,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
1362
1362
let item = tcx. associated_items ( trait_did) . find ( |i| {
1363
1363
Namespace :: from ( i. kind ) == Namespace :: Type &&
1364
1364
i. ident . modern ( ) == assoc_ident
1365
- } )
1366
- . expect ( "missing associated type" ) ;
1365
+ } ) . expect ( "missing associated type" ) ;
1367
1366
1368
1367
let ty = self . projected_ty_from_poly_trait_ref ( span, item. def_id , bound) ;
1369
1368
let ty = self . normalize_ty ( span, ty) ;
@@ -1604,7 +1603,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
1604
1603
} else {
1605
1604
Def :: Err
1606
1605
} ;
1607
- self . associated_path_def_to_ty ( ast_ty. id , ast_ty. span , ty, qself , def, segment) . 0
1606
+ self . associated_path_def_to_ty ( ast_ty. id , ast_ty. span , ty, def, segment) . 0
1608
1607
}
1609
1608
hir:: TyKind :: Array ( ref ty, ref length) => {
1610
1609
let length_def_id = tcx. hir ( ) . local_def_id ( length. id ) ;
0 commit comments