about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-06-09 00:20:35 +0200
committerGitHub <noreply@github.com>2019-06-09 00:20:35 +0200
commit21b5c1d51e9fcf26eca5a1ccc8dfaee5240f7522 (patch)
treeb6a64d9a639c695e131be663ff9ca613e1da8fdf
parent2410b4de7c425b1160a4368bc944d081d6e48a70 (diff)
parentee189ae028ce4ff620630686432f44b0ea706181 (diff)
Rollup merge of #61660 - petrochenkov:nocusta, r=Centril
Minimize use of `#![feature(custom_attribute)]`

Some preparations before resurrecting https://github.com/rust-lang/rust/pull/57921.
-rw-r--r--src/doc/rustc/src/lints/listing/warn-by-default.md10
-rw-r--r--src/liballoc/alloc.rs3
-rw-r--r--src/liballoc/lib.rs2
-rw-r--r--src/libcore/lib.rs1
-rw-r--r--src/librustc/hir/mod.rs2
-rw-r--r--src/librustc_codegen_llvm/lib.rs1
-rw-r--r--src/librustc_codegen_ssa/lib.rs1
-rw-r--r--src/librustc_codegen_utils/lib.rs1
-rw-r--r--src/librustc_errors/lib.rs1
-rw-r--r--src/librustc_save_analysis/lib.rs1
-rw-r--r--src/librustc_typeck/collect.rs2
-rw-r--r--src/libsyntax/feature_gate.rs20
-rw-r--r--src/libsyntax_pos/lib.rs1
-rw-r--r--src/libsyntax_pos/symbol.rs2
-rw-r--r--src/libterm/lib.rs3
-rw-r--r--src/test/codegen/function-arguments.rs4
-rw-r--r--src/test/pretty/attr-fn-inner.rs11
-rw-r--r--src/test/pretty/attr-literals.rs11
-rw-r--r--src/test/pretty/stmt_expr_attributes.rs279
-rw-r--r--src/test/run-pass/attr-before-view-item.rs11
-rw-r--r--src/test/run-pass/attr-before-view-item2.rs13
-rw-r--r--src/test/run-pass/attr-mix-new.rs14
-rw-r--r--src/test/run-pass/auxiliary/allocator-dummy.rs59
-rw-r--r--src/test/run-pass/check-static-recursion-foreign.rs2
-rw-r--r--src/test/run-pass/macros/macro-attributes.rs1
-rw-r--r--src/test/run-pass/methods/method-attributes.rs31
-rw-r--r--src/test/run-pass/structs-enums/class-attributes-1.rs21
-rw-r--r--src/test/run-pass/structs-enums/class-attributes-2.rs33
-rw-r--r--src/test/ui/attr-eq-token-tree.rs2
-rw-r--r--src/test/ui/attr-eq-token-tree.stderr2
-rw-r--r--src/test/ui/attributes/attr-before-view-item.rs10
-rw-r--r--src/test/ui/attributes/attr-before-view-item2.rs12
-rw-r--r--src/test/ui/attributes/attr-mix-new.rs11
-rw-r--r--src/test/ui/attributes/attrs-with-no-formal-in-generics-1.rs (renamed from src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-1.rs)0
-rw-r--r--src/test/ui/attributes/attrs-with-no-formal-in-generics-1.stderr (renamed from src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-1.stderr)0
-rw-r--r--src/test/ui/attributes/attrs-with-no-formal-in-generics-2.rs (renamed from src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-2.rs)0
-rw-r--r--src/test/ui/attributes/attrs-with-no-formal-in-generics-2.stderr (renamed from src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-2.stderr)0
-rw-r--r--src/test/ui/attributes/attrs-with-no-formal-in-generics-3.rs (renamed from src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-3.rs)0
-rw-r--r--src/test/ui/attributes/attrs-with-no-formal-in-generics-3.stderr (renamed from src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-3.stderr)0
-rw-r--r--src/test/ui/attributes/class-attributes-1.rs19
-rw-r--r--src/test/ui/attributes/class-attributes-2.rs31
-rw-r--r--src/test/ui/attributes/item-attributes.rs (renamed from src/test/run-pass/item-attributes.rs)117
-rw-r--r--src/test/ui/attributes/method-attributes.rs28
-rw-r--r--src/test/ui/attributes/obsolete-attr.rs7
-rw-r--r--src/test/ui/attributes/obsolete-attr.stderr21
-rw-r--r--src/test/ui/attributes/unknown-attr.rs9
-rw-r--r--src/test/ui/attributes/unknown-attr.stderr30
-rw-r--r--src/test/ui/attributes/variant-attributes.rs (renamed from src/test/run-pass/variant-attributes.rs)23
-rw-r--r--src/test/ui/custom-attribute-multisegment.rs2
-rw-r--r--src/test/ui/custom-attribute-multisegment.stderr2
-rw-r--r--src/test/ui/expanded-cfg.rs2
-rw-r--r--src/test/ui/issues/issue-24434.rs5
-rw-r--r--src/test/ui/lint/lint-obsolete-attr.rs12
-rw-r--r--src/test/ui/lint/lint-obsolete-attr.stderr20
-rw-r--r--src/test/ui/lint/lint-unknown-attr.rs11
-rw-r--r--src/test/ui/lint/lint-unknown-attr.stderr26
-rw-r--r--src/test/ui/macros/macro-inner-attributes.rs4
-rw-r--r--src/test/ui/macros/macro-outer-attributes.rs4
-rw-r--r--src/test/ui/malformed/malformed-interpolated.rs6
-rw-r--r--src/test/ui/malformed/malformed-interpolated.stderr12
-rw-r--r--src/test/ui/proc-macro/resolve-error.rs8
-rw-r--r--src/test/ui/proc-macro/resolve-error.stderr23
-rw-r--r--src/test/ui/stmt_expr_attrs_no_feature.rs61
-rw-r--r--src/test/ui/stmt_expr_attrs_no_feature.stderr54
-rw-r--r--src/test/ui/suffixed-literal-meta.rs28
-rw-r--r--src/test/ui/suffixed-literal-meta.stderr72
-rw-r--r--src/test/ui/tool-attributes/tool-attributes-misplaced-1.rs5
-rw-r--r--src/test/ui/tool-attributes/tool-attributes-misplaced-1.stderr26
-rw-r--r--src/test/ui/unrestricted-attribute-tokens.rs8
-rw-r--r--src/test/ui/unused/unused-attr.rs33
-rw-r--r--src/test/ui/unused/unused-attr.stderr90
71 files changed, 656 insertions, 721 deletions
diff --git a/src/doc/rustc/src/lints/listing/warn-by-default.md b/src/doc/rustc/src/lints/listing/warn-by-default.md
index f090f142c08..6d4aa024c75 100644
--- a/src/doc/rustc/src/lints/listing/warn-by-default.md
+++ b/src/doc/rustc/src/lints/listing/warn-by-default.md
@@ -728,19 +728,17 @@ This lint detects attributes that were not used by the compiler. Some
 example code that triggers this lint:
 
 ```rust
-#![feature(custom_attribute)]
-
-#![mutable_doc]
+#![macro_export]
 ```
 
 This will produce:
 
 ```text
 warning: unused attribute
- --> src/main.rs:4:1
+ --> src/main.rs:1:1
   |
-4 | #![mutable_doc]
-  | ^^^^^^^^^^^^^^^
+1 | #![macro_export]
+  | ^^^^^^^^^^^^^^^^
   |
 ```
 
diff --git a/src/liballoc/alloc.rs b/src/liballoc/alloc.rs
index 41ff06d70ff..755feb84962 100644
--- a/src/liballoc/alloc.rs
+++ b/src/liballoc/alloc.rs
@@ -15,7 +15,8 @@ extern "Rust" {
     // them from the `#[global_allocator]` attribute if there is one, or uses the
     // default implementations in libstd (`__rdl_alloc` etc in `src/libstd/alloc.rs`)
     // otherwise.
-    #[allocator]
+    #[cfg_attr(bootstrap, allocator)]
+    #[cfg_attr(not(bootstrap), rustc_allocator)]
     #[rustc_allocator_nounwind]
     fn __rust_alloc(size: usize, align: usize) -> *mut u8;
     #[rustc_allocator_nounwind]
diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs
index bfc008e14a4..c530ac24275 100644
--- a/src/liballoc/lib.rs
+++ b/src/liballoc/lib.rs
@@ -79,7 +79,7 @@
 #![feature(coerce_unsized)]
 #![feature(dispatch_from_dyn)]
 #![feature(core_intrinsics)]
-#![feature(custom_attribute)]
+#![cfg_attr(bootstrap, feature(custom_attribute))]
 #![feature(dropck_eyepatch)]
 #![feature(exact_size_is_empty)]
 #![feature(fmt_internals)]
diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs
index af24cbe1c5c..030f4f1d12c 100644
--- a/src/libcore/lib.rs
+++ b/src/libcore/lib.rs
@@ -75,7 +75,6 @@
 #![feature(concat_idents)]
 #![feature(const_fn)]
 #![feature(const_fn_union)]
-#![feature(custom_attribute)]
 #![feature(doc_cfg)]
 #![feature(doc_spotlight)]
 #![feature(extern_types)]
diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs
index 2aaf5ec775d..27ee664aa5f 100644
--- a/src/librustc/hir/mod.rs
+++ b/src/librustc/hir/mod.rs
@@ -2574,7 +2574,7 @@ bitflags! {
         /// `#[cold]`: a hint to LLVM that this function, when called, is never on
         /// the hot path.
         const COLD                      = 1 << 0;
-        /// `#[allocator]`: a hint to LLVM that the pointer returned from this
+        /// `#[rustc_allocator]`: a hint to LLVM that the pointer returned from this
         /// function is never null.
         const ALLOCATOR                 = 1 << 1;
         /// `#[unwind]`: an indicator that this function may unwind despite what
diff --git a/src/librustc_codegen_llvm/lib.rs b/src/librustc_codegen_llvm/lib.rs
index 0fdd326a188..8391f02fc69 100644
--- a/src/librustc_codegen_llvm/lib.rs
+++ b/src/librustc_codegen_llvm/lib.rs
@@ -10,7 +10,6 @@
 #![feature(box_syntax)]
 #![feature(const_cstr_unchecked)]
 #![feature(crate_visibility_modifier)]
-#![feature(custom_attribute)]
 #![feature(extern_types)]
 #![feature(in_band_lifetimes)]
 #![allow(unused_attributes)]
diff --git a/src/librustc_codegen_ssa/lib.rs b/src/librustc_codegen_ssa/lib.rs
index 4d7af7a643b..97de0d823b3 100644
--- a/src/librustc_codegen_ssa/lib.rs
+++ b/src/librustc_codegen_ssa/lib.rs
@@ -3,7 +3,6 @@
 #![feature(box_patterns)]
 #![feature(box_syntax)]
 #![feature(core_intrinsics)]
-#![feature(custom_attribute)]
 #![feature(libc)]
 #![feature(rustc_diagnostic_macros)]
 #![feature(stmt_expr_attributes)]
diff --git a/src/librustc_codegen_utils/lib.rs b/src/librustc_codegen_utils/lib.rs
index ea1d0835452..38d1719e776 100644
--- a/src/librustc_codegen_utils/lib.rs
+++ b/src/librustc_codegen_utils/lib.rs
@@ -8,7 +8,6 @@
 #![feature(box_patterns)]
 #![feature(box_syntax)]
 #![feature(core_intrinsics)]
-#![feature(custom_attribute)]
 #![feature(never_type)]
 #![feature(nll)]
 #![allow(unused_attributes)]
diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs
index 1831d58e736..cc3180c783b 100644
--- a/src/librustc_errors/lib.rs
+++ b/src/librustc_errors/lib.rs
@@ -1,6 +1,5 @@
 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
 
-#![feature(custom_attribute)]
 #![allow(unused_attributes)]
 #![cfg_attr(unix, feature(libc))]
 #![feature(nll)]
diff --git a/src/librustc_save_analysis/lib.rs b/src/librustc_save_analysis/lib.rs
index cca5682d90a..a695a90f2ae 100644
--- a/src/librustc_save_analysis/lib.rs
+++ b/src/librustc_save_analysis/lib.rs
@@ -1,5 +1,4 @@
 #![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
-#![feature(custom_attribute)]
 #![feature(nll)]
 #![deny(rust_2018_idioms)]
 #![deny(internal)]
diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs
index 2751cd0a37e..f738f90b31e 100644
--- a/src/librustc_typeck/collect.rs
+++ b/src/librustc_typeck/collect.rs
@@ -2445,7 +2445,7 @@ fn codegen_fn_attrs<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, id: DefId) -> Codegen
     for attr in attrs.iter() {
         if attr.check_name(sym::cold) {
             codegen_fn_attrs.flags |= CodegenFnAttrFlags::COLD;
-        } else if attr.check_name(sym::allocator) {
+        } else if attr.check_name(sym::rustc_allocator) {
             codegen_fn_attrs.flags |= CodegenFnAttrFlags::ALLOCATOR;
         } else if attr.check_name(sym::unwind) {
             codegen_fn_attrs.flags |= CodegenFnAttrFlags::UNWIND;
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs
index b41b91c7631..7119fd13fbb 100644
--- a/src/libsyntax/feature_gate.rs
+++ b/src/libsyntax/feature_gate.rs
@@ -1331,6 +1331,16 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[
                                                 "internal implementation detail",
                                                 cfg_fn!(rustc_attrs))),
 
+    (sym::rustc_allocator, 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",
+                                         cfg_fn!(rustc_attrs))),
+
     // FIXME: #14408 whitelist docs since rustdoc looks at them
     (
         sym::doc,
@@ -1957,12 +1967,10 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
         }
 
         match attr_info {
-            Some(&(name, _, template, _)) => self.check_builtin_attribute(
-                attr,
-                name,
-                template
-            ),
-            None => if let Some(TokenTree::Token(token)) = attr.tokens.trees().next() {
+            // `rustc_dummy` doesn't have any restrictions specific to built-in attributes.
+            Some(&(name, _, template, _)) if name != sym::rustc_dummy =>
+                self.check_builtin_attribute(attr, name, template),
+            _ => if let Some(TokenTree::Token(token)) = attr.tokens.trees().next() {
                 if token == token::Eq {
                     // All key-value attributes are restricted to meta-item syntax.
                     attr.parse_meta(self.context.parse_sess).map_err(|mut err| err.emit()).ok();
diff --git a/src/libsyntax_pos/lib.rs b/src/libsyntax_pos/lib.rs
index 24aa82184ce..8f5595968a7 100644
--- a/src/libsyntax_pos/lib.rs
+++ b/src/libsyntax_pos/lib.rs
@@ -11,7 +11,6 @@
 
 #![feature(const_fn)]
 #![feature(crate_visibility_modifier)]
-#![feature(custom_attribute)]
 #![feature(nll)]
 #![feature(non_exhaustive)]
 #![feature(optin_builtin_traits)]
diff --git a/src/libsyntax_pos/symbol.rs b/src/libsyntax_pos/symbol.rs
index 49123e4cc30..302b3c75263 100644
--- a/src/libsyntax_pos/symbol.rs
+++ b/src/libsyntax_pos/symbol.rs
@@ -513,6 +513,7 @@ symbols! {
         rust_2018_preview,
         rust_begin_unwind,
         rustc,
+        rustc_allocator,
         rustc_allocator_nounwind,
         rustc_allow_const_fn_ptr,
         rustc_args_required_const,
@@ -526,6 +527,7 @@ symbols! {
         rustc_diagnostic_macros,
         rustc_dirty,
         rustc_doc_only_macro,
+        rustc_dummy,
         rustc_dump_env_program_clauses,
         rustc_dump_program_clauses,
         rustc_dump_user_substs,
diff --git a/src/libterm/lib.rs b/src/libterm/lib.rs
index 711716d9b92..3b5ac7baf20 100644
--- a/src/libterm/lib.rs
+++ b/src/libterm/lib.rs
@@ -38,9 +38,6 @@
 #![deny(rust_2018_idioms)]
 
 #![cfg_attr(windows, feature(libc))]
-// Handle rustfmt skips
-#![feature(custom_attribute)]
-#![allow(unused_attributes)]
 
 use std::io::prelude::*;
 use std::io::{self, Stdout, Stderr};
diff --git a/src/test/codegen/function-arguments.rs b/src/test/codegen/function-arguments.rs
index c2d697fd046..bd121ef24ad 100644
--- a/src/test/codegen/function-arguments.rs
+++ b/src/test/codegen/function-arguments.rs
@@ -2,7 +2,7 @@
 // ignore-tidy-linelength
 
 #![crate_type = "lib"]
-#![feature(custom_attribute)]
+#![feature(rustc_attrs)]
 
 pub struct S {
   _field: [i32; 8],
@@ -146,7 +146,7 @@ pub fn enum_id_2(x: Option<u8>) -> Option<u8> {
 
 // CHECK: noalias i8* @allocator()
 #[no_mangle]
-#[allocator]
+#[rustc_allocator]
 pub fn allocator() -> *const i8 {
   std::ptr::null()
 }
diff --git a/src/test/pretty/attr-fn-inner.rs b/src/test/pretty/attr-fn-inner.rs
index f13339e334c..0a745e7d34f 100644
--- a/src/test/pretty/attr-fn-inner.rs
+++ b/src/test/pretty/attr-fn-inner.rs
@@ -1,15 +1,16 @@
-// pp-exact
 // Testing that both the inner item and next outer item are
 // preserved, and that the first outer item parsed in main is not
 // accidentally carried over to each inner function
 
-#![feature(custom_attribute)]
+// pp-exact
+
+#![feature(rustc_attrs)]
 
 fn main() {
-    #![inner_attr]
-    #[outer_attr]
+    #![rustc_dummy]
+    #[rustc_dummy]
     fn f() { }
 
-    #[outer_attr]
+    #[rustc_dummy]
     fn g() { }
 }
diff --git a/src/test/pretty/attr-literals.rs b/src/test/pretty/attr-literals.rs
index 355f3d5a3cf..44d2c5db3e6 100644
--- a/src/test/pretty/attr-literals.rs
+++ b/src/test/pretty/attr-literals.rs
@@ -1,13 +1,14 @@
-// pp-exact
 // Tests literals in attributes.
 
-#![feature(custom_attribute)]
+// pp-exact
+
+#![feature(rustc_attrs)]
 
 fn main() {
-    #![hello("hi", 1, 2, 1.012, pi = 3.14, bye, name("John"))]
-    #[align = 8]
+    #![rustc_dummy("hi", 1, 2, 1.012, pi = 3.14, bye, name("John"))]
+    #[rustc_dummy = 8]
     fn f() { }
 
-    #[vector(1, 2, 3)]
+    #[rustc_dummy(1, 2, 3)]
     fn g() { }
 }
diff --git a/src/test/pretty/stmt_expr_attributes.rs b/src/test/pretty/stmt_expr_attributes.rs
index eb1768683e6..d81485b555f 100644
--- a/src/test/pretty/stmt_expr_attributes.rs
+++ b/src/test/pretty/stmt_expr_attributes.rs
@@ -1,20 +1,20 @@
 // pp-exact
 
-#![feature(custom_attribute)]
 #![feature(box_syntax)]
+#![feature(rustc_attrs)]
 #![feature(stmt_expr_attributes)]
 
 fn main() { }
 
 fn _0() {
 
-    #[attr]
+    #[rustc_dummy]
     foo();
 }
 
 fn _1() {
 
-    #[attr]
+    #[rustc_dummy]
     unsafe {
         // code
     }
@@ -22,11 +22,11 @@ fn _1() {
 
 fn _2() {
 
-    #[attr]
+    #[rustc_dummy]
     { foo(); }
 
     {
-        #![attr]
+        #![rustc_dummy]
 
         foo()
     }
@@ -34,51 +34,51 @@ fn _2() {
 
 fn _3() {
 
-    #[attr]
+    #[rustc_dummy]
     match () { _ => { } }
 }
 
 fn _4() {
 
-    #[attr]
+    #[rustc_dummy]
     match () {
-        #![attr]
+        #![rustc_dummy]
         _ => (),
     }
 
     let _ =
-        #[attr] match () {
-                    #![attr]
-                    () => (),
-                };
+        #[rustc_dummy] match () {
+                           #![rustc_dummy]
+                           () => (),
+                       };
 }
 
 fn _5() {
 
-    #[attr]
+    #[rustc_dummy]
     let x = 1;
 
-    let x = #[attr] 1;
+    let x = #[rustc_dummy] 1;
 
     let y = ();
     let z = ();
 
-    foo3(x, #[attr] y, z);
+    foo3(x, #[rustc_dummy] y, z);
 
-    qux(3 + #[attr] 2);
+    qux(3 + #[rustc_dummy] 2);
 }
 
 fn _6() {
 
-    #[attr]
-    [#![attr] 1, 2, 3];
+    #[rustc_dummy]
+    [#![rustc_dummy] 1, 2, 3];
 
-    let _ = #[attr] [#![attr] 1, 2, 3];
+    let _ = #[rustc_dummy] [#![rustc_dummy] 1, 2, 3];
 
-    #[attr]
-    [#![attr] 1; 4];
+    #[rustc_dummy]
+    [#![rustc_dummy] 1; 4];
 
-    let _ = #[attr] [#![attr] 1; 4];
+    let _ = #[rustc_dummy] [#![rustc_dummy] 1; 4];
 }
 
 struct Foo {
@@ -89,45 +89,41 @@ struct Bar(());
 
 fn _7() {
 
-    #[attr]
-    Foo{#![attr] data: (),};
+    #[rustc_dummy]
+    Foo{#![rustc_dummy] data: (),};
 
-    let _ = #[attr] Foo{#![attr] data: (),};
+    let _ = #[rustc_dummy] Foo{#![rustc_dummy] data: (),};
 }
 
 fn _8() {
 
-    #[attr]
-    (#![attr] );
+    #[rustc_dummy]
+    (#![rustc_dummy] );
 
-    #[attr]
-    (#![attr] 0);
+    #[rustc_dummy]
+    (#![rustc_dummy] 0);
 
-    #[attr]
-    (#![attr] 0,);
+    #[rustc_dummy]
+    (#![rustc_dummy] 0,);
 
-    #[attr]
-    (#![attr] 0, 1);
+    #[rustc_dummy]
+    (#![rustc_dummy] 0, 1);
 }
 
 fn _9() {
     macro_rules! stmt_mac((  ) => { let _ = (  ) ; });
 
-    #[attr]
+    #[rustc_dummy]
     stmt_mac!();
 
-    /*
-    // pre existing pp bug: delimiter styles gets lost:
-
-    #[attr]
+    #[rustc_dummy]
     stmt_mac!{ };
 
-    #[attr]
+    #[rustc_dummy]
     stmt_mac![];
 
-    #[attr]
-    stmt_mac!{ } // pre-existing pp bug: compiler ICEs with a None unwrap
-    */
+    #[rustc_dummy]
+    stmt_mac!{ }
 
     let _ = ();
 }
@@ -135,138 +131,131 @@ fn _9() {
 macro_rules! expr_mac((  ) => { (  ) });
 
 fn _10() {
-
-    let _ = #[attr] expr_mac!();
-
-    /*
-    // pre existing pp bug: delimiter styles gets lost:
-    let _ = #[attr] expr_mac![];
-    let _ = #[attr] expr_mac!{};
-    */
+    let _ = #[rustc_dummy] expr_mac!();
+    let _ = #[rustc_dummy] expr_mac![];
+    let _ = #[rustc_dummy] expr_mac!{ };
 }
 
 fn _11() {
-    let _ = #[attr] box 0;
-    let _: [(); 0] = #[attr] [#![attr] ];
-    let _ = #[attr] [#![attr] 0, 0];
-    let _ = #[attr] [#![attr] 0; 0];
-    let _ = #[attr] foo();
-    let _ = #[attr] 1i32.clone();
-    let _ = #[attr] (#![attr] );
-    let _ = #[attr] (#![attr] 0);
-    let _ = #[attr] (#![attr] 0,);
-    let _ = #[attr] (#![attr] 0, 0);
-    let _ = #[attr] 0 + #[attr] 0;
-    let _ = #[attr] !0;
-    let _ = #[attr] -0i32;
-    let _ = #[attr] false;
-    let _ = #[attr] 'c';
-    let _ = #[attr] 0;
-    let _ = #[attr] 0 as usize;
+    let _ = #[rustc_dummy] box 0;
+    let _: [(); 0] = #[rustc_dummy] [#![rustc_dummy] ];
+    let _ = #[rustc_dummy] [#![rustc_dummy] 0, 0];
+    let _ = #[rustc_dummy] [#![rustc_dummy] 0; 0];
+    let _ = #[rustc_dummy] foo();
+    let _ = #[rustc_dummy] 1i32.clone();
+    let _ = #[rustc_dummy] (#![rustc_dummy] );
+    let _ = #[rustc_dummy] (#![rustc_dummy] 0);
+    let _ = #[rustc_dummy] (#![rustc_dummy] 0,);
+    let _ = #[rustc_dummy] (#![rustc_dummy] 0, 0);
+    let _ = #[rustc_dummy] 0 + #[rustc_dummy] 0;
+    let _ = #[rustc_dummy] !0;
+    let _ = #[rustc_dummy] -0i32;
+    let _ = #[rustc_dummy] false;
+    let _ = #[rustc_dummy] 'c';
+    let _ = #[rustc_dummy] 0;
+    let _ = #[rustc_dummy] 0 as usize;
     let _ =
-        #[attr] while false {
-                    #![attr]
-                };
+        #[rustc_dummy] while false {
+                           #![rustc_dummy]
+                       };
     let _ =
-        #[attr] while let None = Some(()) {
-                    #![attr]
-                };
+        #[rustc_dummy] while let None = Some(()) {
+                           #![rustc_dummy]
+                       };
     let _ =
-        #[attr] for _ in 0..0 {
-                    #![attr]
-                };
+        #[rustc_dummy] for _ in 0..0 {
+                           #![rustc_dummy]
+                       };
     // FIXME: pp bug, two spaces after the loop
     let _ =
-        #[attr] loop  {
-                    #![attr]
-                };
+        #[rustc_dummy] loop  {
+                           #![rustc_dummy]
+                       };
     let _ =
-        #[attr] match false {
-                    #![attr]
-                    _ => (),
-                };
-    let _ = #[attr] || #[attr] ();
-    let _ = #[attr] move || #[attr] ();
+        #[rustc_dummy] match false {
+                           #![rustc_dummy]
+                           _ => (),
+                       };
+    let _ = #[rustc_dummy] || #[rustc_dummy] ();
+    let _ = #[rustc_dummy] move || #[rustc_dummy] ();
     let _ =
-        #[attr] ||
-                    {
-                        #![attr]
-                        #[attr]
-                        ()
-                    };
+        #[rustc_dummy] ||
+                           {
+                               #![rustc_dummy]
+                               #[rustc_dummy]
+                               ()
+                           };
     let _ =
-        #[attr] move ||
-                    {
-                        #![attr]
-                        #[attr]
-                        ()
-                    };
+        #[rustc_dummy] move ||
+                           {
+                               #![rustc_dummy]
+                               #[rustc_dummy]
+                               ()
+                           };
     let _ =
-        #[attr] {
-                    #![attr]
-                };
+        #[rustc_dummy] {
+                           #![rustc_dummy]
+                       };
     let _ =
-        #[attr] {
-                    #![attr]
-                    let _ = ();
-                };
+        #[rustc_dummy] {
+                           #![rustc_dummy]
+                           let _ = ();
+                       };
     let _ =
-        #[attr] {
-                    #![attr]
-                    let _ = ();
-                    ()
-                };
+        #[rustc_dummy] {
+                           #![rustc_dummy]
+                           let _ = ();
+                           ()
+                       };
     let mut x = 0;
-    let _ = #[attr] x = 15;
-    let _ = #[attr] x += 15;
+    let _ = #[rustc_dummy] x = 15;
+    let _ = #[rustc_dummy] x += 15;
     let s = Foo{data: (),};
-    let _ = #[attr] s.data;
-    let _ = (#[attr] s).data;
+    let _ = #[rustc_dummy] s.data;
+    let _ = (#[rustc_dummy] s).data;
     let t = Bar(());
-    let _ = #[attr] t.0;
-    let _ = (#[attr] t).0;
+    let _ = #[rustc_dummy] t.0;
+    let _ = (#[rustc_dummy] t).0;
     let v = vec!(0);
-    let _ = #[attr] v[0];
-    let _ = (#[attr] v)[0];
-    let _ = #[attr] 0..#[attr] 0;
-    let _ = #[attr] 0..;
-    let _ = #[attr] (0..0);
-    let _ = #[attr] (0..);
-    let _ = #[attr] (..0);
-    let _ = #[attr] (..);
-    let _: fn(&u32) -> u32 = #[attr] std::clone::Clone::clone;
-    let _ = #[attr] &0;
-    let _ = #[attr] &mut 0;
-    let _ = #[attr] &#[attr] 0;
-    let _ = #[attr] &mut #[attr] 0;
+    let _ = #[rustc_dummy] v[0];
+    let _ = (#[rustc_dummy] v)[0];
+    let _ = #[rustc_dummy] 0..#[rustc_dummy] 0;
+    let _ = #[rustc_dummy] 0..;
+    let _ = #[rustc_dummy] (0..0);
+    let _ = #[rustc_dummy] (0..);
+    let _ = #[rustc_dummy] (..0);
+    let _ = #[rustc_dummy] (..);
+    let _: fn(&u32) -> u32 = #[rustc_dummy] std::clone::Clone::clone;
+    let _ = #[rustc_dummy] &0;
+    let _ = #[rustc_dummy] &mut 0;
+    let _ = #[rustc_dummy] &#[rustc_dummy] 0;
+    let _ = #[rustc_dummy] &mut #[rustc_dummy] 0;
     // FIXME: pp bug, extra space after keyword?
-    while false { let _ = #[attr] continue ; }
-    while true { let _ = #[attr] break ; }
-    || #[attr] return;
-    let _ = #[attr] expr_mac!();
-    /* FIXME: pp bug, losing delimiter styles
-    let _ = #[attr] expr_mac![];
-    let _ = #[attr] expr_mac!{};
-    */
-    let _ = #[attr] Foo{#![attr] data: (),};
-    let _ = #[attr] Foo{#![attr] ..s};
-    let _ = #[attr] Foo{#![attr] data: (), ..s};
-    let _ = #[attr] (#![attr] 0);
+    while false { let _ = #[rustc_dummy] continue ; }
+    while true { let _ = #[rustc_dummy] break ; }
+    || #[rustc_dummy] return;
+    let _ = #[rustc_dummy] expr_mac!();
+    let _ = #[rustc_dummy] expr_mac![];
+    let _ = #[rustc_dummy] expr_mac!{ };
+    let _ = #[rustc_dummy] Foo{#![rustc_dummy] data: (),};
+    let _ = #[rustc_dummy] Foo{#![rustc_dummy] ..s};
+    let _ = #[rustc_dummy] Foo{#![rustc_dummy] data: (), ..s};
+    let _ = #[rustc_dummy] (#![rustc_dummy] 0);
 }
 
 fn _12() {
-    #[attr]
+    #[rustc_dummy]
     let _ = 0;
 
-    #[attr]
+    #[rustc_dummy]
     0;
 
-    #[attr]
+    #[rustc_dummy]
     expr_mac!();
 
-    #[attr]
+    #[rustc_dummy]
     {
-        #![attr]
+        #![rustc_dummy]
     }
 }
 
diff --git a/src/test/run-pass/attr-before-view-item.rs b/src/test/run-pass/attr-before-view-item.rs
deleted file mode 100644
index 14b4189684f..00000000000
--- a/src/test/run-pass/attr-before-view-item.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-#![allow(unused_attributes)]
-
-// pretty-expanded FIXME #23616
-
-#![feature(custom_attribute, test)]
-
-#[foo = "bar"]
-extern crate test;
-
-pub fn main() {
-}
diff --git a/src/test/run-pass/attr-before-view-item2.rs b/src/test/run-pass/attr-before-view-item2.rs
deleted file mode 100644
index 6fc1e35d47a..00000000000
--- a/src/test/run-pass/attr-before-view-item2.rs
+++ /dev/null
@@ -1,13 +0,0 @@
-#![allow(unused_attributes)]
-
-// pretty-expanded FIXME #23616
-
-#![feature(custom_attribute, test)]
-
-mod m {
-    #[foo = "bar"]
-    extern crate test;
-}
-
-pub fn main() {
-}
diff --git a/src/test/run-pass/attr-mix-new.rs b/src/test/run-pass/attr-mix-new.rs
deleted file mode 100644
index 223a434dbb9..00000000000
--- a/src/test/run-pass/attr-mix-new.rs
+++ /dev/null
@@ -1,14 +0,0 @@
-#![allow(unused_attributes)]
-#![allow(unknown_lints)]
-
-// pretty-expanded FIXME #23616
-
-#![allow(unused_attribute)]
-#![feature(custom_attribute)]
-
-#[foo(bar)]
-mod foo {
-  #![feature(globs)]
-}
-
-pub fn main() {}
diff --git a/src/test/run-pass/auxiliary/allocator-dummy.rs b/src/test/run-pass/auxiliary/allocator-dummy.rs
deleted file mode 100644
index bedf3020c8b..00000000000
--- a/src/test/run-pass/auxiliary/allocator-dummy.rs
+++ /dev/null
@@ -1,59 +0,0 @@
-// no-prefer-dynamic
-
-#![feature(allocator, core_intrinsics, panic_unwind)]
-#![allocator]
-#![crate_type = "rlib"]
-#![no_std]
-
-extern crate unwind;
-
-pub static mut HITS: usize = 0;
-
-type size_t = usize;
-
-extern {
-    fn malloc(size: usize) -> *mut u8;
-    fn free(ptr: *mut u8);
-    fn calloc(size: usize, amt: usize) -> *mut u8;
-    fn realloc(ptr: *mut u8, size: usize) -> *mut u8;
-}
-
-#[no_mangle]
-pub extern fn __rust_allocate(size: usize, align: usize) -> *mut u8 {
-    unsafe {
-        HITS += 1;
-        malloc(size as size_t) as *mut u8
-    }
-}
-
-#[no_mangle]
-pub extern fn __rust_allocate_zeroed(size: usize, _align: usize) -> *mut u8 {
-    unsafe { calloc(size as size_t, 1) as *mut u8 }
-}
-
-#[no_mangle]
-pub extern fn __rust_deallocate(ptr: *mut u8, old_size: usize, align: usize) {
-    unsafe {
-        HITS += 1;
-        free(ptr as *mut _)
-    }
-}
-
-#[no_mangle]
-pub extern fn __rust_reallocate(ptr: *mut u8, old_size: usize, size: usize,
-                                align: usize) -> *mut u8 {
-    unsafe {
-        realloc(ptr as *mut _, size as size_t) as *mut u8
-    }
-}
-
-#[no_mangle]
-pub extern fn __rust_reallocate_inplace(ptr: *mut u8, old_size: usize,
-                                        size: usize, align: usize) -> usize {
-    unsafe { core::intrinsics::abort() }
-}
-
-#[no_mangle]
-pub extern fn __rust_usable_size(size: usize, align: usize) -> usize {
-    unsafe { core::intrinsics::abort() }
-}
diff --git a/src/test/run-pass/check-static-recursion-foreign.rs b/src/test/run-pass/check-static-recursion-foreign.rs
index c423bf666e5..361f8a1d340 100644
--- a/src/test/run-pass/check-static-recursion-foreign.rs
+++ b/src/test/run-pass/check-static-recursion-foreign.rs
@@ -6,7 +6,7 @@
 
 // pretty-expanded FIXME #23616
 
-#![feature(custom_attribute, rustc_private)]
+#![feature(rustc_private)]
 
 extern crate check_static_recursion_foreign_helper;
 extern crate libc;
diff --git a/src/test/run-pass/macros/macro-attributes.rs b/src/test/run-pass/macros/macro-attributes.rs
index 953f6be53c5..d382e8b7197 100644
--- a/src/test/run-pass/macros/macro-attributes.rs
+++ b/src/test/run-pass/macros/macro-attributes.rs
@@ -1,5 +1,4 @@
 // run-pass
-#![feature(custom_attribute)]
 
 macro_rules! compiles_fine {
     (#[$at:meta]) => {
diff --git a/src/test/run-pass/methods/method-attributes.rs b/src/test/run-pass/methods/method-attributes.rs
deleted file mode 100644
index c7d8b3b1403..00000000000
--- a/src/test/run-pass/methods/method-attributes.rs
+++ /dev/null
@@ -1,31 +0,0 @@
-// run-pass
-#![allow(unused_attributes)]
-#![allow(non_camel_case_types)]
-
-// pp-exact - Make sure we print all the attributes
-// pretty-expanded FIXME #23616
-
-#![feature(custom_attribute)]
-
-#[frobable]
-trait frobable {
-    #[frob_attr]
-    fn frob(&self);
-    #[defrob_attr]
-    fn defrob(&self);
-}
-
-#[int_frobable]
-impl frobable for isize {
-    #[frob_attr1]
-    fn frob(&self) {
-        #![frob_attr2]
-    }
-
-    #[defrob_attr1]
-    fn defrob(&self) {
-        #![defrob_attr2]
-    }
-}
-
-pub fn main() { }
diff --git a/src/test/run-pass/structs-enums/class-attributes-1.rs b/src/test/run-pass/structs-enums/class-attributes-1.rs
deleted file mode 100644
index 11ea29ece8a..00000000000
--- a/src/test/run-pass/structs-enums/class-attributes-1.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-// run-pass
-#![allow(unused_attributes)]
-#![allow(non_camel_case_types)]
-
-// pp-exact - Make sure we actually print the attributes
-#![feature(custom_attribute)]
-
-struct cat {
-    name: String,
-}
-
-impl Drop for cat {
-    #[cat_dropper]
-    fn drop(&mut self) { println!("{} landed on hir feet" , self . name); }
-}
-
-
-#[cat_maker]
-fn cat(name: String) -> cat { cat{name: name,} }
-
-pub fn main() { let _kitty = cat("Spotty".to_string()); }
diff --git a/src/test/run-pass/structs-enums/class-attributes-2.rs b/src/test/run-pass/structs-enums/class-attributes-2.rs
deleted file mode 100644
index d6cf63e62fe..00000000000
--- a/src/test/run-pass/structs-enums/class-attributes-2.rs
+++ /dev/null
@@ -1,33 +0,0 @@
-// run-pass
-#![allow(unused_attributes)]
-#![allow(non_camel_case_types)]
-
-#![feature(custom_attribute)]
-
-struct cat {
-  name: String,
-}
-
-impl Drop for cat {
-    #[cat_dropper]
-    /**
-       Actually, cats don't always land on their feet when you drop them.
-    */
-    fn drop(&mut self) {
-        println!("{} landed on hir feet", self.name);
-    }
-}
-
-#[cat_maker]
-/**
-Maybe it should technically be a kitten_maker.
-*/
-fn cat(name: String) -> cat {
-    cat {
-        name: name
-    }
-}
-
-pub fn main() {
-  let _kitty = cat("Spotty".to_string());
-}
diff --git a/src/test/ui/attr-eq-token-tree.rs b/src/test/ui/attr-eq-token-tree.rs
index 6aacb9d572a..c301492b9e2 100644
--- a/src/test/ui/attr-eq-token-tree.rs
+++ b/src/test/ui/attr-eq-token-tree.rs
@@ -1,4 +1,2 @@
-#![feature(custom_attribute)]
-
 #[my_attr = !] //~ ERROR unexpected token: `!`
 fn main() {}
diff --git a/src/test/ui/attr-eq-token-tree.stderr b/src/test/ui/attr-eq-token-tree.stderr
index 571779dfa1a..bb37c2e0cc4 100644
--- a/src/test/ui/attr-eq-token-tree.stderr
+++ b/src/test/ui/attr-eq-token-tree.stderr
@@ -1,5 +1,5 @@
 error: unexpected token: `!`
-  --> $DIR/attr-eq-token-tree.rs:3:13
+  --> $DIR/attr-eq-token-tree.rs:1:13
    |
 LL | #[my_attr = !]
    |             ^
diff --git a/src/test/ui/attributes/attr-before-view-item.rs b/src/test/ui/attributes/attr-before-view-item.rs
new file mode 100644
index 00000000000..fc040bd1a5d
--- /dev/null
+++ b/src/test/ui/attributes/attr-before-view-item.rs
@@ -0,0 +1,10 @@
+// compile-pass
+// pretty-expanded FIXME #23616
+
+#![feature(rustc_attrs)]
+#![feature(test)]
+
+#[rustc_dummy = "bar"]
+extern crate test;
+
+fn main() {}
diff --git a/src/test/ui/attributes/attr-before-view-item2.rs b/src/test/ui/attributes/attr-before-view-item2.rs
new file mode 100644
index 00000000000..c7fad3802e9
--- /dev/null
+++ b/src/test/ui/attributes/attr-before-view-item2.rs
@@ -0,0 +1,12 @@
+// compile-pass
+// pretty-expanded FIXME #23616
+
+#![feature(rustc_attrs)]
+#![feature(test)]
+
+mod m {
+    #[rustc_dummy = "bar"]
+    extern crate test;
+}
+
+fn main() {}
diff --git a/src/test/ui/attributes/attr-mix-new.rs b/src/test/ui/attributes/attr-mix-new.rs
new file mode 100644
index 00000000000..d9cb5510960
--- /dev/null
+++ b/src/test/ui/attributes/attr-mix-new.rs
@@ -0,0 +1,11 @@
+// compile-pass
+// pretty-expanded FIXME #23616
+
+#![feature(rustc_attrs)]
+
+#[rustc_dummy(bar)]
+mod foo {
+  #![feature(globs)]
+}
+
+fn main() {}
diff --git a/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-1.rs b/src/test/ui/attributes/attrs-with-no-formal-in-generics-1.rs
index ca5fdd9da85..ca5fdd9da85 100644
--- a/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-1.rs
+++ b/src/test/ui/attributes/attrs-with-no-formal-in-generics-1.rs
diff --git a/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-1.stderr b/src/test/ui/attributes/attrs-with-no-formal-in-generics-1.stderr
index 55e7a987784..55e7a987784 100644
--- a/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-1.stderr
+++ b/src/test/ui/attributes/attrs-with-no-formal-in-generics-1.stderr
diff --git a/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-2.rs b/src/test/ui/attributes/attrs-with-no-formal-in-generics-2.rs
index c795612acf0..c795612acf0 100644
--- a/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-2.rs
+++ b/src/test/ui/attributes/attrs-with-no-formal-in-generics-2.rs
diff --git a/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-2.stderr b/src/test/ui/attributes/attrs-with-no-formal-in-generics-2.stderr
index acd0ae3678a..acd0ae3678a 100644
--- a/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-2.stderr
+++ b/src/test/ui/attributes/attrs-with-no-formal-in-generics-2.stderr
diff --git a/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-3.rs b/src/test/ui/attributes/attrs-with-no-formal-in-generics-3.rs
index 3cfc70b4185..3cfc70b4185 100644
--- a/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-3.rs
+++ b/src/test/ui/attributes/attrs-with-no-formal-in-generics-3.rs
diff --git a/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-3.stderr b/src/test/ui/attributes/attrs-with-no-formal-in-generics-3.stderr
index b9ca0097467..b9ca0097467 100644
--- a/src/test/ui/attrs-with-no-formal-in-generics/attrs-with-no-formal-in-generics-3.stderr
+++ b/src/test/ui/attributes/attrs-with-no-formal-in-generics-3.stderr
diff --git a/src/test/ui/attributes/class-attributes-1.rs b/src/test/ui/attributes/class-attributes-1.rs
new file mode 100644
index 00000000000..7808367f2c1
--- /dev/null
+++ b/src/test/ui/attributes/class-attributes-1.rs
@@ -0,0 +1,19 @@
+// compile-pass
+// pp-exact - Make sure we actually print the attributes
+
+#![feature(rustc_attrs)]
+
+struct Cat {
+    name: String,
+}
+
+impl Drop for Cat {
+    #[rustc_dummy]
+    fn drop(&mut self) { println!("{} landed on hir feet" , self . name); }
+}
+
+
+#[rustc_dummy]
+fn cat(name: String) -> Cat { Cat{name: name,} }
+
+fn main() { let _kitty = cat("Spotty".to_string()); }
diff --git a/src/test/ui/attributes/class-attributes-2.rs b/src/test/ui/attributes/class-attributes-2.rs
new file mode 100644
index 00000000000..348c70f35c3
--- /dev/null
+++ b/src/test/ui/attributes/class-attributes-2.rs
@@ -0,0 +1,31 @@
+// compile-pass
+
+#![feature(rustc_attrs)]
+
+struct Cat {
+    name: String,
+}
+
+impl Drop for Cat {
+    #[rustc_dummy]
+    /**
+       Actually, cats don't always land on their feet when you drop them.
+    */
+    fn drop(&mut self) {
+        println!("{} landed on hir feet", self.name);
+    }
+}
+
+#[rustc_dummy]
+/**
+Maybe it should technically be a kitten_maker.
+*/
+fn cat(name: String) -> Cat {
+    Cat {
+        name: name
+    }
+}
+
+fn main() {
+    let _kitty = cat("Spotty".to_string());
+}
diff --git a/src/test/run-pass/item-attributes.rs b/src/test/ui/attributes/item-attributes.rs
index e3ed350f29a..72c9a35dc07 100644
--- a/src/test/run-pass/item-attributes.rs
+++ b/src/test/ui/attributes/item-attributes.rs
@@ -1,80 +1,77 @@
-#![allow(non_camel_case_types)]
-#![allow(non_upper_case_globals)]
-#![allow(unused_attributes)]
-#![allow(dead_code)]
-#![allow(unknown_lints)]
 // These are attributes of the implicit crate. Really this just needs to parse
 // for completeness since .rs files linked from .rc files support this
 // notation to specify their module's attributes
 
-#![feature(custom_attribute)]
-#![allow(unused_attribute)]
-#![attr1 = "val"]
-#![attr2 = "val"]
-#![attr3]
-#![attr4(attr5)]
+// compile-pass
+
+#![feature(rustc_attrs)]
+
+#![rustc_dummy = "val"]
+#![rustc_dummy = "val"]
+#![rustc_dummy]
+#![rustc_dummy(attr5)]
 
 #![crate_id="foobar#0.1"]
 
 // These are attributes of the following mod
-#[attr1 = "val"]
-#[attr2 = "val"]
+#[rustc_dummy = "val"]
+#[rustc_dummy = "val"]
 mod test_first_item_in_file_mod {}
 
 mod test_single_attr_outer {
-    #[attr = "val"]
-    pub static x: isize = 10;
+    #[rustc_dummy = "val"]
+    pub static X: isize = 10;
 
-    #[attr = "val"]
+    #[rustc_dummy = "val"]
     pub fn f() { }
 
-    #[attr = "val"]
+    #[rustc_dummy = "val"]
     pub mod mod1 {}
 
     pub mod rustrt {
-        #[attr = "val"]
+        #[rustc_dummy = "val"]
         extern {}
     }
 }
 
 mod test_multi_attr_outer {
-    #[attr1 = "val"]
-    #[attr2 = "val"]
-    pub static x: isize = 10;
+    #[rustc_dummy = "val"]
+    #[rustc_dummy = "val"]
+    pub static X: isize = 10;
 
-    #[attr1 = "val"]
-    #[attr2 = "val"]
+    #[rustc_dummy = "val"]
+    #[rustc_dummy = "val"]
     pub fn f() { }
 
-    #[attr1 = "val"]
-    #[attr2 = "val"]
+    #[rustc_dummy = "val"]
+    #[rustc_dummy = "val"]
     pub mod mod1 {}
 
     pub mod rustrt {
-        #[attr1 = "val"]
-        #[attr2 = "val"]
+        #[rustc_dummy = "val"]
+        #[rustc_dummy = "val"]
         extern {}
     }
 
-    #[attr1 = "val"]
-    #[attr2 = "val"]
-    struct t {x: isize}
+    #[rustc_dummy = "val"]
+    #[rustc_dummy = "val"]
+    struct T {x: isize}
 }
 
 mod test_stmt_single_attr_outer {
     pub fn f() {
-        #[attr = "val"]
-        static x: isize = 10;
+        #[rustc_dummy = "val"]
+        static X: isize = 10;
 
-        #[attr = "val"]
+        #[rustc_dummy = "val"]
         fn f() { }
 
-        #[attr = "val"]
+        #[rustc_dummy = "val"]
         mod mod1 {
         }
 
         mod rustrt {
-            #[attr = "val"]
+            #[rustc_dummy = "val"]
             extern {
             }
         }
@@ -84,22 +81,22 @@ mod test_stmt_single_attr_outer {
 mod test_stmt_multi_attr_outer {
     pub fn f() {
 
-        #[attr1 = "val"]
-        #[attr2 = "val"]
-        static x: isize = 10;
+        #[rustc_dummy = "val"]
+        #[rustc_dummy = "val"]
+        static X: isize = 10;
 
-        #[attr1 = "val"]
-        #[attr2 = "val"]
+        #[rustc_dummy = "val"]
+        #[rustc_dummy = "val"]
         fn f() { }
 
-        #[attr1 = "val"]
-        #[attr2 = "val"]
+        #[rustc_dummy = "val"]
+        #[rustc_dummy = "val"]
         mod mod1 {
         }
 
         mod rustrt {
-            #[attr1 = "val"]
-            #[attr2 = "val"]
+            #[rustc_dummy = "val"]
+            #[rustc_dummy = "val"]
             extern {
             }
         }
@@ -109,16 +106,16 @@ mod test_stmt_multi_attr_outer {
 mod test_attr_inner {
     pub mod m {
         // This is an attribute of mod m
-        #![attr = "val"]
+        #![rustc_dummy = "val"]
     }
 }
 
 mod test_attr_inner_then_outer {
     pub mod m {
         // This is an attribute of mod m
-        #![attr = "val"]
+        #![rustc_dummy = "val"]
         // This is an attribute of fn f
-        #[attr = "val"]
+        #[rustc_dummy = "val"]
         fn f() { }
     }
 }
@@ -126,11 +123,11 @@ mod test_attr_inner_then_outer {
 mod test_attr_inner_then_outer_multi {
     pub mod m {
         // This is an attribute of mod m
-        #![attr1 = "val"]
-        #![attr2 = "val"]
+        #![rustc_dummy = "val"]
+        #![rustc_dummy = "val"]
         // This is an attribute of fn f
-        #[attr1 = "val"]
-        #[attr2 = "val"]
+        #[rustc_dummy = "val"]
+        #[rustc_dummy = "val"]
         fn f() { }
     }
 }
@@ -138,25 +135,25 @@ mod test_attr_inner_then_outer_multi {
 mod test_distinguish_syntax_ext {
     pub fn f() {
         format!("test{}", "s");
-        #[attr = "val"]
+        #[rustc_dummy = "val"]
         fn g() { }
     }
 }
 
 mod test_other_forms {
-    #[attr]
-    #[attr(word)]
-    #[attr(attr(word))]
-    #[attr(key1 = "val", key2 = "val", attr)]
+    #[rustc_dummy]
+    #[rustc_dummy(word)]
+    #[rustc_dummy(attr(word))]
+    #[rustc_dummy(key1 = "val", key2 = "val", attr)]
     pub fn f() { }
 }
 
 mod test_foreign_items {
     pub mod rustrt {
         extern {
-            #![attr]
+            #![rustc_dummy]
 
-            #[attr]
+            #[rustc_dummy]
             fn rust_get_test_int() -> u32;
         }
     }
@@ -178,7 +175,7 @@ mod test_foreign_items {
 }*/
 
 fn test_fn_inner() {
-    #![inner_fn_attr]
+    #![rustc_dummy]
 }
 
-pub fn main() { }
+fn main() {}
diff --git a/src/test/ui/attributes/method-attributes.rs b/src/test/ui/attributes/method-attributes.rs
new file mode 100644
index 00000000000..2d608acc71f
--- /dev/null
+++ b/src/test/ui/attributes/method-attributes.rs
@@ -0,0 +1,28 @@
+// compile-pass
+// pp-exact - Make sure we print all the attributes
+// pretty-expanded FIXME #23616
+
+#![feature(rustc_attrs)]
+
+#[rustc_dummy]
+trait Frobable {
+    #[rustc_dummy]
+    fn frob(&self);
+    #[rustc_dummy]
+    fn defrob(&self);
+}
+
+#[rustc_dummy]
+impl Frobable for isize {
+    #[rustc_dummy]
+    fn frob(&self) {
+        #![rustc_dummy]
+    }
+
+    #[rustc_dummy]
+    fn defrob(&self) {
+        #![rustc_dummy]
+    }
+}
+
+fn main() {}
diff --git a/src/test/ui/attributes/obsolete-attr.rs b/src/test/ui/attributes/obsolete-attr.rs
new file mode 100644
index 00000000000..89e2ad2669c
--- /dev/null
+++ b/src/test/ui/attributes/obsolete-attr.rs
@@ -0,0 +1,7 @@
+// Obsolete attributes fall back to feature gated custom attributes.
+
+#[ab_isize="stdcall"] extern {} //~ ERROR attribute `ab_isize` is currently unknown
+
+#[fixed_stack_segment] fn f() {} //~ ERROR attribute `fixed_stack_segment` is currently unknown
+
+fn main() {}
diff --git a/src/test/ui/attributes/obsolete-attr.stderr b/src/test/ui/attributes/obsolete-attr.stderr
new file mode 100644
index 00000000000..2ed7f87935f
--- /dev/null
+++ b/src/test/ui/attributes/obsolete-attr.stderr
@@ -0,0 +1,21 @@
+error[E0658]: The attribute `fixed_stack_segment` is currently unknown to the compiler and may have meaning added to it in the future
+  --> $DIR/obsolete-attr.rs:5:3
+   |
+LL | #[fixed_stack_segment] fn f() {}
+   |   ^^^^^^^^^^^^^^^^^^^
+   |
+   = note: for more information, see https://github.com/rust-lang/rust/issues/29642
+   = help: add #![feature(custom_attribute)] to the crate attributes to enable
+
+error[E0658]: The attribute `ab_isize` is currently unknown to the compiler and may have meaning added to it in the future
+  --> $DIR/obsolete-attr.rs:3:3
+   |
+LL | #[ab_isize="stdcall"] extern {}
+   |   ^^^^^^^^
+   |
+   = note: for more information, see https://github.com/rust-lang/rust/issues/29642
+   = help: add #![feature(custom_attribute)] to the crate attributes to enable
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/attributes/unknown-attr.rs b/src/test/ui/attributes/unknown-attr.rs
new file mode 100644
index 00000000000..e2a4f3226d5
--- /dev/null
+++ b/src/test/ui/attributes/unknown-attr.rs
@@ -0,0 +1,9 @@
+// Unknown attributes fall back to feature gated custom attributes.
+
+#![feature(custom_inner_attributes)]
+
+#![mutable_doc] //~ ERROR attribute `mutable_doc` is currently unknown
+
+#[dance] mod a {} //~ ERROR attribute `dance` is currently unknown
+
+#[dance] fn main() {} //~ ERROR attribute `dance` is currently unknown
diff --git a/src/test/ui/attributes/unknown-attr.stderr b/src/test/ui/attributes/unknown-attr.stderr
new file mode 100644
index 00000000000..d0ac58108fc
--- /dev/null
+++ b/src/test/ui/attributes/unknown-attr.stderr
@@ -0,0 +1,30 @@
+error[E0658]: The attribute `mutable_doc` is currently unknown to the compiler and may have meaning added to it in the future
+  --> $DIR/unknown-attr.rs:5:4
+   |
+LL | #![mutable_doc]
+   |    ^^^^^^^^^^^
+   |
+   = note: for more information, see https://github.com/rust-lang/rust/issues/29642
+   = help: add #![feature(custom_attribute)] to the crate attributes to enable
+
+error[E0658]: The attribute `dance` is currently unknown to the compiler and may have meaning added to it in the future
+  --> $DIR/unknown-attr.rs:7:3
+   |
+LL | #[dance] mod a {}
+   |   ^^^^^
+   |
+   = note: for more information, see https://github.com/rust-lang/rust/issues/29642
+   = help: add #![feature(custom_attribute)] to the crate attributes to enable
+
+error[E0658]: The attribute `dance` is currently unknown to the compiler and may have meaning added to it in the future
+  --> $DIR/unknown-attr.rs:9:3
+   |
+LL | #[dance] fn main() {}
+   |   ^^^^^
+   |
+   = note: for more information, see https://github.com/rust-lang/rust/issues/29642
+   = help: add #![feature(custom_attribute)] to the crate attributes to enable
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/run-pass/variant-attributes.rs b/src/test/ui/attributes/variant-attributes.rs
index 19de3ff2f63..a910340f4a0 100644
--- a/src/test/run-pass/variant-attributes.rs
+++ b/src/test/ui/attributes/variant-attributes.rs
@@ -1,38 +1,37 @@
-#![allow(unused_attributes)]
-#![allow(non_camel_case_types)]
-#![allow(dead_code)]
+// compile-pass
 // pp-exact - Make sure we actually print the attributes
 // pretty-expanded FIXME #23616
 
-#![feature(custom_attribute)]
+#![allow(non_camel_case_types)]
+#![feature(rustc_attrs)]
 
 enum crew_of_enterprise_d {
 
-    #[captain]
+    #[rustc_dummy]
     jean_luc_picard,
 
-    #[oldcommander]
+    #[rustc_dummy]
     william_t_riker,
 
-    #[chief_medical_officer]
+    #[rustc_dummy]
     beverly_crusher,
 
-    #[ships_councellor]
+    #[rustc_dummy]
     deanna_troi,
 
-    #[lieutenant_oldcommander]
+    #[rustc_dummy]
     data,
 
-    #[chief_of_security]
+    #[rustc_dummy]
     worf,
 
-    #[chief_engineer]
+    #[rustc_dummy]
     geordi_la_forge,
 }
 
 fn boldly_go(_crew_member: crew_of_enterprise_d, _where: String) { }
 
-pub fn main() {
+fn main() {
     boldly_go(crew_of_enterprise_d::worf,
               "where no one has gone before".to_string());
 }
diff --git a/src/test/ui/custom-attribute-multisegment.rs b/src/test/ui/custom-attribute-multisegment.rs
index 95cefe53938..24349213902 100644
--- a/src/test/ui/custom-attribute-multisegment.rs
+++ b/src/test/ui/custom-attribute-multisegment.rs
@@ -1,7 +1,5 @@
 // Unresolved multi-segment attributes are not treated as custom.
 
-#![feature(custom_attribute)]
-
 mod existent {}
 
 #[existent::nonexistent] //~ ERROR failed to resolve: could not find `nonexistent` in `existent`
diff --git a/src/test/ui/custom-attribute-multisegment.stderr b/src/test/ui/custom-attribute-multisegment.stderr
index 9ba9c00e55b..57eca211ed1 100644
--- a/src/test/ui/custom-attribute-multisegment.stderr
+++ b/src/test/ui/custom-attribute-multisegment.stderr
@@ -1,5 +1,5 @@
 error[E0433]: failed to resolve: could not find `nonexistent` in `existent`
-  --> $DIR/custom-attribute-multisegment.rs:7:13
+  --> $DIR/custom-attribute-multisegment.rs:5:13
    |
 LL | #[existent::nonexistent]
    |             ^^^^^^^^^^^ could not find `nonexistent` in `existent`
diff --git a/src/test/ui/expanded-cfg.rs b/src/test/ui/expanded-cfg.rs
index fbae093f2ac..c98fd7ffea8 100644
--- a/src/test/ui/expanded-cfg.rs
+++ b/src/test/ui/expanded-cfg.rs
@@ -1,6 +1,6 @@
 // skip-codegen
 // compile-pass
-#![feature(custom_attribute)]
+
 macro_rules! mac {
     {} => {
         #[cfg(attr)]
diff --git a/src/test/ui/issues/issue-24434.rs b/src/test/ui/issues/issue-24434.rs
index 7b270ceb688..2424a1c92cd 100644
--- a/src/test/ui/issues/issue-24434.rs
+++ b/src/test/ui/issues/issue-24434.rs
@@ -1,8 +1,7 @@
 // compile-pass
-#![allow(unused_attributes)]
 // compile-flags:--cfg set1
 
-#![cfg_attr(set1, feature(custom_attribute))]
+#![cfg_attr(set1, feature(rustc_attrs))]
+#![rustc_dummy]
 
-#![foobar]
 fn main() {}
diff --git a/src/test/ui/lint/lint-obsolete-attr.rs b/src/test/ui/lint/lint-obsolete-attr.rs
deleted file mode 100644
index 149948b5a6d..00000000000
--- a/src/test/ui/lint/lint-obsolete-attr.rs
+++ /dev/null
@@ -1,12 +0,0 @@
-// When denying at the crate level, be sure to not get random warnings from the
-// injected intrinsics by the compiler.
-
-#![deny(unused_attributes)]
-#![allow(dead_code)]
-#![feature(custom_attribute)]
-
-#[ab_isize="stdcall"] extern {} //~ ERROR unused attribute
-
-#[fixed_stack_segment] fn f() {} //~ ERROR unused attribute
-
-fn main() {}
diff --git a/src/test/ui/lint/lint-obsolete-attr.stderr b/src/test/ui/lint/lint-obsolete-attr.stderr
deleted file mode 100644
index c06bd26df2b..00000000000
--- a/src/test/ui/lint/lint-obsolete-attr.stderr
+++ /dev/null
@@ -1,20 +0,0 @@
-error: unused attribute
-  --> $DIR/lint-obsolete-attr.rs:8:1
-   |
-LL | #[ab_isize="stdcall"] extern {}
-   | ^^^^^^^^^^^^^^^^^^^^^
-   |
-note: lint level defined here
-  --> $DIR/lint-obsolete-attr.rs:4:9
-   |
-LL | #![deny(unused_attributes)]
-   |         ^^^^^^^^^^^^^^^^^
-
-error: unused attribute
-  --> $DIR/lint-obsolete-attr.rs:10:1
-   |
-LL | #[fixed_stack_segment] fn f() {}
-   | ^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 2 previous errors
-
diff --git a/src/test/ui/lint/lint-unknown-attr.rs b/src/test/ui/lint/lint-unknown-attr.rs
deleted file mode 100644
index 828b869c12e..00000000000
--- a/src/test/ui/lint/lint-unknown-attr.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-// When denying at the crate level, be sure to not get random warnings from the
-// injected intrinsics by the compiler.
-
-#![feature(custom_attribute)]
-#![deny(unused_attributes)]
-
-#![mutable_doc] //~ ERROR unused attribute
-
-#[dance] mod a {} //~ ERROR unused attribute
-
-#[dance] fn main() {} //~ ERROR unused attribute
diff --git a/src/test/ui/lint/lint-unknown-attr.stderr b/src/test/ui/lint/lint-unknown-attr.stderr
deleted file mode 100644
index 9817760c224..00000000000
--- a/src/test/ui/lint/lint-unknown-attr.stderr
+++ /dev/null
@@ -1,26 +0,0 @@
-error: unused attribute
-  --> $DIR/lint-unknown-attr.rs:9:1
-   |
-LL | #[dance] mod a {}
-   | ^^^^^^^^
-   |
-note: lint level defined here
-  --> $DIR/lint-unknown-attr.rs:5:9
-   |
-LL | #![deny(unused_attributes)]
-   |         ^^^^^^^^^^^^^^^^^
-
-error: unused attribute
-  --> $DIR/lint-unknown-attr.rs:11:1
-   |
-LL | #[dance] fn main() {}
-   | ^^^^^^^^
-
-error: unused attribute
-  --> $DIR/lint-unknown-attr.rs:7:1
-   |
-LL | #![mutable_doc]
-   | ^^^^^^^^^^^^^^^
-
-error: aborting due to 3 previous errors
-
diff --git a/src/test/ui/macros/macro-inner-attributes.rs b/src/test/ui/macros/macro-inner-attributes.rs
index 268ddda1b3c..56a90231566 100644
--- a/src/test/ui/macros/macro-inner-attributes.rs
+++ b/src/test/ui/macros/macro-inner-attributes.rs
@@ -1,4 +1,4 @@
-#![feature(custom_attribute)]
+#![feature(rustc_attrs)]
 
 macro_rules! test { ($nm:ident,
                      #[$a:meta],
@@ -12,7 +12,7 @@ test!(b,
       #[cfg(not(qux))],
       pub fn bar() { });
 
-#[qux]
+#[rustc_dummy]
 fn main() {
     a::bar();
     //~^ ERROR failed to resolve: use of undeclared type or module `a`
diff --git a/src/test/ui/macros/macro-outer-attributes.rs b/src/test/ui/macros/macro-outer-attributes.rs
index aa70060425f..0752f7e3153 100644
--- a/src/test/ui/macros/macro-outer-attributes.rs
+++ b/src/test/ui/macros/macro-outer-attributes.rs
@@ -1,4 +1,4 @@
-#![feature(custom_attribute)]
+#![feature(rustc_attrs)]
 
 macro_rules! test { ($nm:ident,
                      #[$a:meta],
@@ -13,7 +13,7 @@ test!(b,
       pub fn bar() { });
 
 // test1!(#[bar])
-#[qux]
+#[rustc_dummy]
 fn main() {
     a::bar(); //~ ERROR cannot find function `bar` in module `a`
     b::bar();
diff --git a/src/test/ui/malformed/malformed-interpolated.rs b/src/test/ui/malformed/malformed-interpolated.rs
index 7c4ca3c017e..5101b5caeea 100644
--- a/src/test/ui/malformed/malformed-interpolated.rs
+++ b/src/test/ui/malformed/malformed-interpolated.rs
@@ -1,9 +1,9 @@
-#![feature(custom_attribute)]
+#![feature(rustc_attrs)]
 
 macro_rules! check {
     ($expr: expr) => (
-        #[my_attr = $expr] //~ ERROR unexpected token: `-0`
-                           //~| ERROR unexpected token: `0 + 0`
+        #[rustc_dummy = $expr] //~ ERROR unexpected token: `-0`
+                               //~| ERROR unexpected token: `0 + 0`
         use main as _;
     );
 }
diff --git a/src/test/ui/malformed/malformed-interpolated.stderr b/src/test/ui/malformed/malformed-interpolated.stderr
index e805416172b..bcd2ef545d8 100644
--- a/src/test/ui/malformed/malformed-interpolated.stderr
+++ b/src/test/ui/malformed/malformed-interpolated.stderr
@@ -7,19 +7,19 @@ LL | check!(0u8);
    = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.).
 
 error: unexpected token: `-0`
-  --> $DIR/malformed-interpolated.rs:5:21
+  --> $DIR/malformed-interpolated.rs:5:25
    |
-LL |         #[my_attr = $expr]
-   |                     ^^^^^
+LL |         #[rustc_dummy = $expr]
+   |                         ^^^^^
 ...
 LL | check!(-0); // ERROR, see above
    | ----------- in this macro invocation
 
 error: unexpected token: `0 + 0`
-  --> $DIR/malformed-interpolated.rs:5:21
+  --> $DIR/malformed-interpolated.rs:5:25
    |
-LL |         #[my_attr = $expr]
-   |                     ^^^^^
+LL |         #[rustc_dummy = $expr]
+   |                         ^^^^^
 ...
 LL | check!(0 + 0); // ERROR, see above
    | -------------- in this macro invocation
diff --git a/src/test/ui/proc-macro/resolve-error.rs b/src/test/ui/proc-macro/resolve-error.rs
index 82607136f0b..1298c08df84 100644
--- a/src/test/ui/proc-macro/resolve-error.rs
+++ b/src/test/ui/proc-macro/resolve-error.rs
@@ -2,8 +2,6 @@
 // aux-build:derive-clona.rs
 // aux-build:test-macros.rs
 
-#![feature(custom_attribute)]
-
 #[macro_use]
 extern crate derive_foo;
 #[macro_use]
@@ -25,10 +23,12 @@ macro_rules! attr_proc_mac {
 //~^ ERROR cannot find
 struct Foo;
 
-#[attr_proc_macra] // OK, interpreted as a custom attribute
+// Interpreted as a feature gated custom attribute
+#[attr_proc_macra] //~ ERROR attribute `attr_proc_macra` is currently unknown
 struct Bar;
 
-#[FooWithLongNan]  // OK, interpreted as a custom attribute
+// Interpreted as a feature gated custom attribute
+#[FooWithLongNan] //~ ERROR attribute `FooWithLongNan` is currently unknown
 struct Asdf;
 
 #[derive(Dlone)]
diff --git a/src/test/ui/proc-macro/resolve-error.stderr b/src/test/ui/proc-macro/resolve-error.stderr
index 705ef6006a0..f9f116c15dc 100644
--- a/src/test/ui/proc-macro/resolve-error.stderr
+++ b/src/test/ui/proc-macro/resolve-error.stderr
@@ -1,5 +1,23 @@
+error[E0658]: The attribute `attr_proc_macra` is currently unknown to the compiler and may have meaning added to it in the future
+  --> $DIR/resolve-error.rs:27:3
+   |
+LL | #[attr_proc_macra]
+   |   ^^^^^^^^^^^^^^^
+   |
+   = note: for more information, see https://github.com/rust-lang/rust/issues/29642
+   = help: add #![feature(custom_attribute)] to the crate attributes to enable
+
+error[E0658]: The attribute `FooWithLongNan` is currently unknown to the compiler and may have meaning added to it in the future
+  --> $DIR/resolve-error.rs:31:3
+   |
+LL | #[FooWithLongNan]
+   |   ^^^^^^^^^^^^^^
+   |
+   = note: for more information, see https://github.com/rust-lang/rust/issues/29642
+   = help: add #![feature(custom_attribute)] to the crate attributes to enable
+
 error: cannot find derive macro `FooWithLongNan` in this scope
-  --> $DIR/resolve-error.rs:24:10
+  --> $DIR/resolve-error.rs:22:10
    |
 LL | #[derive(FooWithLongNan)]
    |          ^^^^^^^^^^^^^^ help: try: `FooWithLongName`
@@ -46,5 +64,6 @@ error: cannot find macro `bang_proc_macrp!` in this scope
 LL |     bang_proc_macrp!();
    |     ^^^^^^^^^^^^^^^ help: you could try the macro: `bang_proc_macro`
 
-error: aborting due to 8 previous errors
+error: aborting due to 10 previous errors
 
+For more information about this error, try `rustc --explain E0658`.
diff --git a/src/test/ui/stmt_expr_attrs_no_feature.rs b/src/test/ui/stmt_expr_attrs_no_feature.rs
index 8952175e425..674a5ed18ce 100644
--- a/src/test/ui/stmt_expr_attrs_no_feature.rs
+++ b/src/test/ui/stmt_expr_attrs_no_feature.rs
@@ -1,4 +1,4 @@
-#![feature(custom_attribute)]
+#![feature(rustc_attrs)]
 
 macro_rules! stmt_mac {
     () => {
@@ -7,18 +7,19 @@ macro_rules! stmt_mac {
 }
 
 fn main() {
-    #[attr]
+    #[rustc_dummy]
     fn a() {}
 
-    #[attr] //~ ERROR attributes on expressions are experimental
+    // Bug: built-in attrs like `rustc_dummy` are not gated on blocks, but other attrs are.
+    #[rustfmt::skip] //~ ERROR attributes on expressions are experimental
     {
 
     }
 
-    #[attr]
+    #[rustc_dummy]
     5;
 
-    #[attr]
+    #[rustc_dummy]
     stmt_mac!();
 }
 
@@ -26,25 +27,25 @@ fn main() {
 
 #[cfg(unset)]
 fn c() {
-    #[attr]
+    #[rustc_dummy]
     5;
 }
 
 #[cfg(not(unset))]
 fn j() {
-    #[attr]
+    #[rustc_dummy]
     5;
 }
 
 #[cfg_attr(not(unset), cfg(unset))]
 fn d() {
-    #[attr]
+    #[rustc_dummy]
     8;
 }
 
 #[cfg_attr(not(unset), cfg(not(unset)))]
 fn i() {
-    #[attr]
+    #[rustc_dummy]
     8;
 }
 
@@ -53,30 +54,30 @@ fn i() {
 macro_rules! item_mac {
     ($e:ident) => {
         fn $e() {
-            #[attr]
+            #[rustc_dummy]
             42;
 
             #[cfg(unset)]
             fn f() {
-                #[attr]
+                #[rustc_dummy]
                 5;
             }
 
             #[cfg(not(unset))]
             fn k() {
-                #[attr]
+                #[rustc_dummy]
                 5;
             }
 
             #[cfg_attr(not(unset), cfg(unset))]
             fn g() {
-                #[attr]
+                #[rustc_dummy]
                 8;
             }
 
             #[cfg_attr(not(unset), cfg(not(unset)))]
             fn h() {
-                #[attr]
+                #[rustc_dummy]
                 8;
             }
 
@@ -90,51 +91,51 @@ item_mac!(e);
 
 extern {
     #[cfg(unset)]
-    fn x(a: [u8; #[attr] 5]);
-    fn y(a: [u8; #[attr] 5]); //~ ERROR attributes on expressions are experimental
+    fn x(a: [u8; #[rustc_dummy] 5]);
+    fn y(a: [u8; #[rustc_dummy] 5]); //~ ERROR attributes on expressions are experimental
 }
 
 struct Foo;
 impl Foo {
     #[cfg(unset)]
-    const X: u8 = #[attr] 5;
-    const Y: u8 = #[attr] 5; //~ ERROR attributes on expressions are experimental
+    const X: u8 = #[rustc_dummy] 5;
+    const Y: u8 = #[rustc_dummy] 5; //~ ERROR attributes on expressions are experimental
 }
 
 trait Bar {
     #[cfg(unset)]
-    const X: [u8; #[attr] 5];
-    const Y: [u8; #[attr] 5]; //~ ERROR attributes on expressions are experimental
+    const X: [u8; #[rustc_dummy] 5];
+    const Y: [u8; #[rustc_dummy] 5]; //~ ERROR attributes on expressions are experimental
 }
 
 struct Joyce {
     #[cfg(unset)]
-    field: [u8; #[attr] 5],
-    field2: [u8; #[attr] 5] //~ ERROR attributes on expressions are experimental
+    field: [u8; #[rustc_dummy] 5],
+    field2: [u8; #[rustc_dummy] 5] //~ ERROR attributes on expressions are experimental
 }
 
 struct Walky(
-    #[cfg(unset)] [u8; #[attr] 5],
-    [u8; #[attr] 5] //~ ERROR attributes on expressions are experimental
+    #[cfg(unset)] [u8; #[rustc_dummy] 5],
+    [u8; #[rustc_dummy] 5] //~ ERROR attributes on expressions are experimental
 );
 
 enum Mike {
     Happy(
-        #[cfg(unset)] [u8; #[attr] 5],
-        [u8; #[attr] 5] //~ ERROR attributes on expressions are experimental
+        #[cfg(unset)] [u8; #[rustc_dummy] 5],
+        [u8; #[rustc_dummy] 5] //~ ERROR attributes on expressions are experimental
     ),
     Angry {
         #[cfg(unset)]
-        field: [u8; #[attr] 5],
-        field2: [u8; #[attr] 5] //~ ERROR attributes on expressions are experimental
+        field: [u8; #[rustc_dummy] 5],
+        field2: [u8; #[rustc_dummy] 5] //~ ERROR attributes on expressions are experimental
     }
 }
 
 fn pat() {
     match 5 {
         #[cfg(unset)]
-        5 => #[attr] (),
-        6 => #[attr] (), //~ ERROR attributes on expressions are experimental
+        5 => #[rustc_dummy] (),
+        6 => #[rustc_dummy] (), //~ ERROR attributes on expressions are experimental
         _ => (),
     }
 }
diff --git a/src/test/ui/stmt_expr_attrs_no_feature.stderr b/src/test/ui/stmt_expr_attrs_no_feature.stderr
index 1b5e989af7b..01372cc164b 100644
--- a/src/test/ui/stmt_expr_attrs_no_feature.stderr
+++ b/src/test/ui/stmt_expr_attrs_no_feature.stderr
@@ -1,80 +1,80 @@
 error[E0658]: attributes on expressions are experimental
-  --> $DIR/stmt_expr_attrs_no_feature.rs:13:5
+  --> $DIR/stmt_expr_attrs_no_feature.rs:14:5
    |
-LL |     #[attr]
-   |     ^^^^^^^
+LL |     #[rustfmt::skip]
+   |     ^^^^^^^^^^^^^^^^
    |
    = note: for more information, see https://github.com/rust-lang/rust/issues/15701
    = help: add #![feature(stmt_expr_attributes)] to the crate attributes to enable
 
 error[E0658]: attributes on expressions are experimental
-  --> $DIR/stmt_expr_attrs_no_feature.rs:94:18
+  --> $DIR/stmt_expr_attrs_no_feature.rs:95:18
    |
-LL |     fn y(a: [u8; #[attr] 5]);
-   |                  ^^^^^^^
+LL |     fn y(a: [u8; #[rustc_dummy] 5]);
+   |                  ^^^^^^^^^^^^^^
    |
    = note: for more information, see https://github.com/rust-lang/rust/issues/15701
    = help: add #![feature(stmt_expr_attributes)] to the crate attributes to enable
 
 error[E0658]: attributes on expressions are experimental
-  --> $DIR/stmt_expr_attrs_no_feature.rs:101:19
+  --> $DIR/stmt_expr_attrs_no_feature.rs:102:19
    |
-LL |     const Y: u8 = #[attr] 5;
-   |                   ^^^^^^^
+LL |     const Y: u8 = #[rustc_dummy] 5;
+   |                   ^^^^^^^^^^^^^^
    |
    = note: for more information, see https://github.com/rust-lang/rust/issues/15701
    = help: add #![feature(stmt_expr_attributes)] to the crate attributes to enable
 
 error[E0658]: attributes on expressions are experimental
-  --> $DIR/stmt_expr_attrs_no_feature.rs:107:19
+  --> $DIR/stmt_expr_attrs_no_feature.rs:108:19
    |
-LL |     const Y: [u8; #[attr] 5];
-   |                   ^^^^^^^
+LL |     const Y: [u8; #[rustc_dummy] 5];
+   |                   ^^^^^^^^^^^^^^
    |
    = note: for more information, see https://github.com/rust-lang/rust/issues/15701
    = help: add #![feature(stmt_expr_attributes)] to the crate attributes to enable
 
 error[E0658]: attributes on expressions are experimental
-  --> $DIR/stmt_expr_attrs_no_feature.rs:113:18
+  --> $DIR/stmt_expr_attrs_no_feature.rs:114:18
    |
-LL |     field2: [u8; #[attr] 5]
-   |                  ^^^^^^^
+LL |     field2: [u8; #[rustc_dummy] 5]
+   |                  ^^^^^^^^^^^^^^
    |
    = note: for more information, see https://github.com/rust-lang/rust/issues/15701
    = help: add #![feature(stmt_expr_attributes)] to the crate attributes to enable
 
 error[E0658]: attributes on expressions are experimental
-  --> $DIR/stmt_expr_attrs_no_feature.rs:118:10
+  --> $DIR/stmt_expr_attrs_no_feature.rs:119:10
    |
-LL |     [u8; #[attr] 5]
-   |          ^^^^^^^
+LL |     [u8; #[rustc_dummy] 5]
+   |          ^^^^^^^^^^^^^^
    |
    = note: for more information, see https://github.com/rust-lang/rust/issues/15701
    = help: add #![feature(stmt_expr_attributes)] to the crate attributes to enable
 
 error[E0658]: attributes on expressions are experimental
-  --> $DIR/stmt_expr_attrs_no_feature.rs:124:14
+  --> $DIR/stmt_expr_attrs_no_feature.rs:125:14
    |
-LL |         [u8; #[attr] 5]
-   |              ^^^^^^^
+LL |         [u8; #[rustc_dummy] 5]
+   |              ^^^^^^^^^^^^^^
    |
    = note: for more information, see https://github.com/rust-lang/rust/issues/15701
    = help: add #![feature(stmt_expr_attributes)] to the crate attributes to enable
 
 error[E0658]: attributes on expressions are experimental
-  --> $DIR/stmt_expr_attrs_no_feature.rs:129:22
+  --> $DIR/stmt_expr_attrs_no_feature.rs:130:22
    |
-LL |         field2: [u8; #[attr] 5]
-   |                      ^^^^^^^
+LL |         field2: [u8; #[rustc_dummy] 5]
+   |                      ^^^^^^^^^^^^^^
    |
    = note: for more information, see https://github.com/rust-lang/rust/issues/15701
    = help: add #![feature(stmt_expr_attributes)] to the crate attributes to enable
 
 error[E0658]: attributes on expressions are experimental
-  --> $DIR/stmt_expr_attrs_no_feature.rs:137:14
+  --> $DIR/stmt_expr_attrs_no_feature.rs:138:14
    |
-LL |         6 => #[attr] (),
-   |              ^^^^^^^
+LL |         6 => #[rustc_dummy] (),
+   |              ^^^^^^^^^^^^^^
    |
    = note: for more information, see https://github.com/rust-lang/rust/issues/15701
    = help: add #![feature(stmt_expr_attributes)] to the crate attributes to enable
diff --git a/src/test/ui/suffixed-literal-meta.rs b/src/test/ui/suffixed-literal-meta.rs
index bd2d6623d91..a6531490c01 100644
--- a/src/test/ui/suffixed-literal-meta.rs
+++ b/src/test/ui/suffixed-literal-meta.rs
@@ -1,15 +1,15 @@
-#![feature(custom_attribute)]
+#![feature(rustc_attrs)]
 
-#[my_attr = 1usize] //~ ERROR: suffixed literals are not allowed in attributes
-#[my_attr = 1u8] //~ ERROR: suffixed literals are not allowed in attributes
-#[my_attr = 1u16] //~ ERROR: suffixed literals are not allowed in attributes
-#[my_attr = 1u32] //~ ERROR: suffixed literals are not allowed in attributes
-#[my_attr = 1u64] //~ ERROR: suffixed literals are not allowed in attributes
-#[my_attr = 1isize] //~ ERROR: suffixed literals are not allowed in attributes
-#[my_attr = 1i8] //~ ERROR: suffixed literals are not allowed in attributes
-#[my_attr = 1i16] //~ ERROR: suffixed literals are not allowed in attributes
-#[my_attr = 1i32] //~ ERROR: suffixed literals are not allowed in attributes
-#[my_attr = 1i64] //~ ERROR: suffixed literals are not allowed in attributes
-#[my_attr = 1.0f32] //~ ERROR: suffixed literals are not allowed in attributes
-#[my_attr = 1.0f64] //~ ERROR: suffixed literals are not allowed in attributes
-fn main() { }
+#[rustc_dummy = 1usize] //~ ERROR: suffixed literals are not allowed in attributes
+#[rustc_dummy = 1u8] //~ ERROR: suffixed literals are not allowed in attributes
+#[rustc_dummy = 1u16] //~ ERROR: suffixed literals are not allowed in attributes
+#[rustc_dummy = 1u32] //~ ERROR: suffixed literals are not allowed in attributes
+#[rustc_dummy = 1u64] //~ ERROR: suffixed literals are not allowed in attributes
+#[rustc_dummy = 1isize] //~ ERROR: suffixed literals are not allowed in attributes
+#[rustc_dummy = 1i8] //~ ERROR: suffixed literals are not allowed in attributes
+#[rustc_dummy = 1i16] //~ ERROR: suffixed literals are not allowed in attributes
+#[rustc_dummy = 1i32] //~ ERROR: suffixed literals are not allowed in attributes
+#[rustc_dummy = 1i64] //~ ERROR: suffixed literals are not allowed in attributes
+#[rustc_dummy = 1.0f32] //~ ERROR: suffixed literals are not allowed in attributes
+#[rustc_dummy = 1.0f64] //~ ERROR: suffixed literals are not allowed in attributes
+fn main() {}
diff --git a/src/test/ui/suffixed-literal-meta.stderr b/src/test/ui/suffixed-literal-meta.stderr
index 495404af3e8..83de173b1a7 100644
--- a/src/test/ui/suffixed-literal-meta.stderr
+++ b/src/test/ui/suffixed-literal-meta.stderr
@@ -1,96 +1,96 @@
 error: suffixed literals are not allowed in attributes
-  --> $DIR/suffixed-literal-meta.rs:3:13
+  --> $DIR/suffixed-literal-meta.rs:3:17
    |
-LL | #[my_attr = 1usize]
-   |             ^^^^^^
+LL | #[rustc_dummy = 1usize]
+   |                 ^^^^^^
    |
    = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.).
 
 error: suffixed literals are not allowed in attributes
-  --> $DIR/suffixed-literal-meta.rs:4:13
+  --> $DIR/suffixed-literal-meta.rs:4:17
    |
-LL | #[my_attr = 1u8]
-   |             ^^^
+LL | #[rustc_dummy = 1u8]
+   |                 ^^^
    |
    = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.).
 
 error: suffixed literals are not allowed in attributes
-  --> $DIR/suffixed-literal-meta.rs:5:13
+  --> $DIR/suffixed-literal-meta.rs:5:17
    |
-LL | #[my_attr = 1u16]
-   |             ^^^^
+LL | #[rustc_dummy = 1u16]
+   |                 ^^^^
    |
    = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.).
 
 error: suffixed literals are not allowed in attributes
-  --> $DIR/suffixed-literal-meta.rs:6:13
+  --> $DIR/suffixed-literal-meta.rs:6:17
    |
-LL | #[my_attr = 1u32]
-   |             ^^^^
+LL | #[rustc_dummy = 1u32]
+   |                 ^^^^
    |
    = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.).
 
 error: suffixed literals are not allowed in attributes
-  --> $DIR/suffixed-literal-meta.rs:7:13
+  --> $DIR/suffixed-literal-meta.rs:7:17
    |
-LL | #[my_attr = 1u64]
-   |             ^^^^
+LL | #[rustc_dummy = 1u64]
+   |                 ^^^^
    |
    = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.).
 
 error: suffixed literals are not allowed in attributes
-  --> $DIR/suffixed-literal-meta.rs:8:13
+  --> $DIR/suffixed-literal-meta.rs:8:17
    |
-LL | #[my_attr = 1isize]
-   |             ^^^^^^
+LL | #[rustc_dummy = 1isize]
+   |                 ^^^^^^
    |
    = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.).
 
 error: suffixed literals are not allowed in attributes
-  --> $DIR/suffixed-literal-meta.rs:9:13
+  --> $DIR/suffixed-literal-meta.rs:9:17
    |
-LL | #[my_attr = 1i8]
-   |             ^^^
+LL | #[rustc_dummy = 1i8]
+   |                 ^^^
    |
    = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.).
 
 error: suffixed literals are not allowed in attributes
-  --> $DIR/suffixed-literal-meta.rs:10:13
+  --> $DIR/suffixed-literal-meta.rs:10:17
    |
-LL | #[my_attr = 1i16]
-   |             ^^^^
+LL | #[rustc_dummy = 1i16]
+   |                 ^^^^
    |
    = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.).
 
 error: suffixed literals are not allowed in attributes
-  --> $DIR/suffixed-literal-meta.rs:11:13
+  --> $DIR/suffixed-literal-meta.rs:11:17
    |
-LL | #[my_attr = 1i32]
-   |             ^^^^
+LL | #[rustc_dummy = 1i32]
+   |                 ^^^^
    |
    = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.).
 
 error: suffixed literals are not allowed in attributes
-  --> $DIR/suffixed-literal-meta.rs:12:13
+  --> $DIR/suffixed-literal-meta.rs:12:17
    |
-LL | #[my_attr = 1i64]
-   |             ^^^^
+LL | #[rustc_dummy = 1i64]
+   |                 ^^^^
    |
    = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.).
 
 error: suffixed literals are not allowed in attributes
-  --> $DIR/suffixed-literal-meta.rs:13:13
+  --> $DIR/suffixed-literal-meta.rs:13:17
    |
-LL | #[my_attr = 1.0f32]
-   |             ^^^^^^
+LL | #[rustc_dummy = 1.0f32]
+   |                 ^^^^^^
    |
    = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.).
 
 error: suffixed literals are not allowed in attributes
-  --> $DIR/suffixed-literal-meta.rs:14:13
+  --> $DIR/suffixed-literal-meta.rs:14:17
    |
-LL | #[my_attr = 1.0f64]
-   |             ^^^^^^
+LL | #[rustc_dummy = 1.0f64]
+   |                 ^^^^^^
    |
    = help: instead of using a suffixed literal (1u8, 1.0f32, etc.), use an unsuffixed version (1, 1.0, etc.).
 
diff --git a/src/test/ui/tool-attributes/tool-attributes-misplaced-1.rs b/src/test/ui/tool-attributes/tool-attributes-misplaced-1.rs
index 33cffcefd89..ce902b7e7d2 100644
--- a/src/test/ui/tool-attributes/tool-attributes-misplaced-1.rs
+++ b/src/test/ui/tool-attributes/tool-attributes-misplaced-1.rs
@@ -1,12 +1,11 @@
-#![feature(custom_attribute)]
-
 type A = rustfmt; //~ ERROR expected type, found tool module `rustfmt`
 type B = rustfmt::skip; //~ ERROR expected type, found tool attribute `rustfmt::skip`
 
 #[derive(rustfmt)] //~ ERROR cannot find derive macro `rustfmt` in this scope
 struct S;
 
-#[rustfmt] // OK, interpreted as a custom attribute
+// Interpreted as a feature gated custom attribute
+#[rustfmt] //~ ERROR attribute `rustfmt` is currently unknown
 fn check() {}
 
 #[rustfmt::skip] // OK
diff --git a/src/test/ui/tool-attributes/tool-attributes-misplaced-1.stderr b/src/test/ui/tool-attributes/tool-attributes-misplaced-1.stderr
index 1c799b41c5a..1df9821f244 100644
--- a/src/test/ui/tool-attributes/tool-attributes-misplaced-1.stderr
+++ b/src/test/ui/tool-attributes/tool-attributes-misplaced-1.stderr
@@ -1,39 +1,49 @@
+error[E0658]: The attribute `rustfmt` is currently unknown to the compiler and may have meaning added to it in the future
+  --> $DIR/tool-attributes-misplaced-1.rs:8:3
+   |
+LL | #[rustfmt]
+   |   ^^^^^^^
+   |
+   = note: for more information, see https://github.com/rust-lang/rust/issues/29642
+   = help: add #![feature(custom_attribute)] to the crate attributes to enable
+
 error: cannot find derive macro `rustfmt` in this scope
-  --> $DIR/tool-attributes-misplaced-1.rs:6:10
+  --> $DIR/tool-attributes-misplaced-1.rs:4:10
    |
 LL | #[derive(rustfmt)]
    |          ^^^^^^^
 
 error: cannot find macro `rustfmt!` in this scope
-  --> $DIR/tool-attributes-misplaced-1.rs:15:5
+  --> $DIR/tool-attributes-misplaced-1.rs:14:5
    |
 LL |     rustfmt!();
    |     ^^^^^^^
 
 error[E0573]: expected type, found tool module `rustfmt`
-  --> $DIR/tool-attributes-misplaced-1.rs:3:10
+  --> $DIR/tool-attributes-misplaced-1.rs:1:10
    |
 LL | type A = rustfmt;
    |          ^^^^^^^ not a type
 
 error[E0573]: expected type, found tool attribute `rustfmt::skip`
-  --> $DIR/tool-attributes-misplaced-1.rs:4:10
+  --> $DIR/tool-attributes-misplaced-1.rs:2:10
    |
 LL | type B = rustfmt::skip;
    |          ^^^^^^^^^^^^^ not a type
 
 error[E0423]: expected value, found tool module `rustfmt`
-  --> $DIR/tool-attributes-misplaced-1.rs:14:5
+  --> $DIR/tool-attributes-misplaced-1.rs:13:5
    |
 LL |     rustfmt;
    |     ^^^^^^^ not a value
 
 error[E0423]: expected value, found tool attribute `rustfmt::skip`
-  --> $DIR/tool-attributes-misplaced-1.rs:17:5
+  --> $DIR/tool-attributes-misplaced-1.rs:16:5
    |
 LL |     rustfmt::skip;
    |     ^^^^^^^^^^^^^ not a value
 
-error: aborting due to 6 previous errors
+error: aborting due to 7 previous errors
 
-For more information about this error, try `rustc --explain E0423`.
+Some errors have detailed explanations: E0423, E0658.
+For more information about an error, try `rustc --explain E0423`.
diff --git a/src/test/ui/unrestricted-attribute-tokens.rs b/src/test/ui/unrestricted-attribute-tokens.rs
index 4798f7b396c..b07ab96bce1 100644
--- a/src/test/ui/unrestricted-attribute-tokens.rs
+++ b/src/test/ui/unrestricted-attribute-tokens.rs
@@ -1,8 +1,8 @@
 // compile-pass
 
-#![feature(custom_attribute)]
+#![feature(rustc_attrs)]
 
-#[my_attr(a b c d)]
-#[my_attr[a b c d]]
-#[my_attr{a b c d}]
+#[rustc_dummy(a b c d)]
+#[rustc_dummy[a b c d]]
+#[rustc_dummy{a b c d}]
 fn main() {}
diff --git a/src/test/ui/unused/unused-attr.rs b/src/test/ui/unused/unused-attr.rs
index 810732a9775..cb8ac0e6a05 100644
--- a/src/test/ui/unused/unused-attr.rs
+++ b/src/test/ui/unused/unused-attr.rs
@@ -1,49 +1,48 @@
 #![deny(unused_attributes)]
-#![allow(dead_code, unused_imports, unused_extern_crates)]
-#![feature(custom_attribute)]
+#![feature(rustc_attrs)]
 
-#![foo] //~ ERROR unused attribute
+#![rustc_dummy] //~ ERROR unused attribute
 
-#[foo] //~ ERROR unused attribute
+#[rustc_dummy] //~ ERROR unused attribute
 extern crate core;
 
-#[foo] //~ ERROR unused attribute
+#[rustc_dummy] //~ ERROR unused attribute
 use std::collections;
 
-#[foo] //~ ERROR unused attribute
+#[rustc_dummy] //~ ERROR unused attribute
 extern "C" {
-    #[foo] //~ ERROR unused attribute
+    #[rustc_dummy] //~ ERROR unused attribute
     fn foo();
 }
 
-#[foo] //~ ERROR unused attribute
+#[rustc_dummy] //~ ERROR unused attribute
 mod foo {
-    #[foo] //~ ERROR unused attribute
+    #[rustc_dummy] //~ ERROR unused attribute
     pub enum Foo {
-        #[foo] //~ ERROR unused attribute
+        #[rustc_dummy] //~ ERROR unused attribute
         Bar,
     }
 }
 
-#[foo] //~ ERROR unused attribute
+#[rustc_dummy] //~ ERROR unused attribute
 fn bar(f: foo::Foo) {
     match f {
-        #[foo] //~ ERROR unused attribute
+        #[rustc_dummy] //~ ERROR unused attribute
         foo::Foo::Bar => {}
     }
 }
 
-#[foo] //~ ERROR unused attribute
+#[rustc_dummy] //~ ERROR unused attribute
 struct Foo {
-    #[foo] //~ ERROR unused attribute
+    #[rustc_dummy] //~ ERROR unused attribute
     a: isize
 }
 
-#[foo] //~ ERROR unused attribute
+#[rustc_dummy] //~ ERROR unused attribute
 trait Baz {
-    #[foo] //~ ERROR unused attribute
+    #[rustc_dummy] //~ ERROR unused attribute
     fn blah(&self);
-    #[foo] //~ ERROR unused attribute
+    #[rustc_dummy] //~ ERROR unused attribute
     fn blah2(&self) {}
 }
 
diff --git a/src/test/ui/unused/unused-attr.stderr b/src/test/ui/unused/unused-attr.stderr
index 6f096d74144..956b870715e 100644
--- a/src/test/ui/unused/unused-attr.stderr
+++ b/src/test/ui/unused/unused-attr.stderr
@@ -1,8 +1,8 @@
 error: unused attribute
-  --> $DIR/unused-attr.rs:7:1
+  --> $DIR/unused-attr.rs:6:1
    |
-LL | #[foo]
-   | ^^^^^^
+LL | #[rustc_dummy]
+   | ^^^^^^^^^^^^^^
    |
 note: lint level defined here
   --> $DIR/unused-attr.rs:1:9
@@ -11,88 +11,88 @@ LL | #![deny(unused_attributes)]
    |         ^^^^^^^^^^^^^^^^^
 
 error: unused attribute
-  --> $DIR/unused-attr.rs:10:1
+  --> $DIR/unused-attr.rs:9:1
    |
-LL | #[foo]
-   | ^^^^^^
+LL | #[rustc_dummy]
+   | ^^^^^^^^^^^^^^
 
 error: unused attribute
-  --> $DIR/unused-attr.rs:15:5
+  --> $DIR/unused-attr.rs:14:5
    |
-LL |     #[foo]
-   |     ^^^^^^
+LL |     #[rustc_dummy]
+   |     ^^^^^^^^^^^^^^
 
 error: unused attribute
-  --> $DIR/unused-attr.rs:13:1
+  --> $DIR/unused-attr.rs:12:1
    |
-LL | #[foo]
-   | ^^^^^^
+LL | #[rustc_dummy]
+   | ^^^^^^^^^^^^^^
 
 error: unused attribute
-  --> $DIR/unused-attr.rs:23:9
+  --> $DIR/unused-attr.rs:22:9
    |
-LL |         #[foo]
-   |         ^^^^^^
+LL |         #[rustc_dummy]
+   |         ^^^^^^^^^^^^^^
 
 error: unused attribute
-  --> $DIR/unused-attr.rs:21:5
+  --> $DIR/unused-attr.rs:20:5
    |
-LL |     #[foo]
-   |     ^^^^^^
+LL |     #[rustc_dummy]
+   |     ^^^^^^^^^^^^^^
 
 error: unused attribute
-  --> $DIR/unused-attr.rs:19:1
+  --> $DIR/unused-attr.rs:18:1
    |
-LL | #[foo]
-   | ^^^^^^
+LL | #[rustc_dummy]
+   | ^^^^^^^^^^^^^^
 
 error: unused attribute
-  --> $DIR/unused-attr.rs:31:9
+  --> $DIR/unused-attr.rs:30:9
    |
-LL |         #[foo]
-   |         ^^^^^^
+LL |         #[rustc_dummy]
+   |         ^^^^^^^^^^^^^^
 
 error: unused attribute
-  --> $DIR/unused-attr.rs:28:1
+  --> $DIR/unused-attr.rs:27:1
    |
-LL | #[foo]
-   | ^^^^^^
+LL | #[rustc_dummy]
+   | ^^^^^^^^^^^^^^
 
 error: unused attribute
-  --> $DIR/unused-attr.rs:38:5
+  --> $DIR/unused-attr.rs:37:5
    |
-LL |     #[foo]
-   |     ^^^^^^
+LL |     #[rustc_dummy]
+   |     ^^^^^^^^^^^^^^
 
 error: unused attribute
-  --> $DIR/unused-attr.rs:36:1
+  --> $DIR/unused-attr.rs:35:1
    |
-LL | #[foo]
-   | ^^^^^^
+LL | #[rustc_dummy]
+   | ^^^^^^^^^^^^^^
 
 error: unused attribute
-  --> $DIR/unused-attr.rs:44:5
+  --> $DIR/unused-attr.rs:43:5
    |
-LL |     #[foo]
-   |     ^^^^^^
+LL |     #[rustc_dummy]
+   |     ^^^^^^^^^^^^^^
 
 error: unused attribute
-  --> $DIR/unused-attr.rs:46:5
+  --> $DIR/unused-attr.rs:45:5
    |
-LL |     #[foo]
-   |     ^^^^^^
+LL |     #[rustc_dummy]
+   |     ^^^^^^^^^^^^^^
 
 error: unused attribute
-  --> $DIR/unused-attr.rs:42:1
+  --> $DIR/unused-attr.rs:41:1
    |
-LL | #[foo]
-   | ^^^^^^
+LL | #[rustc_dummy]
+   | ^^^^^^^^^^^^^^
 
 error: unused attribute
-  --> $DIR/unused-attr.rs:5:1
+  --> $DIR/unused-attr.rs:4:1
    |
-LL | #![foo]
-   | ^^^^^^^
+LL | #![rustc_dummy]
+   | ^^^^^^^^^^^^^^^
 
 error: aborting due to 15 previous errors