@@ -1112,6 +1112,7 @@ where
11121112/// * For an opaque type, there is no explicit syntax.
11131113#[ derive( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash , TyEncodable , TyDecodable ) ]
11141114#[ derive( HashStable , TypeFoldable , TypeVisitable , Lift ) ]
1115+ #[ non_exhaustive]
11151116pub struct AliasTy < ' tcx > {
11161117 /// The parameters of the associated or opaque item.
11171118 ///
@@ -1136,10 +1137,6 @@ pub struct AliasTy<'tcx> {
11361137 /// `TraitRef` containing this associated type, which is in `tcx.associated_item(def_id).container`,
11371138 /// aka. `tcx.parent(def_id)`.
11381139 pub def_id : DefId ,
1139-
1140- /// This field exists to prevent the creation of `AliasTy` without using
1141- /// [AliasTy::new].
1142- _use_alias_ty_new_instead : ( ) ,
11431140}
11441141
11451142impl < ' tcx > AliasTy < ' tcx > {
@@ -1149,7 +1146,7 @@ impl<'tcx> AliasTy<'tcx> {
11491146 args : impl IntoIterator < Item : Into < GenericArg < ' tcx > > > ,
11501147 ) -> ty:: AliasTy < ' tcx > {
11511148 let args = tcx. check_and_mk_args ( def_id, args) ;
1152- ty:: AliasTy { def_id, args, _use_alias_ty_new_instead : ( ) }
1149+ ty:: AliasTy { def_id, args }
11531150 }
11541151
11551152 pub fn kind ( self , tcx : TyCtxt < ' tcx > ) -> ty:: AliasKind {
0 commit comments