diff --git a/src/libcore/macros.rs b/src/libcore/macros.rs index 589061b2826..f9be8008982 100644 --- a/src/libcore/macros.rs +++ b/src/libcore/macros.rs @@ -653,7 +653,7 @@ mod builtin { /// /// [`std::compile_error!`]: ../std/macro.compile_error.html #[stable(feature = "compile_error_macro", since = "1.20.0")] - #[rustc_doc_only_macro] + #[rustc_builtin_macro] macro_rules! compile_error { ($msg:expr) => ({ /* compiler built-in */ }); ($msg:expr,) => ({ /* compiler built-in */ }); @@ -665,7 +665,7 @@ mod builtin { /// /// [`std::format_args!`]: ../std/macro.format_args.html #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_doc_only_macro] + #[rustc_builtin_macro] macro_rules! format_args { ($fmt:expr) => ({ /* compiler built-in */ }); ($fmt:expr, $($args:tt)*) => ({ /* compiler built-in */ }); @@ -677,7 +677,7 @@ mod builtin { /// /// [`std::env!`]: ../std/macro.env.html #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_doc_only_macro] + #[rustc_builtin_macro] macro_rules! env { ($name:expr) => ({ /* compiler built-in */ }); ($name:expr,) => ({ /* compiler built-in */ }); @@ -689,7 +689,7 @@ mod builtin { /// /// [`std::option_env!`]: ../std/macro.option_env.html #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_doc_only_macro] + #[rustc_builtin_macro] macro_rules! option_env { ($name:expr) => ({ /* compiler built-in */ }); ($name:expr,) => ({ /* compiler built-in */ }); @@ -701,7 +701,7 @@ mod builtin { /// /// [`std::concat_idents!`]: ../std/macro.concat_idents.html #[unstable(feature = "concat_idents_macro", issue = "29599")] - #[rustc_doc_only_macro] + #[rustc_builtin_macro] macro_rules! concat_idents { ($($e:ident),+) => ({ /* compiler built-in */ }); ($($e:ident,)+) => ({ /* compiler built-in */ }); @@ -713,7 +713,7 @@ mod builtin { /// /// [`std::concat!`]: ../std/macro.concat.html #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_doc_only_macro] + #[rustc_builtin_macro] macro_rules! concat { ($($e:expr),*) => ({ /* compiler built-in */ }); ($($e:expr,)*) => ({ /* compiler built-in */ }); @@ -725,7 +725,7 @@ mod builtin { /// /// [`std::line!`]: ../std/macro.line.html #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_doc_only_macro] + #[rustc_builtin_macro] macro_rules! line { () => ({ /* compiler built-in */ }) } /// Expands to the column number on which it was invoked. @@ -734,7 +734,7 @@ mod builtin { /// /// [`std::column!`]: ../std/macro.column.html #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_doc_only_macro] + #[rustc_builtin_macro] macro_rules! column { () => ({ /* compiler built-in */ }) } /// Expands to the file name from which it was invoked. @@ -743,7 +743,7 @@ mod builtin { /// /// [`std::file!`]: ../std/macro.file.html #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_doc_only_macro] + #[rustc_builtin_macro] macro_rules! file { () => ({ /* compiler built-in */ }) } /// Stringifies its arguments. @@ -752,7 +752,7 @@ mod builtin { /// /// [`std::stringify!`]: ../std/macro.stringify.html #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_doc_only_macro] + #[rustc_builtin_macro] macro_rules! stringify { ($($t:tt)*) => ({ /* compiler built-in */ }) } /// Includes a utf8-encoded file as a string. @@ -761,7 +761,7 @@ mod builtin { /// /// [`std::include_str!`]: ../std/macro.include_str.html #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_doc_only_macro] + #[rustc_builtin_macro] macro_rules! include_str { ($file:expr) => ({ /* compiler built-in */ }); ($file:expr,) => ({ /* compiler built-in */ }); @@ -773,7 +773,7 @@ mod builtin { /// /// [`std::include_bytes!`]: ../std/macro.include_bytes.html #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_doc_only_macro] + #[rustc_builtin_macro] macro_rules! include_bytes { ($file:expr) => ({ /* compiler built-in */ }); ($file:expr,) => ({ /* compiler built-in */ }); @@ -785,7 +785,7 @@ mod builtin { /// /// [`std::module_path!`]: ../std/macro.module_path.html #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_doc_only_macro] + #[rustc_builtin_macro] macro_rules! module_path { () => ({ /* compiler built-in */ }) } /// Evaluates boolean combinations of configuration flags, at compile-time. @@ -794,7 +794,7 @@ mod builtin { /// /// [`std::cfg!`]: ../std/macro.cfg.html #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_doc_only_macro] + #[rustc_builtin_macro] macro_rules! cfg { ($($cfg:tt)*) => ({ /* compiler built-in */ }) } /// Parses a file as an expression or an item according to the context. @@ -803,7 +803,7 @@ mod builtin { /// /// [`std::include!`]: ../std/macro.include.html #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_doc_only_macro] + #[rustc_builtin_macro] macro_rules! include { ($file:expr) => ({ /* compiler built-in */ }); ($file:expr,) => ({ /* compiler built-in */ }); @@ -814,7 +814,7 @@ mod builtin { /// For more information, see the documentation for [`std::assert!`]. /// /// [`std::assert!`]: ../std/macro.assert.html - #[rustc_doc_only_macro] + #[rustc_builtin_macro] #[stable(feature = "rust1", since = "1.0.0")] macro_rules! assert { ($cond:expr) => ({ /* compiler built-in */ }); diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs index 3c967fa6d83..271fac544a4 100644 --- a/src/librustc/hir/lowering.rs +++ b/src/librustc/hir/lowering.rs @@ -4010,7 +4010,7 @@ impl<'a> LoweringContext<'a> { let attrs = self.lower_attrs(&i.attrs); if let ItemKind::MacroDef(ref def) = i.node { if !def.legacy || attr::contains_name(&i.attrs, sym::macro_export) || - attr::contains_name(&i.attrs, sym::rustc_doc_only_macro) { + attr::contains_name(&i.attrs, sym::rustc_builtin_macro) { let body = self.lower_token_stream(def.stream()); let hir_id = self.lower_node_id(i.id); self.exported_macros.push(hir::MacroDef { diff --git a/src/librustc_resolve/macros.rs b/src/librustc_resolve/macros.rs index dd0beee2104..6a8c46eaa40 100644 --- a/src/librustc_resolve/macros.rs +++ b/src/librustc_resolve/macros.rs @@ -1142,7 +1142,7 @@ impl<'a> Resolver<'a> { self.define(module, ident, MacroNS, (res, vis, item.span, expansion, IsMacroExport)); } else { - if !attr::contains_name(&item.attrs, sym::rustc_doc_only_macro) { + if !attr::contains_name(&item.attrs, sym::rustc_builtin_macro) { self.check_reserved_macro_name(ident, MacroNS); } self.unused_macros.insert(def_id); diff --git a/src/libstd/macros.rs b/src/libstd/macros.rs index d695141bef0..b3e09d69742 100644 --- a/src/libstd/macros.rs +++ b/src/libstd/macros.rs @@ -410,7 +410,7 @@ mod builtin { /// /// [`panic!`]: ../std/macro.panic.html #[stable(feature = "compile_error_macro", since = "1.20.0")] - #[rustc_doc_only_macro] + #[rustc_builtin_macro] macro_rules! compile_error { ($msg:expr) => ({ /* compiler built-in */ }); ($msg:expr,) => ({ /* compiler built-in */ }); @@ -462,7 +462,7 @@ mod builtin { /// assert_eq!(s, format!("hello {}", "world")); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_doc_only_macro] + #[rustc_builtin_macro] macro_rules! format_args { ($fmt:expr) => ({ /* compiler built-in */ }); ($fmt:expr, $($args:tt)*) => ({ /* compiler built-in */ }); @@ -500,7 +500,7 @@ mod builtin { /// error: what's that?! /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_doc_only_macro] + #[rustc_builtin_macro] macro_rules! env { ($name:expr) => ({ /* compiler built-in */ }); ($name:expr,) => ({ /* compiler built-in */ }); @@ -526,7 +526,7 @@ mod builtin { /// println!("the secret key might be: {:?}", key); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_doc_only_macro] + #[rustc_builtin_macro] macro_rules! option_env { ($name:expr) => ({ /* compiler built-in */ }); ($name:expr,) => ({ /* compiler built-in */ }); @@ -557,7 +557,7 @@ mod builtin { /// # } /// ``` #[unstable(feature = "concat_idents_macro", issue = "29599")] - #[rustc_doc_only_macro] + #[rustc_builtin_macro] macro_rules! concat_idents { ($($e:ident),+) => ({ /* compiler built-in */ }); ($($e:ident,)+) => ({ /* compiler built-in */ }); @@ -579,7 +579,7 @@ mod builtin { /// assert_eq!(s, "test10btrue"); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_doc_only_macro] + #[rustc_builtin_macro] macro_rules! concat { ($($e:expr),*) => ({ /* compiler built-in */ }); ($($e:expr,)*) => ({ /* compiler built-in */ }); @@ -607,7 +607,7 @@ mod builtin { /// println!("defined on line: {}", current_line); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_doc_only_macro] + #[rustc_builtin_macro] macro_rules! line { () => ({ /* compiler built-in */ }) } /// Expands to the column number at which it was invoked. @@ -632,7 +632,7 @@ mod builtin { /// println!("defined on column: {}", current_col); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_doc_only_macro] + #[rustc_builtin_macro] macro_rules! column { () => ({ /* compiler built-in */ }) } /// Expands to the file name in which it was invoked. @@ -656,7 +656,7 @@ mod builtin { /// println!("defined in file: {}", this_file); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_doc_only_macro] + #[rustc_builtin_macro] macro_rules! file { () => ({ /* compiler built-in */ }) } /// Stringifies its arguments. @@ -675,7 +675,7 @@ mod builtin { /// assert_eq!(one_plus_one, "1 + 1"); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_doc_only_macro] + #[rustc_builtin_macro] macro_rules! stringify { ($($t:tt)*) => ({ /* compiler built-in */ }) } /// Includes a utf8-encoded file as a string. @@ -709,7 +709,7 @@ mod builtin { /// /// Compiling 'main.rs' and running the resulting binary will print "adiรณs". #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_doc_only_macro] + #[rustc_builtin_macro] macro_rules! include_str { ($file:expr) => ({ /* compiler built-in */ }); ($file:expr,) => ({ /* compiler built-in */ }); @@ -746,7 +746,7 @@ mod builtin { /// /// Compiling 'main.rs' and running the resulting binary will print "adiรณs". #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_doc_only_macro] + #[rustc_builtin_macro] macro_rules! include_bytes { ($file:expr) => ({ /* compiler built-in */ }); ($file:expr,) => ({ /* compiler built-in */ }); @@ -770,7 +770,7 @@ mod builtin { /// test::foo(); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_doc_only_macro] + #[rustc_builtin_macro] macro_rules! module_path { () => ({ /* compiler built-in */ }) } /// Evaluates boolean combinations of configuration flags at compile-time. @@ -794,7 +794,7 @@ mod builtin { /// }; /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_doc_only_macro] + #[rustc_builtin_macro] macro_rules! cfg { ($($cfg:tt)*) => ({ /* compiler built-in */ }) } /// Parses a file as an expression or an item according to the context. @@ -837,7 +837,7 @@ mod builtin { /// Compiling 'main.rs' and running the resulting binary will print /// "๐Ÿ™ˆ๐Ÿ™Š๐Ÿ™‰๐Ÿ™ˆ๐Ÿ™Š๐Ÿ™‰". #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_doc_only_macro] + #[rustc_builtin_macro] macro_rules! include { ($file:expr) => ({ /* compiler built-in */ }); ($file:expr,) => ({ /* compiler built-in */ }); @@ -889,7 +889,7 @@ mod builtin { /// assert!(a + b == 30, "a = {}, b = {}", a, b); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_doc_only_macro] + #[rustc_builtin_macro] macro_rules! assert { ($cond:expr) => ({ /* compiler built-in */ }); ($cond:expr,) => ({ /* compiler built-in */ }); diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index e1e39faaad4..6dc46ba2c7e 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -1374,7 +1374,7 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ "internal implementation detail", cfg_fn!(rustc_attrs))), - (sym::rustc_doc_only_macro, Whitelisted, template!(Word), Gated(Stability::Unstable, + (sym::rustc_builtin_macro, Whitelisted, template!(Word), Gated(Stability::Unstable, sym::rustc_attrs, "internal implementation detail", cfg_fn!(rustc_attrs))), diff --git a/src/libsyntax_pos/symbol.rs b/src/libsyntax_pos/symbol.rs index 6a97e5f2127..60622740b74 100644 --- a/src/libsyntax_pos/symbol.rs +++ b/src/libsyntax_pos/symbol.rs @@ -537,6 +537,7 @@ symbols! { rustc_allow_const_fn_ptr, rustc_args_required_const, rustc_attrs, + rustc_builtin_macro, rustc_clean, rustc_const_unstable, rustc_conversion_suggestion, @@ -545,7 +546,6 @@ symbols! { rustc_deprecated, rustc_diagnostic_macros, rustc_dirty, - rustc_doc_only_macro, rustc_dummy, rustc_dump_env_program_clauses, rustc_dump_program_clauses,