@@ -67,7 +67,6 @@ use syntax::ast;
6767use syntax:: ast:: * ;
6868use syntax:: errors;
6969use syntax:: ext:: hygiene:: { Mark , SyntaxContext } ;
70- use syntax:: feature_gate:: { emit_feature_err, GateIssue } ;
7170use syntax:: print:: pprust;
7271use syntax:: ptr:: P ;
7372use syntax:: source_map:: { self , respan, CompilerDesugaringKind , Spanned } ;
@@ -3628,7 +3627,6 @@ impl<'a> LoweringContext<'a> {
36283627 ParamMode :: Optional ,
36293628 ImplTraitContext :: disallowed ( ) ,
36303629 ) ;
3631- self . check_self_struct_ctor_feature ( & qpath) ;
36323630 hir:: PatKind :: TupleStruct (
36333631 qpath,
36343632 pats. iter ( ) . map ( |x| self . lower_pat ( x) ) . collect ( ) ,
@@ -3643,7 +3641,6 @@ impl<'a> LoweringContext<'a> {
36433641 ParamMode :: Optional ,
36443642 ImplTraitContext :: disallowed ( ) ,
36453643 ) ;
3646- self . check_self_struct_ctor_feature ( & qpath) ;
36473644 hir:: PatKind :: Path ( qpath)
36483645 }
36493646 PatKind :: Struct ( ref path, ref fields, etc) => {
@@ -4039,7 +4036,6 @@ impl<'a> LoweringContext<'a> {
40394036 ParamMode :: Optional ,
40404037 ImplTraitContext :: disallowed ( ) ,
40414038 ) ;
4042- self . check_self_struct_ctor_feature ( & qpath) ;
40434039 hir:: ExprKind :: Path ( qpath)
40444040 }
40454041 ExprKind :: Break ( opt_label, ref opt_expr) => {
@@ -5102,18 +5098,6 @@ impl<'a> LoweringContext<'a> {
51025098 ThinVec :: new ( ) ) ) ;
51035099 P ( self . expr_call ( e. span , from_err, hir_vec ! [ e] ) )
51045100 }
5105-
5106- fn check_self_struct_ctor_feature ( & self , qp : & hir:: QPath ) {
5107- if let hir:: QPath :: Resolved ( _, ref p) = qp {
5108- if p. segments . len ( ) == 1 &&
5109- p. segments [ 0 ] . ident . name == keywords:: SelfType . name ( ) &&
5110- !self . sess . features_untracked ( ) . self_struct_ctor {
5111- emit_feature_err ( & self . sess . parse_sess , "self_struct_ctor" ,
5112- p. span , GateIssue :: Language ,
5113- "`Self` struct constructors are unstable" ) ;
5114- }
5115- }
5116- }
51175101}
51185102
51195103fn body_ids ( bodies : & BTreeMap < hir:: BodyId , hir:: Body > ) -> Vec < hir:: BodyId > {
0 commit comments