mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
Avoid using #[macro_export]
for documenting builtin macros
This commit is contained in:
parent
878dd0b5e1
commit
a18be44d63
@ -543,6 +543,7 @@ macro_rules! unimplemented {
|
|||||||
/// into libsyntax itself.
|
/// into libsyntax itself.
|
||||||
///
|
///
|
||||||
/// For more information, see documentation for `std`'s macros.
|
/// For more information, see documentation for `std`'s macros.
|
||||||
|
#[cfg(dox)]
|
||||||
mod builtin {
|
mod builtin {
|
||||||
|
|
||||||
/// Unconditionally causes compilation to fail with the given error message when encountered.
|
/// Unconditionally causes compilation to fail with the given error message when encountered.
|
||||||
@ -551,8 +552,7 @@ mod builtin {
|
|||||||
///
|
///
|
||||||
/// [`std::compile_error!`]: ../std/macro.compile_error.html
|
/// [`std::compile_error!`]: ../std/macro.compile_error.html
|
||||||
#[stable(feature = "compile_error_macro", since = "1.20.0")]
|
#[stable(feature = "compile_error_macro", since = "1.20.0")]
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
#[cfg(dox)]
|
|
||||||
macro_rules! compile_error {
|
macro_rules! compile_error {
|
||||||
($msg:expr) => ({ /* compiler built-in */ });
|
($msg:expr) => ({ /* compiler built-in */ });
|
||||||
($msg:expr,) => ({ /* compiler built-in */ });
|
($msg:expr,) => ({ /* compiler built-in */ });
|
||||||
@ -564,8 +564,7 @@ mod builtin {
|
|||||||
///
|
///
|
||||||
/// [`std::format_args!`]: ../std/macro.format_args.html
|
/// [`std::format_args!`]: ../std/macro.format_args.html
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
#[cfg(dox)]
|
|
||||||
macro_rules! format_args {
|
macro_rules! format_args {
|
||||||
($fmt:expr) => ({ /* compiler built-in */ });
|
($fmt:expr) => ({ /* compiler built-in */ });
|
||||||
($fmt:expr, $($args:tt)*) => ({ /* compiler built-in */ });
|
($fmt:expr, $($args:tt)*) => ({ /* compiler built-in */ });
|
||||||
@ -577,8 +576,7 @@ mod builtin {
|
|||||||
///
|
///
|
||||||
/// [`std::env!`]: ../std/macro.env.html
|
/// [`std::env!`]: ../std/macro.env.html
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
#[cfg(dox)]
|
|
||||||
macro_rules! env {
|
macro_rules! env {
|
||||||
($name:expr) => ({ /* compiler built-in */ });
|
($name:expr) => ({ /* compiler built-in */ });
|
||||||
($name:expr,) => ({ /* compiler built-in */ });
|
($name:expr,) => ({ /* compiler built-in */ });
|
||||||
@ -590,8 +588,7 @@ mod builtin {
|
|||||||
///
|
///
|
||||||
/// [`std::option_env!`]: ../std/macro.option_env.html
|
/// [`std::option_env!`]: ../std/macro.option_env.html
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
#[cfg(dox)]
|
|
||||||
macro_rules! option_env {
|
macro_rules! option_env {
|
||||||
($name:expr) => ({ /* compiler built-in */ });
|
($name:expr) => ({ /* compiler built-in */ });
|
||||||
($name:expr,) => ({ /* compiler built-in */ });
|
($name:expr,) => ({ /* compiler built-in */ });
|
||||||
@ -603,8 +600,7 @@ mod builtin {
|
|||||||
///
|
///
|
||||||
/// [`std::concat_idents!`]: ../std/macro.concat_idents.html
|
/// [`std::concat_idents!`]: ../std/macro.concat_idents.html
|
||||||
#[unstable(feature = "concat_idents_macro", issue = "29599")]
|
#[unstable(feature = "concat_idents_macro", issue = "29599")]
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
#[cfg(dox)]
|
|
||||||
macro_rules! concat_idents {
|
macro_rules! concat_idents {
|
||||||
($($e:ident),+) => ({ /* compiler built-in */ });
|
($($e:ident),+) => ({ /* compiler built-in */ });
|
||||||
($($e:ident,)+) => ({ /* compiler built-in */ });
|
($($e:ident,)+) => ({ /* compiler built-in */ });
|
||||||
@ -616,8 +612,7 @@ mod builtin {
|
|||||||
///
|
///
|
||||||
/// [`std::concat!`]: ../std/macro.concat.html
|
/// [`std::concat!`]: ../std/macro.concat.html
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
#[cfg(dox)]
|
|
||||||
macro_rules! concat {
|
macro_rules! concat {
|
||||||
($($e:expr),*) => ({ /* compiler built-in */ });
|
($($e:expr),*) => ({ /* compiler built-in */ });
|
||||||
($($e:expr,)*) => ({ /* compiler built-in */ });
|
($($e:expr,)*) => ({ /* compiler built-in */ });
|
||||||
@ -629,8 +624,7 @@ mod builtin {
|
|||||||
///
|
///
|
||||||
/// [`std::line!`]: ../std/macro.line.html
|
/// [`std::line!`]: ../std/macro.line.html
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
#[cfg(dox)]
|
|
||||||
macro_rules! line { () => ({ /* compiler built-in */ }) }
|
macro_rules! line { () => ({ /* compiler built-in */ }) }
|
||||||
|
|
||||||
/// A macro which expands to the column number on which it was invoked.
|
/// A macro which expands to the column number on which it was invoked.
|
||||||
@ -639,8 +633,7 @@ mod builtin {
|
|||||||
///
|
///
|
||||||
/// [`std::column!`]: ../std/macro.column.html
|
/// [`std::column!`]: ../std/macro.column.html
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
#[cfg(dox)]
|
|
||||||
macro_rules! column { () => ({ /* compiler built-in */ }) }
|
macro_rules! column { () => ({ /* compiler built-in */ }) }
|
||||||
|
|
||||||
/// A macro which expands to the file name from which it was invoked.
|
/// A macro which expands to the file name from which it was invoked.
|
||||||
@ -649,8 +642,7 @@ mod builtin {
|
|||||||
///
|
///
|
||||||
/// [`std::file!`]: ../std/macro.file.html
|
/// [`std::file!`]: ../std/macro.file.html
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
#[cfg(dox)]
|
|
||||||
macro_rules! file { () => ({ /* compiler built-in */ }) }
|
macro_rules! file { () => ({ /* compiler built-in */ }) }
|
||||||
|
|
||||||
/// A macro which stringifies its arguments.
|
/// A macro which stringifies its arguments.
|
||||||
@ -659,8 +651,7 @@ mod builtin {
|
|||||||
///
|
///
|
||||||
/// [`std::stringify!`]: ../std/macro.stringify.html
|
/// [`std::stringify!`]: ../std/macro.stringify.html
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
#[cfg(dox)]
|
|
||||||
macro_rules! stringify { ($($t:tt)*) => ({ /* compiler built-in */ }) }
|
macro_rules! stringify { ($($t:tt)*) => ({ /* compiler built-in */ }) }
|
||||||
|
|
||||||
/// Includes a utf8-encoded file as a string.
|
/// Includes a utf8-encoded file as a string.
|
||||||
@ -669,8 +660,7 @@ mod builtin {
|
|||||||
///
|
///
|
||||||
/// [`std::include_str!`]: ../std/macro.include_str.html
|
/// [`std::include_str!`]: ../std/macro.include_str.html
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
#[cfg(dox)]
|
|
||||||
macro_rules! include_str {
|
macro_rules! include_str {
|
||||||
($file:expr) => ({ /* compiler built-in */ });
|
($file:expr) => ({ /* compiler built-in */ });
|
||||||
($file:expr,) => ({ /* compiler built-in */ });
|
($file:expr,) => ({ /* compiler built-in */ });
|
||||||
@ -682,8 +672,7 @@ mod builtin {
|
|||||||
///
|
///
|
||||||
/// [`std::include_bytes!`]: ../std/macro.include_bytes.html
|
/// [`std::include_bytes!`]: ../std/macro.include_bytes.html
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
#[cfg(dox)]
|
|
||||||
macro_rules! include_bytes {
|
macro_rules! include_bytes {
|
||||||
($file:expr) => ({ /* compiler built-in */ });
|
($file:expr) => ({ /* compiler built-in */ });
|
||||||
($file:expr,) => ({ /* compiler built-in */ });
|
($file:expr,) => ({ /* compiler built-in */ });
|
||||||
@ -695,8 +684,7 @@ mod builtin {
|
|||||||
///
|
///
|
||||||
/// [`std::module_path!`]: ../std/macro.module_path.html
|
/// [`std::module_path!`]: ../std/macro.module_path.html
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
#[cfg(dox)]
|
|
||||||
macro_rules! module_path { () => ({ /* compiler built-in */ }) }
|
macro_rules! module_path { () => ({ /* compiler built-in */ }) }
|
||||||
|
|
||||||
/// Boolean evaluation of configuration flags, at compile-time.
|
/// Boolean evaluation of configuration flags, at compile-time.
|
||||||
@ -705,8 +693,7 @@ mod builtin {
|
|||||||
///
|
///
|
||||||
/// [`std::cfg!`]: ../std/macro.cfg.html
|
/// [`std::cfg!`]: ../std/macro.cfg.html
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
#[cfg(dox)]
|
|
||||||
macro_rules! cfg { ($($cfg:tt)*) => ({ /* compiler built-in */ }) }
|
macro_rules! cfg { ($($cfg:tt)*) => ({ /* compiler built-in */ }) }
|
||||||
|
|
||||||
/// Parse a file as an expression or an item according to the context.
|
/// Parse a file as an expression or an item according to the context.
|
||||||
@ -715,8 +702,7 @@ mod builtin {
|
|||||||
///
|
///
|
||||||
/// [`std::include!`]: ../std/macro.include.html
|
/// [`std::include!`]: ../std/macro.include.html
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
#[cfg(dox)]
|
|
||||||
macro_rules! include {
|
macro_rules! include {
|
||||||
($file:expr) => ({ /* compiler built-in */ });
|
($file:expr) => ({ /* compiler built-in */ });
|
||||||
($file:expr,) => ({ /* compiler built-in */ });
|
($file:expr,) => ({ /* compiler built-in */ });
|
||||||
@ -727,9 +713,8 @@ mod builtin {
|
|||||||
/// For more information, see the documentation for [`std::assert!`].
|
/// For more information, see the documentation for [`std::assert!`].
|
||||||
///
|
///
|
||||||
/// [`std::assert!`]: ../std/macro.assert.html
|
/// [`std::assert!`]: ../std/macro.assert.html
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[cfg(dox)]
|
|
||||||
macro_rules! assert {
|
macro_rules! assert {
|
||||||
($cond:expr) => ({ /* compiler built-in */ });
|
($cond:expr) => ({ /* compiler built-in */ });
|
||||||
($cond:expr,) => ({ /* compiler built-in */ });
|
($cond:expr,) => ({ /* compiler built-in */ });
|
||||||
|
@ -3191,7 +3191,8 @@ impl<'a> LoweringContext<'a> {
|
|||||||
let mut vis = self.lower_visibility(&i.vis, None);
|
let mut vis = self.lower_visibility(&i.vis, None);
|
||||||
let attrs = self.lower_attrs(&i.attrs);
|
let attrs = self.lower_attrs(&i.attrs);
|
||||||
if let ItemKind::MacroDef(ref def) = i.node {
|
if let ItemKind::MacroDef(ref def) = i.node {
|
||||||
if !def.legacy || attr::contains_name(&i.attrs, "macro_export") {
|
if !def.legacy || attr::contains_name(&i.attrs, "macro_export") ||
|
||||||
|
attr::contains_name(&i.attrs, "rustc_doc_only_macro") {
|
||||||
let body = self.lower_token_stream(def.stream());
|
let body = self.lower_token_stream(def.stream());
|
||||||
self.exported_macros.push(hir::MacroDef {
|
self.exported_macros.push(hir::MacroDef {
|
||||||
name,
|
name,
|
||||||
|
@ -1253,15 +1253,13 @@ fn macro_resolve(cx: &DocContext, path_str: &str) -> Option<Def> {
|
|||||||
.resolve_macro_to_def_inner(mark, &path, MacroKind::Bang, false);
|
.resolve_macro_to_def_inner(mark, &path, MacroKind::Bang, false);
|
||||||
if let Ok(def) = res {
|
if let Ok(def) = res {
|
||||||
if let SyntaxExtension::DeclMacro { .. } = *resolver.get_macro(def) {
|
if let SyntaxExtension::DeclMacro { .. } = *resolver.get_macro(def) {
|
||||||
Some(def)
|
return Some(def);
|
||||||
} else {
|
|
||||||
None
|
|
||||||
}
|
}
|
||||||
} else if let Some(def) = resolver.all_macros.get(&Symbol::intern(path_str)) {
|
|
||||||
Some(*def)
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
}
|
}
|
||||||
|
if let Some(def) = resolver.all_macros.get(&Symbol::intern(path_str)) {
|
||||||
|
return Some(*def);
|
||||||
|
}
|
||||||
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
@ -303,7 +303,7 @@ macro_rules! assert_approx_eq {
|
|||||||
/// macro, but are documented here. Their implementations can be found hardcoded
|
/// macro, but are documented here. Their implementations can be found hardcoded
|
||||||
/// into libsyntax itself.
|
/// into libsyntax itself.
|
||||||
#[cfg(dox)]
|
#[cfg(dox)]
|
||||||
pub mod builtin {
|
mod builtin {
|
||||||
|
|
||||||
/// Unconditionally causes compilation to fail with the given error message when encountered.
|
/// Unconditionally causes compilation to fail with the given error message when encountered.
|
||||||
///
|
///
|
||||||
@ -341,7 +341,7 @@ pub mod builtin {
|
|||||||
///
|
///
|
||||||
/// [`panic!`]: ../std/macro.panic.html
|
/// [`panic!`]: ../std/macro.panic.html
|
||||||
#[stable(feature = "compile_error_macro", since = "1.20.0")]
|
#[stable(feature = "compile_error_macro", since = "1.20.0")]
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
macro_rules! compile_error {
|
macro_rules! compile_error {
|
||||||
($msg:expr) => ({ /* compiler built-in */ });
|
($msg:expr) => ({ /* compiler built-in */ });
|
||||||
($msg:expr,) => ({ /* compiler built-in */ });
|
($msg:expr,) => ({ /* compiler built-in */ });
|
||||||
@ -393,7 +393,7 @@ pub mod builtin {
|
|||||||
/// assert_eq!(s, format!("hello {}", "world"));
|
/// assert_eq!(s, format!("hello {}", "world"));
|
||||||
/// ```
|
/// ```
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
macro_rules! format_args {
|
macro_rules! format_args {
|
||||||
($fmt:expr) => ({ /* compiler built-in */ });
|
($fmt:expr) => ({ /* compiler built-in */ });
|
||||||
($fmt:expr, $($args:tt)*) => ({ /* compiler built-in */ });
|
($fmt:expr, $($args:tt)*) => ({ /* compiler built-in */ });
|
||||||
@ -431,7 +431,7 @@ pub mod builtin {
|
|||||||
/// error: what's that?!
|
/// error: what's that?!
|
||||||
/// ```
|
/// ```
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
macro_rules! env {
|
macro_rules! env {
|
||||||
($name:expr) => ({ /* compiler built-in */ });
|
($name:expr) => ({ /* compiler built-in */ });
|
||||||
($name:expr,) => ({ /* compiler built-in */ });
|
($name:expr,) => ({ /* compiler built-in */ });
|
||||||
@ -457,7 +457,7 @@ pub mod builtin {
|
|||||||
/// println!("the secret key might be: {:?}", key);
|
/// println!("the secret key might be: {:?}", key);
|
||||||
/// ```
|
/// ```
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
macro_rules! option_env {
|
macro_rules! option_env {
|
||||||
($name:expr) => ({ /* compiler built-in */ });
|
($name:expr) => ({ /* compiler built-in */ });
|
||||||
($name:expr,) => ({ /* compiler built-in */ });
|
($name:expr,) => ({ /* compiler built-in */ });
|
||||||
@ -488,7 +488,7 @@ pub mod builtin {
|
|||||||
/// # }
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
#[unstable(feature = "concat_idents_macro", issue = "29599")]
|
#[unstable(feature = "concat_idents_macro", issue = "29599")]
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
macro_rules! concat_idents {
|
macro_rules! concat_idents {
|
||||||
($($e:ident),+) => ({ /* compiler built-in */ });
|
($($e:ident),+) => ({ /* compiler built-in */ });
|
||||||
($($e:ident,)+) => ({ /* compiler built-in */ });
|
($($e:ident,)+) => ({ /* compiler built-in */ });
|
||||||
@ -510,7 +510,7 @@ pub mod builtin {
|
|||||||
/// assert_eq!(s, "test10btrue");
|
/// assert_eq!(s, "test10btrue");
|
||||||
/// ```
|
/// ```
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
macro_rules! concat {
|
macro_rules! concat {
|
||||||
($($e:expr),*) => ({ /* compiler built-in */ });
|
($($e:expr),*) => ({ /* compiler built-in */ });
|
||||||
($($e:expr,)*) => ({ /* compiler built-in */ });
|
($($e:expr,)*) => ({ /* compiler built-in */ });
|
||||||
@ -538,7 +538,7 @@ pub mod builtin {
|
|||||||
/// println!("defined on line: {}", current_line);
|
/// println!("defined on line: {}", current_line);
|
||||||
/// ```
|
/// ```
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
macro_rules! line { () => ({ /* compiler built-in */ }) }
|
macro_rules! line { () => ({ /* compiler built-in */ }) }
|
||||||
|
|
||||||
/// A macro which expands to the column number on which it was invoked.
|
/// A macro which expands to the column number on which it was invoked.
|
||||||
@ -563,7 +563,7 @@ pub mod builtin {
|
|||||||
/// println!("defined on column: {}", current_col);
|
/// println!("defined on column: {}", current_col);
|
||||||
/// ```
|
/// ```
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
macro_rules! column { () => ({ /* compiler built-in */ }) }
|
macro_rules! column { () => ({ /* compiler built-in */ }) }
|
||||||
|
|
||||||
/// A macro which expands to the file name from which it was invoked.
|
/// A macro which expands to the file name from which it was invoked.
|
||||||
@ -587,7 +587,7 @@ pub mod builtin {
|
|||||||
/// println!("defined in file: {}", this_file);
|
/// println!("defined in file: {}", this_file);
|
||||||
/// ```
|
/// ```
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
macro_rules! file { () => ({ /* compiler built-in */ }) }
|
macro_rules! file { () => ({ /* compiler built-in */ }) }
|
||||||
|
|
||||||
/// A macro which stringifies its arguments.
|
/// A macro which stringifies its arguments.
|
||||||
@ -606,7 +606,7 @@ pub mod builtin {
|
|||||||
/// assert_eq!(one_plus_one, "1 + 1");
|
/// assert_eq!(one_plus_one, "1 + 1");
|
||||||
/// ```
|
/// ```
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
macro_rules! stringify { ($($t:tt)*) => ({ /* compiler built-in */ }) }
|
macro_rules! stringify { ($($t:tt)*) => ({ /* compiler built-in */ }) }
|
||||||
|
|
||||||
/// Includes a utf8-encoded file as a string.
|
/// Includes a utf8-encoded file as a string.
|
||||||
@ -640,7 +640,7 @@ pub mod builtin {
|
|||||||
///
|
///
|
||||||
/// Compiling 'main.rs' and running the resulting binary will print "adiós".
|
/// Compiling 'main.rs' and running the resulting binary will print "adiós".
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
macro_rules! include_str {
|
macro_rules! include_str {
|
||||||
($file:expr) => ({ /* compiler built-in */ });
|
($file:expr) => ({ /* compiler built-in */ });
|
||||||
($file:expr,) => ({ /* compiler built-in */ });
|
($file:expr,) => ({ /* compiler built-in */ });
|
||||||
@ -677,7 +677,7 @@ pub mod builtin {
|
|||||||
///
|
///
|
||||||
/// Compiling 'main.rs' and running the resulting binary will print "adiós".
|
/// Compiling 'main.rs' and running the resulting binary will print "adiós".
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
macro_rules! include_bytes {
|
macro_rules! include_bytes {
|
||||||
($file:expr) => ({ /* compiler built-in */ });
|
($file:expr) => ({ /* compiler built-in */ });
|
||||||
($file:expr,) => ({ /* compiler built-in */ });
|
($file:expr,) => ({ /* compiler built-in */ });
|
||||||
@ -701,7 +701,7 @@ pub mod builtin {
|
|||||||
/// test::foo();
|
/// test::foo();
|
||||||
/// ```
|
/// ```
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
macro_rules! module_path { () => ({ /* compiler built-in */ }) }
|
macro_rules! module_path { () => ({ /* compiler built-in */ }) }
|
||||||
|
|
||||||
/// Boolean evaluation of configuration flags, at compile-time.
|
/// Boolean evaluation of configuration flags, at compile-time.
|
||||||
@ -723,7 +723,7 @@ pub mod builtin {
|
|||||||
/// };
|
/// };
|
||||||
/// ```
|
/// ```
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
macro_rules! cfg { ($($cfg:tt)*) => ({ /* compiler built-in */ }) }
|
macro_rules! cfg { ($($cfg:tt)*) => ({ /* compiler built-in */ }) }
|
||||||
|
|
||||||
/// Parse a file as an expression or an item according to the context.
|
/// Parse a file as an expression or an item according to the context.
|
||||||
@ -766,7 +766,7 @@ pub mod builtin {
|
|||||||
/// Compiling 'main.rs' and running the resulting binary will print
|
/// Compiling 'main.rs' and running the resulting binary will print
|
||||||
/// "🙈🙊🙉🙈🙊🙉".
|
/// "🙈🙊🙉🙈🙊🙉".
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
macro_rules! include {
|
macro_rules! include {
|
||||||
($file:expr) => ({ /* compiler built-in */ });
|
($file:expr) => ({ /* compiler built-in */ });
|
||||||
($file:expr,) => ({ /* compiler built-in */ });
|
($file:expr,) => ({ /* compiler built-in */ });
|
||||||
@ -819,7 +819,7 @@ pub mod builtin {
|
|||||||
/// assert!(a + b == 30, "a = {}, b = {}", a, b);
|
/// assert!(a + b == 30, "a = {}, b = {}", a, b);
|
||||||
/// ```
|
/// ```
|
||||||
#[stable(feature = "rust1", since = "1.0.0")]
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
#[macro_export]
|
#[rustc_doc_only_macro]
|
||||||
macro_rules! assert {
|
macro_rules! assert {
|
||||||
($cond:expr) => ({ /* compiler built-in */ });
|
($cond:expr) => ({ /* compiler built-in */ });
|
||||||
($cond:expr,) => ({ /* compiler built-in */ });
|
($cond:expr,) => ({ /* compiler built-in */ });
|
||||||
|
@ -686,7 +686,8 @@ pub fn deprecated_attributes() -> Vec<&'static (&'static str, AttributeType, Att
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_builtin_attr(attr: &ast::Attribute) -> bool {
|
pub fn is_builtin_attr(attr: &ast::Attribute) -> bool {
|
||||||
BUILTIN_ATTRIBUTES.iter().any(|&(builtin_name, _, _)| attr.check_name(builtin_name))
|
BUILTIN_ATTRIBUTES.iter().any(|&(builtin_name, _, _)| attr.check_name(builtin_name)) ||
|
||||||
|
attr.name().as_str().starts_with("rustc_")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Attributes that have a special meaning to rustc or rustdoc
|
// Attributes that have a special meaning to rustc or rustdoc
|
||||||
|
Loading…
Reference in New Issue
Block a user