about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2018-03-08 22:24:10 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2018-04-05 02:19:56 +0300
commit1a2a23447e451faee7ffbffab2be8831f3098f6d (patch)
treee338e0d07dea5b0ca852969f34d16c55fa4978f9
parentfb44b4c0eb1d344f84f7bb2c90f28e31a8a180be (diff)
downloadrust-1a2a23447e451faee7ffbffab2be8831f3098f6d.tar.gz
rust-1a2a23447e451faee7ffbffab2be8831f3098f6d.zip
Stabilize attributes on generic parameters
-rw-r--r--src/liballoc/lib.rs2
-rw-r--r--src/libarena/lib.rs2
-rw-r--r--src/librustc_typeck/diagnostics.rs1
-rw-r--r--src/libstd/lib.rs2
-rw-r--r--src/libsyntax/feature_gate.rs20
-rw-r--r--src/test/compile-fail/attrs-with-no-formal-in-generics-1.rs3
-rw-r--r--src/test/compile-fail/attrs-with-no-formal-in-generics-2.rs3
-rw-r--r--src/test/compile-fail/synthetic-param.rs2
-rw-r--r--src/test/mir-opt/end_region_destruction_extents_1.rs1
-rw-r--r--src/test/run-pass/attr-on-generic-formals.rs2
-rw-r--r--src/test/run-pass/auxiliary/dropck_eyepatch_extern_crate.rs1
-rw-r--r--src/test/run-pass/dropck-eyepatch-reorder.rs1
-rw-r--r--src/test/run-pass/dropck-eyepatch.rs1
-rw-r--r--src/test/ui/dropck/auxiliary/dropck_eyepatch_extern_crate.rs1
-rw-r--r--src/test/ui/dropck/dropck-eyepatch-implies-unsafe-impl.rs1
-rw-r--r--src/test/ui/dropck/dropck-eyepatch-implies-unsafe-impl.stderr4
-rw-r--r--src/test/ui/dropck/dropck-eyepatch-reorder.rs1
-rw-r--r--src/test/ui/dropck/dropck-eyepatch-reorder.stderr8
-rw-r--r--src/test/ui/dropck/dropck-eyepatch.rs1
-rw-r--r--src/test/ui/dropck/dropck-eyepatch.stderr8
-rw-r--r--src/test/ui/feature-gate-custom_attribute2.rs7
-rw-r--r--src/test/ui/feature-gate-custom_attribute2.stderr34
-rw-r--r--src/test/ui/feature-gate-generic_param_attrs.stderr139
-rw-r--r--src/test/ui/feature-gate-may-dangle.rs2
-rw-r--r--src/test/ui/feature-gate-may-dangle.stderr2
-rw-r--r--src/test/ui/generic-param-attrs.rs (renamed from src/test/ui/feature-gate-generic_param_attrs.rs)34
-rw-r--r--src/test/ui/nll/drop-may-dangle.rs1
-rw-r--r--src/test/ui/nll/drop-no-may-dangle.rs1
-rw-r--r--src/test/ui/nll/drop-no-may-dangle.stderr4
29 files changed, 45 insertions, 244 deletions
diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs
index 2fad3b0bad4..cbbea6c19c8 100644
--- a/src/liballoc/lib.rs
+++ b/src/liballoc/lib.rs
@@ -97,7 +97,7 @@
 #![feature(fmt_internals)]
 #![feature(from_ref)]
 #![feature(fundamental)]
-#![feature(generic_param_attrs)]
+#![cfg_attr(stage0, feature(generic_param_attrs))]
 #![cfg_attr(stage0, feature(i128_type))]
 #![feature(iter_rfold)]
 #![feature(lang_items)]
diff --git a/src/libarena/lib.rs b/src/libarena/lib.rs
index 72fa3148fe5..7eaf67e6ea6 100644
--- a/src/libarena/lib.rs
+++ b/src/libarena/lib.rs
@@ -27,7 +27,7 @@
 #![feature(alloc)]
 #![feature(core_intrinsics)]
 #![feature(dropck_eyepatch)]
-#![feature(generic_param_attrs)]
+#![cfg_attr(stage0, feature(generic_param_attrs))]
 #![cfg_attr(test, feature(test))]
 
 #![allow(deprecated)]
diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs
index 99726bb65f3..79d7c8e7282 100644
--- a/src/librustc_typeck/diagnostics.rs
+++ b/src/librustc_typeck/diagnostics.rs
@@ -3784,7 +3784,6 @@ that impl must be declared as an `unsafe impl.
 Erroneous code example:
 
 ```compile_fail,E0569
-#![feature(generic_param_attrs)]
 #![feature(dropck_eyepatch)]
 
 struct Foo<X>(X);
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
index e18e055654b..3f1fec4c317 100644
--- a/src/libstd/lib.rs
+++ b/src/libstd/lib.rs
@@ -266,7 +266,7 @@
 #![feature(float_from_str_radix)]
 #![feature(fn_traits)]
 #![feature(fnbox)]
-#![feature(generic_param_attrs)]
+#![cfg_attr(stage0, feature(generic_param_attrs))]
 #![feature(hashmap_internals)]
 #![feature(heap_api)]
 #![cfg_attr(stage0, feature(i128_type, i128))]
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs
index e734a4e3735..1cf62a8bf33 100644
--- a/src/libsyntax/feature_gate.rs
+++ b/src/libsyntax/feature_gate.rs
@@ -288,9 +288,6 @@ declare_features! (
     // rustc internal
     (active, compiler_builtins, "1.13.0", None, None),
 
-    // Allows attributes on lifetime/type formal parameters in generics (RFC 1327)
-    (active, generic_param_attrs, "1.11.0", Some(34761), None),
-
     // Allows #[link(..., cfg(..))]
     (active, link_cfg, "1.14.0", Some(37406), None),
 
@@ -566,6 +563,8 @@ declare_features! (
     (accepted, match_default_bindings, "1.26.0", Some(42640), None),
     // allow `'_` placeholder lifetimes
     (accepted, underscore_lifetimes, "1.26.0", Some(44524), None),
+    // Allows attributes on lifetime/type formal parameters in generics (RFC 1327)
+    (accepted, generic_param_attrs, "1.26.0", Some(48848), None),
 );
 
 // If you change this, please modify src/doc/unstable-book as well. You must
@@ -1775,21 +1774,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
         }
         visit::walk_vis(self, vis);
     }
-
-    fn visit_generic_param(&mut self, param: &'a ast::GenericParam) {
-        let (attrs, explain) = match *param {
-            ast::GenericParam::Lifetime(ref ld) =>
-                (&ld.attrs, "attributes on lifetime bindings are experimental"),
-            ast::GenericParam::Type(ref t) =>
-                (&t.attrs, "attributes on type parameter bindings are experimental"),
-        };
-
-        if !attrs.is_empty() {
-            gate_feature_post!(&self, generic_param_attrs, attrs[0].span, explain);
-        }
-
-        visit::walk_generic_param(self, param)
-    }
 }
 
 pub fn get_features(span_handler: &Handler, krate_attrs: &[ast::Attribute],
diff --git a/src/test/compile-fail/attrs-with-no-formal-in-generics-1.rs b/src/test/compile-fail/attrs-with-no-formal-in-generics-1.rs
index 53e287cda20..ec7885f1f44 100644
--- a/src/test/compile-fail/attrs-with-no-formal-in-generics-1.rs
+++ b/src/test/compile-fail/attrs-with-no-formal-in-generics-1.rs
@@ -12,8 +12,7 @@
 // `#[oops]` is left dangling (that is, it is unattached, with no
 // formal binding following it).
 
-#![feature(generic_param_attrs, rustc_attrs)]
-#![allow(dead_code)]
+#![feature(rustc_attrs)]
 
 struct RefIntPair<'a, 'b>(&'a u32, &'b u32);
 
diff --git a/src/test/compile-fail/attrs-with-no-formal-in-generics-2.rs b/src/test/compile-fail/attrs-with-no-formal-in-generics-2.rs
index 5e09473ab77..efe2d5561a8 100644
--- a/src/test/compile-fail/attrs-with-no-formal-in-generics-2.rs
+++ b/src/test/compile-fail/attrs-with-no-formal-in-generics-2.rs
@@ -12,8 +12,7 @@
 // `#[oops]` is left dangling (that is, it is unattached, with no
 // formal binding following it).
 
-#![feature(generic_param_attrs, rustc_attrs)]
-#![allow(dead_code)]
+#![feature(rustc_attrs)]
 
 struct RefAny<'a, T>(&'a T);
 
diff --git a/src/test/compile-fail/synthetic-param.rs b/src/test/compile-fail/synthetic-param.rs
index a9762e383fe..337cae1369e 100644
--- a/src/test/compile-fail/synthetic-param.rs
+++ b/src/test/compile-fail/synthetic-param.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(generic_param_attrs, rustc_attrs)]
+#![feature(rustc_attrs)]
 
 fn func<#[rustc_synthetic] T>(_: T) {}
 
diff --git a/src/test/mir-opt/end_region_destruction_extents_1.rs b/src/test/mir-opt/end_region_destruction_extents_1.rs
index 69c5cdccf49..e189f2e3b34 100644
--- a/src/test/mir-opt/end_region_destruction_extents_1.rs
+++ b/src/test/mir-opt/end_region_destruction_extents_1.rs
@@ -14,7 +14,6 @@
 // A scenario with significant destruction code extents (which have
 // suffix "dce" in current `-Z identify_regions` rendering).
 
-#![feature(generic_param_attrs)]
 #![feature(dropck_eyepatch)]
 
 fn main() {
diff --git a/src/test/run-pass/attr-on-generic-formals.rs b/src/test/run-pass/attr-on-generic-formals.rs
index 5985284d849..e87b9e3d82a 100644
--- a/src/test/run-pass/attr-on-generic-formals.rs
+++ b/src/test/run-pass/attr-on-generic-formals.rs
@@ -17,7 +17,7 @@
 // using `rustc_attrs` feature. There is a separate compile-fail/ test
 // ensuring that the attribute feature-gating works in this context.)
 
-#![feature(generic_param_attrs, rustc_attrs)]
+#![feature(rustc_attrs)]
 #![allow(dead_code)]
 
 struct StLt<#[rustc_lt_struct] 'a>(&'a u32);
diff --git a/src/test/run-pass/auxiliary/dropck_eyepatch_extern_crate.rs b/src/test/run-pass/auxiliary/dropck_eyepatch_extern_crate.rs
index 1266e589b12..d8912943441 100644
--- a/src/test/run-pass/auxiliary/dropck_eyepatch_extern_crate.rs
+++ b/src/test/run-pass/auxiliary/dropck_eyepatch_extern_crate.rs
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(generic_param_attrs)]
 #![feature(dropck_eyepatch)]
 
 // The point of this test is to illustrate that the `#[may_dangle]`
diff --git a/src/test/run-pass/dropck-eyepatch-reorder.rs b/src/test/run-pass/dropck-eyepatch-reorder.rs
index bbf8bb8c352..a99a7232e9e 100644
--- a/src/test/run-pass/dropck-eyepatch-reorder.rs
+++ b/src/test/run-pass/dropck-eyepatch-reorder.rs
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(generic_param_attrs)]
 #![feature(dropck_eyepatch)]
 
 // The point of this test is to test uses of `#[may_dangle]` attribute
diff --git a/src/test/run-pass/dropck-eyepatch.rs b/src/test/run-pass/dropck-eyepatch.rs
index 4a09ba05dff..c0c091d78eb 100644
--- a/src/test/run-pass/dropck-eyepatch.rs
+++ b/src/test/run-pass/dropck-eyepatch.rs
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(generic_param_attrs)]
 #![feature(dropck_eyepatch)]
 
 // The point of this test is to illustrate that the `#[may_dangle]`
diff --git a/src/test/ui/dropck/auxiliary/dropck_eyepatch_extern_crate.rs b/src/test/ui/dropck/auxiliary/dropck_eyepatch_extern_crate.rs
index 1b00d88dcb3..08722ca62ac 100644
--- a/src/test/ui/dropck/auxiliary/dropck_eyepatch_extern_crate.rs
+++ b/src/test/ui/dropck/auxiliary/dropck_eyepatch_extern_crate.rs
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(generic_param_attrs)]
 #![feature(dropck_eyepatch)]
 
 // This is a support file for ../dropck-eyepatch-extern-crate.rs
diff --git a/src/test/ui/dropck/dropck-eyepatch-implies-unsafe-impl.rs b/src/test/ui/dropck/dropck-eyepatch-implies-unsafe-impl.rs
index f92c8703dc9..cba438b02a9 100644
--- a/src/test/ui/dropck/dropck-eyepatch-implies-unsafe-impl.rs
+++ b/src/test/ui/dropck/dropck-eyepatch-implies-unsafe-impl.rs
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(generic_param_attrs)]
 #![feature(dropck_eyepatch)]
 
 // This test ensures that a use of `#[may_dangle]` is rejected if
diff --git a/src/test/ui/dropck/dropck-eyepatch-implies-unsafe-impl.stderr b/src/test/ui/dropck/dropck-eyepatch-implies-unsafe-impl.stderr
index f4ea7f1bc50..9d68ff13ef3 100644
--- a/src/test/ui/dropck/dropck-eyepatch-implies-unsafe-impl.stderr
+++ b/src/test/ui/dropck/dropck-eyepatch-implies-unsafe-impl.stderr
@@ -1,5 +1,5 @@
 error[E0569]: requires an `unsafe impl` declaration due to `#[may_dangle]` attribute
-  --> $DIR/dropck-eyepatch-implies-unsafe-impl.rs:32:1
+  --> $DIR/dropck-eyepatch-implies-unsafe-impl.rs:31:1
    |
 LL | / impl<#[may_dangle] A, B: fmt::Debug> Drop for Pt<A, B> {
 LL | |     //~^ ERROR requires an `unsafe impl` declaration due to `#[may_dangle]` attribute
@@ -10,7 +10,7 @@ LL | | }
    | |_^
 
 error[E0569]: requires an `unsafe impl` declaration due to `#[may_dangle]` attribute
-  --> $DIR/dropck-eyepatch-implies-unsafe-impl.rs:38:1
+  --> $DIR/dropck-eyepatch-implies-unsafe-impl.rs:37:1
    |
 LL | / impl<#[may_dangle] 'a, 'b, B: fmt::Debug> Drop for Pr<'a, 'b, B> {
 LL | |     //~^ ERROR requires an `unsafe impl` declaration due to `#[may_dangle]` attribute
diff --git a/src/test/ui/dropck/dropck-eyepatch-reorder.rs b/src/test/ui/dropck/dropck-eyepatch-reorder.rs
index 3bd9efb32b3..eda8d85f6ec 100644
--- a/src/test/ui/dropck/dropck-eyepatch-reorder.rs
+++ b/src/test/ui/dropck/dropck-eyepatch-reorder.rs
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(generic_param_attrs)]
 #![feature(dropck_eyepatch)]
 
 // The point of this test is to test uses of `#[may_dangle]` attribute
diff --git a/src/test/ui/dropck/dropck-eyepatch-reorder.stderr b/src/test/ui/dropck/dropck-eyepatch-reorder.stderr
index e6ce53402f4..1a35996a0ca 100644
--- a/src/test/ui/dropck/dropck-eyepatch-reorder.stderr
+++ b/src/test/ui/dropck/dropck-eyepatch-reorder.stderr
@@ -1,5 +1,5 @@
 error[E0597]: `c` does not live long enough
-  --> $DIR/dropck-eyepatch-reorder.rs:57:20
+  --> $DIR/dropck-eyepatch-reorder.rs:56:20
    |
 LL |     dt = Dt("dt", &c);
    |                    ^ borrowed value does not live long enough
@@ -10,7 +10,7 @@ LL | }
    = note: values in a scope are dropped in the opposite order they are created
 
 error[E0597]: `c` does not live long enough
-  --> $DIR/dropck-eyepatch-reorder.rs:59:20
+  --> $DIR/dropck-eyepatch-reorder.rs:58:20
    |
 LL |     dr = Dr("dr", &c);
    |                    ^ borrowed value does not live long enough
@@ -21,7 +21,7 @@ LL | }
    = note: values in a scope are dropped in the opposite order they are created
 
 error[E0597]: `c` does not live long enough
-  --> $DIR/dropck-eyepatch-reorder.rs:67:29
+  --> $DIR/dropck-eyepatch-reorder.rs:66:29
    |
 LL |     pt = Pt("pt", &c_long, &c);
    |                             ^ borrowed value does not live long enough
@@ -32,7 +32,7 @@ LL | }
    = note: values in a scope are dropped in the opposite order they are created
 
 error[E0597]: `c` does not live long enough
-  --> $DIR/dropck-eyepatch-reorder.rs:69:29
+  --> $DIR/dropck-eyepatch-reorder.rs:68:29
    |
 LL |     pr = Pr("pr", &c_long, &c);
    |                             ^ borrowed value does not live long enough
diff --git a/src/test/ui/dropck/dropck-eyepatch.rs b/src/test/ui/dropck/dropck-eyepatch.rs
index abaae47189f..af173a2e979 100644
--- a/src/test/ui/dropck/dropck-eyepatch.rs
+++ b/src/test/ui/dropck/dropck-eyepatch.rs
@@ -8,7 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(generic_param_attrs)]
 #![feature(dropck_eyepatch)]
 
 // The point of this test is to illustrate that the `#[may_dangle]`
diff --git a/src/test/ui/dropck/dropck-eyepatch.stderr b/src/test/ui/dropck/dropck-eyepatch.stderr
index 5e0a4a74421..4d291642022 100644
--- a/src/test/ui/dropck/dropck-eyepatch.stderr
+++ b/src/test/ui/dropck/dropck-eyepatch.stderr
@@ -1,5 +1,5 @@
 error[E0597]: `c` does not live long enough
-  --> $DIR/dropck-eyepatch.rs:80:20
+  --> $DIR/dropck-eyepatch.rs:79:20
    |
 LL |     dt = Dt("dt", &c);
    |                    ^ borrowed value does not live long enough
@@ -10,7 +10,7 @@ LL | }
    = note: values in a scope are dropped in the opposite order they are created
 
 error[E0597]: `c` does not live long enough
-  --> $DIR/dropck-eyepatch.rs:82:20
+  --> $DIR/dropck-eyepatch.rs:81:20
    |
 LL |     dr = Dr("dr", &c);
    |                    ^ borrowed value does not live long enough
@@ -21,7 +21,7 @@ LL | }
    = note: values in a scope are dropped in the opposite order they are created
 
 error[E0597]: `c` does not live long enough
-  --> $DIR/dropck-eyepatch.rs:90:29
+  --> $DIR/dropck-eyepatch.rs:89:29
    |
 LL |     pt = Pt("pt", &c_long, &c);
    |                             ^ borrowed value does not live long enough
@@ -32,7 +32,7 @@ LL | }
    = note: values in a scope are dropped in the opposite order they are created
 
 error[E0597]: `c` does not live long enough
-  --> $DIR/dropck-eyepatch.rs:92:29
+  --> $DIR/dropck-eyepatch.rs:91:29
    |
 LL |     pr = Pr("pr", &c_long, &c);
    |                             ^ borrowed value does not live long enough
diff --git a/src/test/ui/feature-gate-custom_attribute2.rs b/src/test/ui/feature-gate-custom_attribute2.rs
index 0d89c52d885..30fd89f091b 100644
--- a/src/test/ui/feature-gate-custom_attribute2.rs
+++ b/src/test/ui/feature-gate-custom_attribute2.rs
@@ -10,16 +10,9 @@
 
 // This test ensures that attributes on formals in generic parameter
 // lists are included when we are checking for unstable attributes.
-//
-// Note that feature(generic_param_attrs) *is* enabled here. We are
-// checking feature-gating of the attributes themselves, not the
-// capability to parse such attributes in that context.
 
 // gate-test-custom_attribute
 
-#![feature(generic_param_attrs)]
-#![allow(dead_code)]
-
 struct StLt<#[lt_struct] 'a>(&'a u32);
 //~^ ERROR The attribute `lt_struct` is currently unknown to the compiler
 struct StTy<#[ty_struct] I>(I);
diff --git a/src/test/ui/feature-gate-custom_attribute2.stderr b/src/test/ui/feature-gate-custom_attribute2.stderr
index 90be45a33ea..1c1f50366d6 100644
--- a/src/test/ui/feature-gate-custom_attribute2.stderr
+++ b/src/test/ui/feature-gate-custom_attribute2.stderr
@@ -1,5 +1,5 @@
 error[E0658]: The attribute `lt_struct` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
-  --> $DIR/feature-gate-custom_attribute2.rs:23:13
+  --> $DIR/feature-gate-custom_attribute2.rs:16:13
    |
 LL | struct StLt<#[lt_struct] 'a>(&'a u32);
    |             ^^^^^^^^^^^^
@@ -7,7 +7,7 @@ LL | struct StLt<#[lt_struct] 'a>(&'a u32);
    = help: add #![feature(custom_attribute)] to the crate attributes to enable
 
 error[E0658]: The attribute `ty_struct` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
-  --> $DIR/feature-gate-custom_attribute2.rs:25:13
+  --> $DIR/feature-gate-custom_attribute2.rs:18:13
    |
 LL | struct StTy<#[ty_struct] I>(I);
    |             ^^^^^^^^^^^^
@@ -15,7 +15,7 @@ LL | struct StTy<#[ty_struct] I>(I);
    = help: add #![feature(custom_attribute)] to the crate attributes to enable
 
 error[E0658]: The attribute `lt_enum` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
-  --> $DIR/feature-gate-custom_attribute2.rs:28:11
+  --> $DIR/feature-gate-custom_attribute2.rs:21:11
    |
 LL | enum EnLt<#[lt_enum] 'b> { A(&'b u32), B }
    |           ^^^^^^^^^^
@@ -23,7 +23,7 @@ LL | enum EnLt<#[lt_enum] 'b> { A(&'b u32), B }
    = help: add #![feature(custom_attribute)] to the crate attributes to enable
 
 error[E0658]: The attribute `ty_enum` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
-  --> $DIR/feature-gate-custom_attribute2.rs:30:11
+  --> $DIR/feature-gate-custom_attribute2.rs:23:11
    |
 LL | enum EnTy<#[ty_enum] J> { A(J), B }
    |           ^^^^^^^^^^
@@ -31,7 +31,7 @@ LL | enum EnTy<#[ty_enum] J> { A(J), B }
    = help: add #![feature(custom_attribute)] to the crate attributes to enable
 
 error[E0658]: The attribute `lt_trait` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
-  --> $DIR/feature-gate-custom_attribute2.rs:33:12
+  --> $DIR/feature-gate-custom_attribute2.rs:26:12
    |
 LL | trait TrLt<#[lt_trait] 'c> { fn foo(&self, _: &'c [u32]) -> &'c u32; }
    |            ^^^^^^^^^^^
@@ -39,7 +39,7 @@ LL | trait TrLt<#[lt_trait] 'c> { fn foo(&self, _: &'c [u32]) -> &'c u32; }
    = help: add #![feature(custom_attribute)] to the crate attributes to enable
 
 error[E0658]: The attribute `ty_trait` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
-  --> $DIR/feature-gate-custom_attribute2.rs:35:12
+  --> $DIR/feature-gate-custom_attribute2.rs:28:12
    |
 LL | trait TrTy<#[ty_trait] K> { fn foo(&self, _: K); }
    |            ^^^^^^^^^^^
@@ -47,7 +47,7 @@ LL | trait TrTy<#[ty_trait] K> { fn foo(&self, _: K); }
    = help: add #![feature(custom_attribute)] to the crate attributes to enable
 
 error[E0658]: The attribute `lt_type` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
-  --> $DIR/feature-gate-custom_attribute2.rs:38:11
+  --> $DIR/feature-gate-custom_attribute2.rs:31:11
    |
 LL | type TyLt<#[lt_type] 'd> = &'d u32;
    |           ^^^^^^^^^^
@@ -55,7 +55,7 @@ LL | type TyLt<#[lt_type] 'd> = &'d u32;
    = help: add #![feature(custom_attribute)] to the crate attributes to enable
 
 error[E0658]: The attribute `ty_type` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
-  --> $DIR/feature-gate-custom_attribute2.rs:40:11
+  --> $DIR/feature-gate-custom_attribute2.rs:33:11
    |
 LL | type TyTy<#[ty_type] L> = (L, );
    |           ^^^^^^^^^^
@@ -63,7 +63,7 @@ LL | type TyTy<#[ty_type] L> = (L, );
    = help: add #![feature(custom_attribute)] to the crate attributes to enable
 
 error[E0658]: The attribute `lt_inherent` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
-  --> $DIR/feature-gate-custom_attribute2.rs:43:6
+  --> $DIR/feature-gate-custom_attribute2.rs:36:6
    |
 LL | impl<#[lt_inherent] 'e> StLt<'e> { }
    |      ^^^^^^^^^^^^^^
@@ -71,7 +71,7 @@ LL | impl<#[lt_inherent] 'e> StLt<'e> { }
    = help: add #![feature(custom_attribute)] to the crate attributes to enable
 
 error[E0658]: The attribute `ty_inherent` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
-  --> $DIR/feature-gate-custom_attribute2.rs:45:6
+  --> $DIR/feature-gate-custom_attribute2.rs:38:6
    |
 LL | impl<#[ty_inherent] M> StTy<M> { }
    |      ^^^^^^^^^^^^^^
@@ -79,7 +79,7 @@ LL | impl<#[ty_inherent] M> StTy<M> { }
    = help: add #![feature(custom_attribute)] to the crate attributes to enable
 
 error[E0658]: The attribute `lt_impl_for` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
-  --> $DIR/feature-gate-custom_attribute2.rs:48:6
+  --> $DIR/feature-gate-custom_attribute2.rs:41:6
    |
 LL | impl<#[lt_impl_for] 'f> TrLt<'f> for StLt<'f> {
    |      ^^^^^^^^^^^^^^
@@ -87,7 +87,7 @@ LL | impl<#[lt_impl_for] 'f> TrLt<'f> for StLt<'f> {
    = help: add #![feature(custom_attribute)] to the crate attributes to enable
 
 error[E0658]: The attribute `ty_impl_for` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
-  --> $DIR/feature-gate-custom_attribute2.rs:52:6
+  --> $DIR/feature-gate-custom_attribute2.rs:45:6
    |
 LL | impl<#[ty_impl_for] N> TrTy<N> for StTy<N> {
    |      ^^^^^^^^^^^^^^
@@ -95,7 +95,7 @@ LL | impl<#[ty_impl_for] N> TrTy<N> for StTy<N> {
    = help: add #![feature(custom_attribute)] to the crate attributes to enable
 
 error[E0658]: The attribute `lt_fn` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
-  --> $DIR/feature-gate-custom_attribute2.rs:57:9
+  --> $DIR/feature-gate-custom_attribute2.rs:50:9
    |
 LL | fn f_lt<#[lt_fn] 'g>(_: &'g [u32]) -> &'g u32 { loop { } }
    |         ^^^^^^^^
@@ -103,7 +103,7 @@ LL | fn f_lt<#[lt_fn] 'g>(_: &'g [u32]) -> &'g u32 { loop { } }
    = help: add #![feature(custom_attribute)] to the crate attributes to enable
 
 error[E0658]: The attribute `ty_fn` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
-  --> $DIR/feature-gate-custom_attribute2.rs:59:9
+  --> $DIR/feature-gate-custom_attribute2.rs:52:9
    |
 LL | fn f_ty<#[ty_fn] O>(_: O) { }
    |         ^^^^^^^^
@@ -111,7 +111,7 @@ LL | fn f_ty<#[ty_fn] O>(_: O) { }
    = help: add #![feature(custom_attribute)] to the crate attributes to enable
 
 error[E0658]: The attribute `lt_meth` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
-  --> $DIR/feature-gate-custom_attribute2.rs:63:13
+  --> $DIR/feature-gate-custom_attribute2.rs:56:13
    |
 LL |     fn m_lt<#[lt_meth] 'h>(_: &'h [u32]) -> &'h u32 { loop { } }
    |             ^^^^^^^^^^
@@ -119,7 +119,7 @@ LL |     fn m_lt<#[lt_meth] 'h>(_: &'h [u32]) -> &'h u32 { loop { } }
    = help: add #![feature(custom_attribute)] to the crate attributes to enable
 
 error[E0658]: The attribute `ty_meth` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
-  --> $DIR/feature-gate-custom_attribute2.rs:65:13
+  --> $DIR/feature-gate-custom_attribute2.rs:58:13
    |
 LL |     fn m_ty<#[ty_meth] P>(_: P) { }
    |             ^^^^^^^^^^
@@ -127,7 +127,7 @@ LL |     fn m_ty<#[ty_meth] P>(_: P) { }
    = help: add #![feature(custom_attribute)] to the crate attributes to enable
 
 error[E0658]: The attribute `lt_hof` is currently unknown to the compiler and may have meaning added to it in the future (see issue #29642)
-  --> $DIR/feature-gate-custom_attribute2.rs:70:19
+  --> $DIR/feature-gate-custom_attribute2.rs:63:19
    |
 LL |     where Q: for <#[lt_hof] 'i> Fn(&'i [u32]) -> &'i u32
    |                   ^^^^^^^^^
diff --git a/src/test/ui/feature-gate-generic_param_attrs.stderr b/src/test/ui/feature-gate-generic_param_attrs.stderr
deleted file mode 100644
index 7b449242c32..00000000000
--- a/src/test/ui/feature-gate-generic_param_attrs.stderr
+++ /dev/null
@@ -1,139 +0,0 @@
-error[E0658]: attributes on lifetime bindings are experimental (see issue #34761)
-  --> $DIR/feature-gate-generic_param_attrs.rs:22:13
-   |
-LL | struct StLt<#[rustc_lt_struct] 'a>(&'a u32);
-   |             ^^^^^^^^^^^^^^^^^^
-   |
-   = help: add #![feature(generic_param_attrs)] to the crate attributes to enable
-
-error[E0658]: attributes on type parameter bindings are experimental (see issue #34761)
-  --> $DIR/feature-gate-generic_param_attrs.rs:24:13
-   |
-LL | struct StTy<#[rustc_ty_struct] I>(I);
-   |             ^^^^^^^^^^^^^^^^^^
-   |
-   = help: add #![feature(generic_param_attrs)] to the crate attributes to enable
-
-error[E0658]: attributes on lifetime bindings are experimental (see issue #34761)
-  --> $DIR/feature-gate-generic_param_attrs.rs:27:11
-   |
-LL | enum EnLt<#[rustc_lt_enum] 'b> { A(&'b u32), B }
-   |           ^^^^^^^^^^^^^^^^
-   |
-   = help: add #![feature(generic_param_attrs)] to the crate attributes to enable
-
-error[E0658]: attributes on type parameter bindings are experimental (see issue #34761)
-  --> $DIR/feature-gate-generic_param_attrs.rs:29:11
-   |
-LL | enum EnTy<#[rustc_ty_enum] J> { A(J), B }
-   |           ^^^^^^^^^^^^^^^^
-   |
-   = help: add #![feature(generic_param_attrs)] to the crate attributes to enable
-
-error[E0658]: attributes on lifetime bindings are experimental (see issue #34761)
-  --> $DIR/feature-gate-generic_param_attrs.rs:32:12
-   |
-LL | trait TrLt<#[rustc_lt_trait] 'c> { fn foo(&self, _: &'c [u32]) -> &'c u32; }
-   |            ^^^^^^^^^^^^^^^^^
-   |
-   = help: add #![feature(generic_param_attrs)] to the crate attributes to enable
-
-error[E0658]: attributes on type parameter bindings are experimental (see issue #34761)
-  --> $DIR/feature-gate-generic_param_attrs.rs:34:12
-   |
-LL | trait TrTy<#[rustc_ty_trait] K> { fn foo(&self, _: K); }
-   |            ^^^^^^^^^^^^^^^^^
-   |
-   = help: add #![feature(generic_param_attrs)] to the crate attributes to enable
-
-error[E0658]: attributes on lifetime bindings are experimental (see issue #34761)
-  --> $DIR/feature-gate-generic_param_attrs.rs:37:11
-   |
-LL | type TyLt<#[rustc_lt_type] 'd> = &'d u32;
-   |           ^^^^^^^^^^^^^^^^
-   |
-   = help: add #![feature(generic_param_attrs)] to the crate attributes to enable
-
-error[E0658]: attributes on type parameter bindings are experimental (see issue #34761)
-  --> $DIR/feature-gate-generic_param_attrs.rs:39:11
-   |
-LL | type TyTy<#[rustc_ty_type] L> = (L, );
-   |           ^^^^^^^^^^^^^^^^
-   |
-   = help: add #![feature(generic_param_attrs)] to the crate attributes to enable
-
-error[E0658]: attributes on lifetime bindings are experimental (see issue #34761)
-  --> $DIR/feature-gate-generic_param_attrs.rs:42:6
-   |
-LL | impl<#[rustc_lt_inherent] 'e> StLt<'e> { }
-   |      ^^^^^^^^^^^^^^^^^^^^
-   |
-   = help: add #![feature(generic_param_attrs)] to the crate attributes to enable
-
-error[E0658]: attributes on type parameter bindings are experimental (see issue #34761)
-  --> $DIR/feature-gate-generic_param_attrs.rs:44:6
-   |
-LL | impl<#[rustc_ty_inherent] M> StTy<M> { }
-   |      ^^^^^^^^^^^^^^^^^^^^
-   |
-   = help: add #![feature(generic_param_attrs)] to the crate attributes to enable
-
-error[E0658]: attributes on lifetime bindings are experimental (see issue #34761)
-  --> $DIR/feature-gate-generic_param_attrs.rs:47:6
-   |
-LL | impl<#[rustc_lt_impl_for] 'f> TrLt<'f> for StLt<'f> {
-   |      ^^^^^^^^^^^^^^^^^^^^
-   |
-   = help: add #![feature(generic_param_attrs)] to the crate attributes to enable
-
-error[E0658]: attributes on type parameter bindings are experimental (see issue #34761)
-  --> $DIR/feature-gate-generic_param_attrs.rs:51:6
-   |
-LL | impl<#[rustc_ty_impl_for] N> TrTy<N> for StTy<N> {
-   |      ^^^^^^^^^^^^^^^^^^^^
-   |
-   = help: add #![feature(generic_param_attrs)] to the crate attributes to enable
-
-error[E0658]: attributes on lifetime bindings are experimental (see issue #34761)
-  --> $DIR/feature-gate-generic_param_attrs.rs:56:9
-   |
-LL | fn f_lt<#[rustc_lt_fn] 'g>(_: &'g [u32]) -> &'g u32 { loop { } }
-   |         ^^^^^^^^^^^^^^
-   |
-   = help: add #![feature(generic_param_attrs)] to the crate attributes to enable
-
-error[E0658]: attributes on type parameter bindings are experimental (see issue #34761)
-  --> $DIR/feature-gate-generic_param_attrs.rs:58:9
-   |
-LL | fn f_ty<#[rustc_ty_fn] O>(_: O) { }
-   |         ^^^^^^^^^^^^^^
-   |
-   = help: add #![feature(generic_param_attrs)] to the crate attributes to enable
-
-error[E0658]: attributes on lifetime bindings are experimental (see issue #34761)
-  --> $DIR/feature-gate-generic_param_attrs.rs:62:13
-   |
-LL |     fn m_lt<#[rustc_lt_meth] 'h>(_: &'h [u32]) -> &'h u32 { loop { } }
-   |             ^^^^^^^^^^^^^^^^
-   |
-   = help: add #![feature(generic_param_attrs)] to the crate attributes to enable
-
-error[E0658]: attributes on type parameter bindings are experimental (see issue #34761)
-  --> $DIR/feature-gate-generic_param_attrs.rs:64:13
-   |
-LL |     fn m_ty<#[rustc_ty_meth] P>(_: P) { }
-   |             ^^^^^^^^^^^^^^^^
-   |
-   = help: add #![feature(generic_param_attrs)] to the crate attributes to enable
-
-error[E0658]: attributes on lifetime bindings are experimental (see issue #34761)
-  --> $DIR/feature-gate-generic_param_attrs.rs:69:19
-   |
-LL |     where Q: for <#[rustc_lt_hof] 'i> Fn(&'i [u32]) -> &'i u32
-   |                   ^^^^^^^^^^^^^^^
-   |
-   = help: add #![feature(generic_param_attrs)] to the crate attributes to enable
-
-error: aborting due to 17 previous errors
-
-For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/feature-gate-may-dangle.rs b/src/test/ui/feature-gate-may-dangle.rs
index ace9fe9ab27..a67ece04488 100644
--- a/src/test/ui/feature-gate-may-dangle.rs
+++ b/src/test/ui/feature-gate-may-dangle.rs
@@ -12,8 +12,6 @@
 
 // Check that `may_dangle` is rejected if `dropck_eyepatch` feature gate is absent.
 
-#![feature(generic_param_attrs)]
-
 struct Pt<A>(A);
 impl<#[may_dangle] A> Drop for Pt<A> {
     //~^ ERROR may_dangle has unstable semantics and may be removed in the future
diff --git a/src/test/ui/feature-gate-may-dangle.stderr b/src/test/ui/feature-gate-may-dangle.stderr
index 85707f6e921..aad725dfe65 100644
--- a/src/test/ui/feature-gate-may-dangle.stderr
+++ b/src/test/ui/feature-gate-may-dangle.stderr
@@ -1,5 +1,5 @@
 error[E0658]: may_dangle has unstable semantics and may be removed in the future (see issue #34761)
-  --> $DIR/feature-gate-may-dangle.rs:18:6
+  --> $DIR/feature-gate-may-dangle.rs:16:6
    |
 LL | impl<#[may_dangle] A> Drop for Pt<A> {
    |      ^^^^^^^^^^^^^
diff --git a/src/test/ui/feature-gate-generic_param_attrs.rs b/src/test/ui/generic-param-attrs.rs
index 944802f450a..37fabcd7e1e 100644
--- a/src/test/ui/feature-gate-generic_param_attrs.rs
+++ b/src/test/ui/generic-param-attrs.rs
@@ -8,69 +8,47 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// This test ensures that attributes on formals in generic parameter
-// lists are rejected if feature(generic_param_attrs) is not enabled.
+// This test previously ensured that attributes on formals in generic parameter
+// lists are rejected without a feature gate.
 //
 // (We are prefixing all tested features with `rustc_`, to ensure that
 // the attributes themselves won't be rejected by the compiler when
 // using `rustc_attrs` feature. There is a separate compile-fail/ test
 // ensuring that the attribute feature-gating works in this context.)
 
+// must-compile-successfully
+
 #![feature(rustc_attrs)]
 #![allow(dead_code)]
 
 struct StLt<#[rustc_lt_struct] 'a>(&'a u32);
-//~^ ERROR attributes on lifetime bindings are experimental (see issue #34761)
 struct StTy<#[rustc_ty_struct] I>(I);
-//~^ ERROR attributes on type parameter bindings are experimental (see issue #34761)
-
 enum EnLt<#[rustc_lt_enum] 'b> { A(&'b u32), B }
-//~^ ERROR attributes on lifetime bindings are experimental (see issue #34761)
 enum EnTy<#[rustc_ty_enum] J> { A(J), B }
-//~^ ERROR attributes on type parameter bindings are experimental (see issue #34761)
-
 trait TrLt<#[rustc_lt_trait] 'c> { fn foo(&self, _: &'c [u32]) -> &'c u32; }
-//~^ ERROR attributes on lifetime bindings are experimental (see issue #34761)
 trait TrTy<#[rustc_ty_trait] K> { fn foo(&self, _: K); }
-//~^ ERROR attributes on type parameter bindings are experimental (see issue #34761)
-
 type TyLt<#[rustc_lt_type] 'd> = &'d u32;
-//~^ ERROR attributes on lifetime bindings are experimental (see issue #34761)
 type TyTy<#[rustc_ty_type] L> = (L, );
-//~^ ERROR attributes on type parameter bindings are experimental (see issue #34761)
 
 impl<#[rustc_lt_inherent] 'e> StLt<'e> { }
-//~^ ERROR attributes on lifetime bindings are experimental (see issue #34761)
 impl<#[rustc_ty_inherent] M> StTy<M> { }
-//~^ ERROR attributes on type parameter bindings are experimental (see issue #34761)
-
 impl<#[rustc_lt_impl_for] 'f> TrLt<'f> for StLt<'f> {
-    //~^ ERROR attributes on lifetime bindings are experimental (see issue #34761)
     fn foo(&self, _: &'f [u32]) -> &'f u32 { loop { } }
 }
 impl<#[rustc_ty_impl_for] N> TrTy<N> for StTy<N> {
-    //~^ ERROR attributes on type parameter bindings are experimental (see issue #34761)
     fn foo(&self, _: N) { }
 }
 
 fn f_lt<#[rustc_lt_fn] 'g>(_: &'g [u32]) -> &'g u32 { loop { } }
-//~^ ERROR attributes on lifetime bindings are experimental (see issue #34761)
 fn f_ty<#[rustc_ty_fn] O>(_: O) { }
-//~^ ERROR attributes on type parameter bindings are experimental (see issue #34761)
 
 impl<I> StTy<I> {
     fn m_lt<#[rustc_lt_meth] 'h>(_: &'h [u32]) -> &'h u32 { loop { } }
-    //~^ ERROR attributes on lifetime bindings are experimental (see issue #34761)
     fn m_ty<#[rustc_ty_meth] P>(_: P) { }
-    //~^ ERROR attributes on type parameter bindings are experimental (see issue #34761)
 }
 
 fn hof_lt<Q>(_: Q)
     where Q: for <#[rustc_lt_hof] 'i> Fn(&'i [u32]) -> &'i u32
-    //~^ ERROR attributes on lifetime bindings are experimental (see issue #34761)
-{
-}
+{}
 
-fn main() {
-
-}
+fn main() {}
diff --git a/src/test/ui/nll/drop-may-dangle.rs b/src/test/ui/nll/drop-may-dangle.rs
index 2780b347463..55c9f5de302 100644
--- a/src/test/ui/nll/drop-may-dangle.rs
+++ b/src/test/ui/nll/drop-may-dangle.rs
@@ -17,7 +17,6 @@
 
 #![allow(warnings)]
 #![feature(dropck_eyepatch)]
-#![feature(generic_param_attrs)]
 
 fn use_x(_: usize) -> bool { true }
 
diff --git a/src/test/ui/nll/drop-no-may-dangle.rs b/src/test/ui/nll/drop-no-may-dangle.rs
index 3d9a5456cbb..e5478e39fec 100644
--- a/src/test/ui/nll/drop-no-may-dangle.rs
+++ b/src/test/ui/nll/drop-no-may-dangle.rs
@@ -17,7 +17,6 @@
 
 #![allow(warnings)]
 #![feature(dropck_eyepatch)]
-#![feature(generic_param_attrs)]
 
 fn use_x(_: usize) -> bool { true }
 
diff --git a/src/test/ui/nll/drop-no-may-dangle.stderr b/src/test/ui/nll/drop-no-may-dangle.stderr
index 6454413901b..a35271bdcfe 100644
--- a/src/test/ui/nll/drop-no-may-dangle.stderr
+++ b/src/test/ui/nll/drop-no-may-dangle.stderr
@@ -1,5 +1,5 @@
 error[E0506]: cannot assign to `v[..]` because it is borrowed
-  --> $DIR/drop-no-may-dangle.rs:31:9
+  --> $DIR/drop-no-may-dangle.rs:30:9
    |
 LL |     let p: WrapMayNotDangle<&usize> = WrapMayNotDangle { value: &v[0] };
    |                                                                 ----- borrow of `v[..]` occurs here
@@ -11,7 +11,7 @@ LL | }
    | - borrow later used here, when `p` is dropped
 
 error[E0506]: cannot assign to `v[..]` because it is borrowed
-  --> $DIR/drop-no-may-dangle.rs:34:5
+  --> $DIR/drop-no-may-dangle.rs:33:5
    |
 LL |     let p: WrapMayNotDangle<&usize> = WrapMayNotDangle { value: &v[0] };
    |                                                                 ----- borrow of `v[..]` occurs here