]> git.lizzy.rs Git - rust.git/commitdiff
Make sure `#[rustc_doc_only_macro]` and other rustc attributes are registered
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>
Sat, 29 Jun 2019 11:06:22 +0000 (14:06 +0300)
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>
Sun, 30 Jun 2019 09:47:33 +0000 (12:47 +0300)
25 files changed:
src/libcore/lib.rs
src/librustc_resolve/macros.rs
src/libsyntax/ext/expand.rs
src/libsyntax/feature_gate.rs
src/test/run-pass-fulldeps/issue-15778-pass.rs
src/test/run-pass/attr-on-generic-formals.rs [deleted file]
src/test/ui/attributes/attrs-with-no-formal-in-generics-1.rs
src/test/ui/attributes/attrs-with-no-formal-in-generics-1.stderr
src/test/ui/attributes/attrs-with-no-formal-in-generics-2.rs
src/test/ui/attributes/attrs-with-no-formal-in-generics-2.stderr
src/test/ui/consts/min_const_fn/allow_const_fn_ptr_feature_gate.rs
src/test/ui/consts/min_const_fn/allow_const_fn_ptr_feature_gate.stderr
src/test/ui/feature-gates/feature-gate-rustc-attrs.rs
src/test/ui/feature-gates/feature-gate-rustc-attrs.stderr
src/test/ui/generic/generic-param-attrs.rs
src/test/ui/nll/ty-outlives/projection-implied-bounds.rs
src/test/ui/nll/ty-outlives/projection-implied-bounds.stderr
src/test/ui/nll/ty-outlives/ty-param-implied-bounds.rs
src/test/ui/object-lifetime/object-lifetime-default.stderr
src/test/ui/proc-macro/expand-to-unstable-2.rs
src/test/ui/proc-macro/expand-to-unstable-2.stderr
src/test/ui/reserved/reserved-attr-on-macro.rs
src/test/ui/reserved/reserved-attr-on-macro.stderr
src/test/ui/suggestions/attribute-typos.rs
src/test/ui/suggestions/attribute-typos.stderr

index 04c50329de3d01bfecccebb49d136b225a8ee3cf..1f31b65b3603b6866553dd9856c7c2a225875207 100644 (file)
@@ -74,6 +74,7 @@
 #![feature(concat_idents)]
 #![feature(const_fn)]
 #![feature(const_fn_union)]
+#![feature(custom_inner_attributes)]
 #![feature(doc_cfg)]
 #![feature(doc_spotlight)]
 #![feature(extern_types)]
index 392a46a262f5038c2b59e0dcfebf7c1f137678ef..08a105572376cae4e8e0b4030ba506722465979e 100644 (file)
@@ -323,21 +323,13 @@ fn resolve_macro_to_res(
                     let features = self.session.features_untracked();
                     if attr_kind == NonMacroAttrKind::Custom {
                         assert!(path.segments.len() == 1);
-                        let name = path.segments[0].ident.as_str();
-                        if name.starts_with("rustc_") {
-                            if !features.rustc_attrs {
-                                let msg = "unless otherwise specified, attributes with the prefix \
-                                           `rustc_` are reserved for internal compiler diagnostics";
-                                self.report_unknown_attribute(path.span, &name, msg,
-                                                              sym::rustc_attrs);
-                            }
-                        } else if !features.custom_attribute {
+                        if !features.custom_attribute {
                             let msg = format!("The attribute `{}` is currently unknown to the \
                                                compiler and may have meaning added to it in the \
                                                future", path);
                             self.report_unknown_attribute(
                                 path.span,
-                                &name,
+                                &path.segments[0].ident.as_str(),
                                 &msg,
                                 sym::custom_attribute,
                             );
index 5473f55aa33704053b03cdf982f7f108fc162a9a..3f2bae50325d5282de3c464d81075dc185c8dfa8 100644 (file)
@@ -1525,9 +1525,7 @@ fn proc_macro_hygiene = proc_macro_hygiene,
     }
 
     fn enable_custom_inner_attributes(&self) -> bool {
-        self.features.map_or(false, |features| {
-            features.custom_inner_attributes || features.custom_attribute || features.rustc_attrs
-        })
+        self.features.map_or(false, |features| features.custom_inner_attributes)
     }
 }
 
index a6e8441a915e0c1464ce6b3acd4952286ff498e8..9aea995831edb4e03dbc6aa1454feab89edebbfa 100644 (file)
@@ -1290,6 +1290,18 @@ pub fn is_builtin_attr(attr: &ast::Attribute) -> bool {
                                                     attribute is just used for rustc unit \
                                                     tests and will never be stable",
                                                     cfg_fn!(rustc_attrs))),
+    (sym::rustc_dump_env_program_clauses, Whitelisted, template!(Word), Gated(Stability::Unstable,
+                                                    sym::rustc_attrs,
+                                                    "the `#[rustc_dump_env_program_clauses]` \
+                                                    attribute is just used for rustc unit \
+                                                    tests and will never be stable",
+                                                    cfg_fn!(rustc_attrs))),
+    (sym::rustc_object_lifetime_default, Whitelisted, template!(Word), Gated(Stability::Unstable,
+                                                    sym::rustc_attrs,
+                                                    "the `#[rustc_object_lifetime_default]` \
+                                                    attribute is just used for rustc unit \
+                                                    tests and will never be stable",
+                                                    cfg_fn!(rustc_attrs))),
     (sym::rustc_test_marker, Normal, template!(Word), Gated(Stability::Unstable,
                                     sym::rustc_attrs,
                                     "the `#[rustc_test_marker]` attribute \
@@ -1351,6 +1363,26 @@ pub fn is_builtin_attr(attr: &ast::Attribute) -> bool {
                                                 "internal implementation detail",
                                                 cfg_fn!(rustc_attrs))),
 
+    (sym::rustc_allocator_nounwind, Whitelisted, template!(Word), Gated(Stability::Unstable,
+                                                sym::rustc_attrs,
+                                                "internal implementation detail",
+                                                cfg_fn!(rustc_attrs))),
+
+    (sym::rustc_doc_only_macro, Whitelisted, template!(Word), Gated(Stability::Unstable,
+                                                sym::rustc_attrs,
+                                                "internal implementation detail",
+                                                cfg_fn!(rustc_attrs))),
+
+    (sym::rustc_promotable, Whitelisted, template!(Word), Gated(Stability::Unstable,
+                                                sym::rustc_attrs,
+                                                "internal implementation detail",
+                                                cfg_fn!(rustc_attrs))),
+
+    (sym::rustc_allow_const_fn_ptr, Whitelisted, template!(Word), Gated(Stability::Unstable,
+                                                sym::rustc_attrs,
+                                                "internal implementation detail",
+                                                cfg_fn!(rustc_attrs))),
+
     (sym::rustc_dummy, Normal, template!(Word /* doesn't matter*/), Gated(Stability::Unstable,
                                          sym::rustc_attrs,
                                          "used by the test suite",
@@ -1647,19 +1679,13 @@ fn check_attribute(
                 return;
             }
         }
-        if !attr::is_known(attr) {
-            if attr.name_or_empty().as_str().starts_with("rustc_") {
-                let msg = "unless otherwise specified, attributes with the prefix `rustc_` \
-                           are reserved for internal compiler diagnostics";
-                gate_feature!(self, rustc_attrs, attr.span, msg);
-            } else if !is_macro {
-                // Only run the custom attribute lint during regular feature gate
-                // checking. Macro gating runs before the plugin attributes are
-                // registered, so we skip this in that case.
-                let msg = format!("The attribute `{}` is currently unknown to the compiler and \
-                                   may have meaning added to it in the future", attr.path);
-                gate_feature!(self, custom_attribute, attr.span, &msg);
-            }
+        if !is_macro && !attr::is_known(attr) {
+            // Only run the custom attribute lint during regular feature gate
+            // checking. Macro gating runs before the plugin attributes are
+            // registered, so we skip this in that case.
+            let msg = format!("The attribute `{}` is currently unknown to the compiler and \
+                                may have meaning added to it in the future", attr.path);
+            gate_feature!(self, custom_attribute, attr.span, &msg);
         }
     }
 }
index 2add3ccbe36f2f05a7160320b78297d5dccfeac2..23c1c0766770b1a1c5432beb91bfeeda5ad49e5a 100644 (file)
@@ -2,7 +2,8 @@
 // ignore-stage1
 // compile-flags: -D crate-not-okay
 
-#![feature(plugin, rustc_attrs)]
+#![feature(plugin, custom_attribute, custom_inner_attributes)]
+
 #![plugin(lint_for_crate)]
 #![rustc_crate_okay]
 #![rustc_crate_blue]
@@ -10,4 +11,4 @@
 #![rustc_crate_grey]
 #![rustc_crate_green]
 
-pub fn main() { }
+fn main() {}
diff --git a/src/test/run-pass/attr-on-generic-formals.rs b/src/test/run-pass/attr-on-generic-formals.rs
deleted file mode 100644 (file)
index 9ebf0fc..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-#![allow(unused_attributes)]
-
-// This test ensures we can attach attributes to the formals in all
-// places where generic parameter lists occur, assuming appropriate
-// feature gates are enabled.
-//
-// (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.)
-
-#![feature(rustc_attrs)]
-#![allow(dead_code)]
-
-struct StLt<#[rustc_lt_struct] 'a>(&'a u32);
-struct StTy<#[rustc_ty_struct] I>(I);
-
-enum EnLt<#[rustc_lt_enum] 'b> { A(&'b u32), B }
-enum EnTy<#[rustc_ty_enum] J> { A(J), B }
-
-trait TrLt<#[rustc_lt_trait] 'c> { fn foo(&self, _: &'c [u32]) -> &'c u32; }
-trait TrTy<#[rustc_ty_trait] K> { fn foo(&self, _: K); }
-
-type TyLt<#[rustc_lt_type] 'd> = &'d u32;
-type TyTy<#[rustc_ty_type] L> = (L, );
-
-impl<#[rustc_lt_inherent] 'e> StLt<'e> { }
-impl<#[rustc_ty_inherent] M> StTy<M> { }
-
-impl<#[rustc_lt_impl_for] 'f> TrLt<'f> for StLt<'f> {
-    fn foo(&self, _: &'f [u32]) -> &'f u32 { loop { } }
-}
-impl<#[rustc_ty_impl_for] N> TrTy<N> for StTy<N> {
-    fn foo(&self, _: N) { }
-}
-
-fn f_lt<#[rustc_lt_fn] 'g>(_: &'g [u32]) -> &'g u32 { loop { } }
-fn f_ty<#[rustc_ty_fn] O>(_: O) { }
-
-impl<I> StTy<I> {
-    fn m_lt<#[rustc_lt_meth] 'h>(_: &'h [u32]) -> &'h u32 { loop { } }
-    fn m_ty<#[rustc_ty_meth] P>(_: P) { }
-}
-
-fn hof_lt<Q>(_: Q)
-    where Q: for <#[rustc_lt_hof] 'i> Fn(&'i [u32]) -> &'i u32
-{
-}
-
-fn main() {
-
-}
index ca5fdd9da859bae78bde7f472c409a9b310ec95e..df9c8d894652b5b280d5df09b5568c270f05a273 100644 (file)
@@ -6,10 +6,8 @@
 
 struct RefIntPair<'a, 'b>(&'a u32, &'b u32);
 
-impl<#[rustc_1] 'a, 'b, #[oops]> RefIntPair<'a, 'b> {
+impl<#[rustc_dummy] 'a, 'b, #[oops]> RefIntPair<'a, 'b> {
     //~^ ERROR trailing attribute after generic parameter
 }
 
-fn main() {
-
-}
+fn main() {}
index 55e7a9877846f271a79ac78561a15a13a9823d9c..5b4f5222a2b1404129d01d03eb521ad4221fdc41 100644 (file)
@@ -1,8 +1,8 @@
 error: trailing attribute after generic parameter
-  --> $DIR/attrs-with-no-formal-in-generics-1.rs:9:25
+  --> $DIR/attrs-with-no-formal-in-generics-1.rs:9:29
    |
-LL | impl<#[rustc_1] 'a, 'b, #[oops]> RefIntPair<'a, 'b> {
-   |                         ^^^^^^^ attributes must go before parameters
+LL | impl<#[rustc_dummy] 'a, 'b, #[oops]> RefIntPair<'a, 'b> {
+   |                             ^^^^^^^ attributes must go before parameters
 
 error: aborting due to previous error
 
index c795612acf08c13a59b92d967a4d332905182ec9..d1d044035260bf3fdadc7b641a42fc474f29910f 100644 (file)
@@ -6,7 +6,7 @@
 
 struct RefAny<'a, T>(&'a T);
 
-impl<#[rustc_1] 'a, #[rustc_2] T, #[oops]> RefAny<'a, T> {}
+impl<#[rustc_dummy] 'a, #[rustc_dummy] T, #[oops]> RefAny<'a, T> {}
 //~^ ERROR trailing attribute after generic parameter
 
 fn main() {}
index acd0ae3678a7c275d10f09d059b3cc1b30eeb670..fce3ff7de78e88ec4a18e8fb712d2a7c45ca9fe4 100644 (file)
@@ -1,8 +1,8 @@
 error: trailing attribute after generic parameter
-  --> $DIR/attrs-with-no-formal-in-generics-2.rs:9:35
+  --> $DIR/attrs-with-no-formal-in-generics-2.rs:9:43
    |
-LL | impl<#[rustc_1] 'a, #[rustc_2] T, #[oops]> RefAny<'a, T> {}
-   |                                   ^^^^^^^ attributes must go before parameters
+LL | impl<#[rustc_dummy] 'a, #[rustc_dummy] T, #[oops]> RefAny<'a, T> {}
+   |                                           ^^^^^^^ attributes must go before parameters
 
 error: aborting due to previous error
 
index 0395795ef7bfe03e84f18e75f38dd384ae88c24d..0f9d37292958aa703dabcafad748323c8fe95a83 100644 (file)
@@ -5,7 +5,7 @@ const fn error(_: fn()) {}
 
 #[stable(feature = "rust1", since = "1.0.0")]
 #[rustc_allow_const_fn_ptr]
-//~^ ERROR unless otherwise specified, attributes with the prefix `rustc_` are reserved
+//~^ ERROR internal implementation detail
 const fn compiles(_: fn()) {}
 
 fn main() {}
index c934307e918b931a1a779ac8eb1f42f00ddf4e87..d2ca0c8bc381b5a66e1edda7518cbe726e6fa965 100644 (file)
@@ -1,8 +1,8 @@
-error[E0658]: unless otherwise specified, attributes with the prefix `rustc_` are reserved for internal compiler diagnostics
-  --> $DIR/allow_const_fn_ptr_feature_gate.rs:7:3
+error[E0658]: internal implementation detail
+  --> $DIR/allow_const_fn_ptr_feature_gate.rs:7:1
    |
 LL | #[rustc_allow_const_fn_ptr]
-   |   ^^^^^^^^^^^^^^^^^^^^^^^^
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: for more information, see https://github.com/rust-lang/rust/issues/29642
    = help: add #![feature(rustc_attrs)] to the crate attributes to enable
index 5ec413cc71de0b26cab7e75dece06d26e3a7a8ec..95ff18213f7978c0ddef6cf49b047e7f1448be36 100644 (file)
@@ -1,6 +1,6 @@
 // Test that `#[rustc_*]` attributes are gated by `rustc_attrs` feature gate.
 
-#[rustc_foo]
-//~^ ERROR unless otherwise specified, attributes with the prefix `rustc_` are reserved
+#[rustc_dummy]
+//~^ ERROR used by the test suite
 
 fn main() {}
index 3c823c8d4e25f4e6fd1e05bba620c1fce490be26..57dcc77e518f39f27d039886371d70886ce0c403 100644 (file)
@@ -1,8 +1,8 @@
-error[E0658]: unless otherwise specified, attributes with the prefix `rustc_` are reserved for internal compiler diagnostics
-  --> $DIR/feature-gate-rustc-attrs.rs:3:3
+error[E0658]: used by the test suite
+  --> $DIR/feature-gate-rustc-attrs.rs:3:1
    |
-LL | #[rustc_foo]
-   |   ^^^^^^^^^
+LL | #[rustc_dummy]
+   | ^^^^^^^^^^^^^^
    |
    = note: for more information, see https://github.com/rust-lang/rust/issues/29642
    = help: add #![feature(rustc_attrs)] to the crate attributes to enable
index 601d2a9e0a31f49835815de5b5c8d3ae1d0869c1..6c628914f1f8d3965a30a50eed83d028a5bc2e45 100644 (file)
@@ -1,44 +1,38 @@
 // 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.)
 
 // compile-pass
 
 #![feature(rustc_attrs)]
-#![allow(dead_code)]
-
-struct StLt<#[rustc_lt_struct] 'a>(&'a u32);
-struct StTy<#[rustc_ty_struct] I>(I);
-enum EnLt<#[rustc_lt_enum] 'b> { A(&'b u32), B }
-enum EnTy<#[rustc_ty_enum] J> { A(J), B }
-trait TrLt<#[rustc_lt_trait] 'c> { fn foo(&self, _: &'c [u32]) -> &'c u32; }
-trait TrTy<#[rustc_ty_trait] K> { fn foo(&self, _: K); }
-type TyLt<#[rustc_lt_type] 'd> = &'d u32;
-type TyTy<#[rustc_ty_type] L> = (L, );
-
-impl<#[rustc_lt_inherent] 'e> StLt<'e> { }
-impl<#[rustc_ty_inherent] M> StTy<M> { }
-impl<#[rustc_lt_impl_for] 'f> TrLt<'f> for StLt<'f> {
+
+struct StLt<#[rustc_dummy] 'a>(&'a u32);
+struct StTy<#[rustc_dummy] I>(I);
+enum EnLt<#[rustc_dummy] 'b> { A(&'b u32), B }
+enum EnTy<#[rustc_dummy] J> { A(J), B }
+trait TrLt<#[rustc_dummy] 'c> { fn foo(&self, _: &'c [u32]) -> &'c u32; }
+trait TrTy<#[rustc_dummy] K> { fn foo(&self, _: K); }
+type TyLt<#[rustc_dummy] 'd> = &'d u32;
+type TyTy<#[rustc_dummy] L> = (L, );
+
+impl<#[rustc_dummy] 'e> StLt<'e> { }
+impl<#[rustc_dummy] M> StTy<M> { }
+impl<#[rustc_dummy] 'f> TrLt<'f> for StLt<'f> {
     fn foo(&self, _: &'f [u32]) -> &'f u32 { loop { } }
 }
-impl<#[rustc_ty_impl_for] N> TrTy<N> for StTy<N> {
+impl<#[rustc_dummy] N> TrTy<N> for StTy<N> {
     fn foo(&self, _: N) { }
 }
 
-fn f_lt<#[rustc_lt_fn] 'g>(_: &'g [u32]) -> &'g u32 { loop { } }
-fn f_ty<#[rustc_ty_fn] O>(_: O) { }
+fn f_lt<#[rustc_dummy] 'g>(_: &'g [u32]) -> &'g u32 { loop { } }
+fn f_ty<#[rustc_dummy] O>(_: O) { }
 
 impl<I> StTy<I> {
-    fn m_lt<#[rustc_lt_meth] 'h>(_: &'h [u32]) -> &'h u32 { loop { } }
-    fn m_ty<#[rustc_ty_meth] P>(_: P) { }
+    fn m_lt<#[rustc_dummy] 'h>(_: &'h [u32]) -> &'h u32 { loop { } }
+    fn m_ty<#[rustc_dummy] P>(_: P) { }
 }
 
 fn hof_lt<Q>(_: Q)
-    where Q: for <#[rustc_lt_hof] 'i> Fn(&'i [u32]) -> &'i u32
+    where Q: for <#[rustc_dummy] 'i> Fn(&'i [u32]) -> &'i u32
 {}
 
 fn main() {}
index 1245ce8583e293e1fa3a88ca384b09a968022ce7..fb50dce1af616ec86387b35749d668b3e526d0eb 100644 (file)
@@ -1,10 +1,7 @@
-// compile-flags:-Zborrowck=mir -Zverbose
-
 // Test that we can deduce when projections like `T::Item` outlive the
 // function body. Test that this does not imply that `T: 'a` holds.
 
-#![allow(warnings)]
-#![feature(rustc_attrs)]
+// compile-flags:-Zborrowck=mir -Zverbose
 
 use std::cell::Cell;
 
@@ -18,7 +15,6 @@ fn twice<F, T>(mut value: T, mut f: F)
     f(&value, Cell::new(&n));
 }
 
-#[rustc_errors]
 fn generic1<T: Iterator>(value: T) {
     // No error here:
     twice(value, |value_ref, item| invoke1(item));
@@ -30,7 +26,6 @@ fn invoke1<'a, T>(x: Cell<&'a Option<T>>)
 {
 }
 
-#[rustc_errors]
 fn generic2<T: Iterator>(value: T) {
     twice(value, |value_ref, item| invoke2(value_ref, item));
     //~^ ERROR the parameter type `T` may not live long enough
index 9cdb78a10281c0e3a9e1a0f8ad529bf164dfc712..9f0c60c1e1705a34424e546f32cc55a44bdb440f 100644 (file)
@@ -1,5 +1,5 @@
 error[E0310]: the parameter type `T` may not live long enough
-  --> $DIR/projection-implied-bounds.rs:35:18
+  --> $DIR/projection-implied-bounds.rs:30:18
    |
 LL |     twice(value, |value_ref, item| invoke2(value_ref, item));
    |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
index f61f54f80a78bf02252201e588953cf483a15868..6a9ef3b5ce07fd16452124b501d339b1f10b4592 100644 (file)
@@ -4,9 +4,6 @@
 // Test that we assume that universal types like `T` outlive the
 // function body.
 
-#![allow(warnings)]
-#![feature(rustc_attrs)]
-
 use std::cell::Cell;
 
 fn twice<F, T>(value: T, mut f: F)
@@ -17,7 +14,6 @@ fn twice<F, T>(value: T, mut f: F)
     f(Cell::new(&value));
 }
 
-#[rustc_errors]
 fn generic<T>(value: T) {
     // No error here:
     twice(value, |r| invoke(r));
index 2642cdff2bf6ae412c969641b9dea02ddfa6f5be..f71c8cd0e0c398f7ebc29a3e59c16a6d2469059c 100644 (file)
@@ -1,20 +1,20 @@
-error: 'a,Ambiguous
-  --> $DIR/object-lifetime-default.rs:24:1
+error: BaseDefault
+  --> $DIR/object-lifetime-default.rs:6:1
    |
-LL | struct G<'a,'b,T:'a,U:'a+'b>(&'a T, &'b U);
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | struct A<T>(T);
+   | ^^^^^^^^^^^^^^^
 
-error: 'a,'b
-  --> $DIR/object-lifetime-default.rs:21:1
+error: BaseDefault
+  --> $DIR/object-lifetime-default.rs:9:1
    |
-LL | struct F<'a,'b,T:'a,U:'b>(&'a T, &'b U);
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | struct B<'a,T>(&'a (), T);
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: 'b
-  --> $DIR/object-lifetime-default.rs:18:1
+error: 'a
+  --> $DIR/object-lifetime-default.rs:12:1
    |
-LL | struct E<'a,'b:'a,T:'b>(&'a T, &'b T);
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | struct C<'a,T:'a>(&'a T);
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: Ambiguous
   --> $DIR/object-lifetime-default.rs:15:1
@@ -22,23 +22,23 @@ error: Ambiguous
 LL | struct D<'a,'b,T:'a+'b>(&'a T, &'b T);
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: 'a
-  --> $DIR/object-lifetime-default.rs:12:1
+error: 'b
+  --> $DIR/object-lifetime-default.rs:18:1
    |
-LL | struct C<'a,T:'a>(&'a T);
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | struct E<'a,'b:'a,T:'b>(&'a T, &'b T);
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: BaseDefault
-  --> $DIR/object-lifetime-default.rs:9:1
+error: 'a,'b
+  --> $DIR/object-lifetime-default.rs:21:1
    |
-LL | struct B<'a,T>(&'a (), T);
-   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+LL | struct F<'a,'b,T:'a,U:'b>(&'a T, &'b U);
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-error: BaseDefault
-  --> $DIR/object-lifetime-default.rs:6:1
+error: 'a,Ambiguous
+  --> $DIR/object-lifetime-default.rs:24:1
    |
-LL | struct A<T>(T);
-   | ^^^^^^^^^^^^^^^
+LL | struct G<'a,'b,T:'a,U:'a+'b>(&'a T, &'b U);
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 error: aborting due to 7 previous errors
 
index 4b4ba52ecd7267f8d17dad398eda877a372e86c5..8ce3cde6f043287b09f8526133ef352e746481f2 100644 (file)
@@ -1,12 +1,10 @@
 // aux-build:derive-unstable-2.rs
 
-#![allow(warnings)]
-
 #[macro_use]
 extern crate derive_unstable_2;
 
 #[derive(Unstable)]
-//~^ ERROR: reserved for internal compiler
+//~^ ERROR attribute `rustc_foo` is currently unknown
 struct A;
 
 fn main() {
index e2f51dd3d5dd2383d1370391346591044321e75e..77be3d52723940f1d312ebacb4196a9f99061ead 100644 (file)
@@ -1,11 +1,11 @@
-error[E0658]: unless otherwise specified, attributes with the prefix `rustc_` are reserved for internal compiler diagnostics
-  --> $DIR/expand-to-unstable-2.rs:8:10
+error[E0658]: The attribute `rustc_foo` is currently unknown to the compiler and may have meaning added to it in the future
+  --> $DIR/expand-to-unstable-2.rs:6:10
    |
 LL | #[derive(Unstable)]
    |          ^^^^^^^^
    |
    = note: for more information, see https://github.com/rust-lang/rust/issues/29642
-   = help: add #![feature(rustc_attrs)] to the crate attributes to enable
+   = help: add #![feature(custom_attribute)] to the crate attributes to enable
 
 error: aborting due to previous error
 
index 96c63ba4db8c9dfb0879a0a8023c340f3e34a7a9..0ee6577f8a11d8a5a87af8b72f0a4f0842f5ce57 100644 (file)
@@ -1,5 +1,5 @@
 #[rustc_attribute_should_be_reserved]
-//~^ ERROR unless otherwise specified, attributes with the prefix `rustc_` are reserved
+//~^ ERROR attribute `rustc_attribute_should_be_reserved` is currently unknown
 macro_rules! foo {
     () => (());
 }
index c8738d1ed3429a15b9b03778dbf18df89b5dd9e2..34b21ecd1265d201767b3da9e71aa18b3be6d507 100644 (file)
@@ -1,11 +1,11 @@
-error[E0658]: unless otherwise specified, attributes with the prefix `rustc_` are reserved for internal compiler diagnostics
+error[E0658]: The attribute `rustc_attribute_should_be_reserved` is currently unknown to the compiler and may have meaning added to it in the future
   --> $DIR/reserved-attr-on-macro.rs:1:3
    |
 LL | #[rustc_attribute_should_be_reserved]
    |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: for more information, see https://github.com/rust-lang/rust/issues/29642
-   = help: add #![feature(rustc_attrs)] to the crate attributes to enable
+   = help: add #![feature(custom_attribute)] to the crate attributes to enable
 
 error: cannot determine resolution for the macro `foo`
   --> $DIR/reserved-attr-on-macro.rs:8:5
index 13c6308b97e85d4e2e021f965a9c4eabd5064086..b45acbdd9206c4a82813f65eca4a6cc9aafbf2b0 100644 (file)
@@ -1,13 +1,8 @@
-#[deprcated]    //~ ERROR E0658
-fn foo() {}     //~| HELP a built-in attribute with a similar name exists
-                //~| SUGGESTION deprecated
-                //~| HELP add #![feature(custom_attribute)] to the crate attributes to enable
+#[deprcated] //~ ERROR attribute `deprcated` is currently unknown
+fn foo() {}
 
-#[tests]        //~ ERROR E0658
-fn bar() {}     //~| HELP a built-in attribute with a similar name exists
-                //~| SUGGESTION test
-                //~| HELP add #![feature(custom_attribute)] to the crate attributes to enable
+#[tests] //~ ERROR attribute `tests` is currently unknown to the compiler
+fn bar() {}
 
-#[rustc_err]    //~ ERROR E0658
-fn main() {}    //~| HELP add #![feature(rustc_attrs)] to the crate attributes to enable
-                // don't suggest rustc attributes
+#[rustc_err] //~ ERROR attribute `rustc_err` is currently unknown
+fn main() {}
index 8367ff20aa408bd3a6518ab6d2be8aad66834b68..ee063aaa122201a3883bde60671152200740156e 100644 (file)
@@ -1,14 +1,14 @@
-error[E0658]: unless otherwise specified, attributes with the prefix `rustc_` are reserved for internal compiler diagnostics
-  --> $DIR/attribute-typos.rs:11:3
+error[E0658]: The attribute `rustc_err` is currently unknown to the compiler and may have meaning added to it in the future
+  --> $DIR/attribute-typos.rs:7:3
    |
 LL | #[rustc_err]
    |   ^^^^^^^^^
    |
    = note: for more information, see https://github.com/rust-lang/rust/issues/29642
-   = help: add #![feature(rustc_attrs)] to the crate attributes to enable
+   = help: add #![feature(custom_attribute)] to the crate attributes to enable
 
 error[E0658]: The attribute `tests` is currently unknown to the compiler and may have meaning added to it in the future
-  --> $DIR/attribute-typos.rs:6:3
+  --> $DIR/attribute-typos.rs:4:3
    |
 LL | #[tests]
    |   ^^^^^ help: a built-in attribute with a similar name exists: `test`