mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-29 06:23:25 +00:00
internal: Update inert attribute list
This commit is contained in:
parent
ed44fe52e4
commit
383ee6af5e
1 changed files with 318 additions and 173 deletions
|
@ -2,7 +2,7 @@
|
||||||
//!
|
//!
|
||||||
//! The actual definitions were copied from rustc's `compiler/rustc_feature/src/builtin_attrs.rs`.
|
//! The actual definitions were copied from rustc's `compiler/rustc_feature/src/builtin_attrs.rs`.
|
||||||
//!
|
//!
|
||||||
//! It was last synchronized with upstream commit ae90dcf0207c57c3034f00b07048d63f8b2363c8.
|
//! It was last synchronized with upstream commit c1a2db3372a4d6896744919284f3287650a38ab7.
|
||||||
//!
|
//!
|
||||||
//! The macros were adjusted to only expand to the attribute name, since that is all we need to do
|
//! The macros were adjusted to only expand to the attribute name, since that is all we need to do
|
||||||
//! name resolution, and `BUILTIN_ATTRIBUTES` is almost entirely unchanged from the original, to
|
//! name resolution, and `BUILTIN_ATTRIBUTES` is almost entirely unchanged from the original, to
|
||||||
|
@ -66,26 +66,28 @@ macro_rules! template {
|
||||||
}
|
}
|
||||||
|
|
||||||
macro_rules! ungated {
|
macro_rules! ungated {
|
||||||
($attr:ident, $typ:expr, $tpl:expr $(,)?) => {
|
($attr:ident, $typ:expr, $tpl:expr, $duplicates:expr $(, @only_local: $only_local:expr)? $(,)?) => {
|
||||||
BuiltinAttribute { name: stringify!($attr), template: $tpl }
|
BuiltinAttribute { name: stringify!($attr), template: $tpl }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
macro_rules! gated {
|
macro_rules! gated {
|
||||||
($attr:ident, $typ:expr, $tpl:expr, $gate:ident, $msg:expr $(,)?) => {
|
($attr:ident, $typ:expr, $tpl:expr, $duplicates:expr $(, @only_local: $only_local:expr)?, $gate:ident, $msg:expr $(,)?) => {
|
||||||
BuiltinAttribute { name: stringify!($attr), template: $tpl }
|
BuiltinAttribute { name: stringify!($attr), template: $tpl }
|
||||||
};
|
};
|
||||||
($attr:ident, $typ:expr, $tpl:expr, $msg:expr $(,)?) => {
|
($attr:ident, $typ:expr, $tpl:expr, $duplicates:expr $(, @only_local: $only_local:expr)?, $msg:expr $(,)?) => {
|
||||||
BuiltinAttribute { name: stringify!($attr), template: $tpl }
|
BuiltinAttribute { name: stringify!($attr), template: $tpl }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
macro_rules! rustc_attr {
|
macro_rules! rustc_attr {
|
||||||
(TEST, $attr:ident, $typ:expr, $tpl:expr $(,)?) => {
|
(TEST, $attr:ident, $typ:expr, $tpl:expr, $duplicate:expr $(, @only_local: $only_local:expr)? $(,)?) => {
|
||||||
rustc_attr!(
|
rustc_attr!(
|
||||||
$attr,
|
$attr,
|
||||||
$typ,
|
$typ,
|
||||||
$tpl,
|
$tpl,
|
||||||
|
$duplicate,
|
||||||
|
$(@only_local: $only_local,)?
|
||||||
concat!(
|
concat!(
|
||||||
"the `#[",
|
"the `#[",
|
||||||
stringify!($attr),
|
stringify!($attr),
|
||||||
|
@ -94,11 +96,18 @@ macro_rules! rustc_attr {
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
($attr:ident, $typ:expr, $tpl:expr, $msg:expr $(,)?) => {
|
($attr:ident, $typ:expr, $tpl:expr, $duplicates:expr $(, @only_local: $only_local:expr)?, $msg:expr $(,)?) => {
|
||||||
BuiltinAttribute { name: stringify!($attr), template: $tpl }
|
BuiltinAttribute { name: stringify!($attr), template: $tpl }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(unused_macros)]
|
||||||
|
macro_rules! experimental {
|
||||||
|
($attr:ident) => {
|
||||||
|
concat!("the `#[", stringify!($attr), "]` attribute is an experimental feature")
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
/// "Inert" built-in attributes that have a special meaning to rustc or rustdoc.
|
/// "Inert" built-in attributes that have a special meaning to rustc or rustdoc.
|
||||||
#[rustfmt::skip]
|
#[rustfmt::skip]
|
||||||
pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
|
pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
|
||||||
|
@ -107,38 +116,52 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
// Conditional compilation:
|
// Conditional compilation:
|
||||||
ungated!(cfg, Normal, template!(List: "predicate")),
|
ungated!(cfg, Normal, template!(List: "predicate"), DuplicatesOk),
|
||||||
ungated!(cfg_attr, Normal, template!(List: "predicate, attr1, attr2, ...")),
|
ungated!(cfg_attr, Normal, template!(List: "predicate, attr1, attr2, ..."), DuplicatesOk),
|
||||||
|
|
||||||
// Testing:
|
// Testing:
|
||||||
ungated!(ignore, Normal, template!(Word, NameValueStr: "reason")),
|
ungated!(ignore, Normal, template!(Word, NameValueStr: "reason"), WarnFollowing),
|
||||||
ungated!(
|
ungated!(
|
||||||
should_panic, Normal,
|
should_panic, Normal,
|
||||||
template!(Word, List: r#"expected = "reason"#, NameValueStr: "reason"),
|
template!(Word, List: r#"expected = "reason"#, NameValueStr: "reason"), FutureWarnFollowing,
|
||||||
),
|
),
|
||||||
// FIXME(Centril): This can be used on stable but shouldn't.
|
// FIXME(Centril): This can be used on stable but shouldn't.
|
||||||
ungated!(reexport_test_harness_main, Normal, template!(NameValueStr: "name")),
|
ungated!(reexport_test_harness_main, CrateLevel, template!(NameValueStr: "name"), ErrorFollowing),
|
||||||
|
|
||||||
// Macros:
|
// Macros:
|
||||||
ungated!(automatically_derived, Normal, template!(Word)),
|
ungated!(automatically_derived, Normal, template!(Word), WarnFollowing),
|
||||||
// FIXME(#14407)
|
ungated!(macro_use, Normal, template!(Word, List: "name1, name2, ..."), WarnFollowingWordOnly),
|
||||||
ungated!(macro_use, Normal, template!(Word, List: "name1, name2, ...")),
|
ungated!(macro_escape, Normal, template!(Word), WarnFollowing), // Deprecated synonym for `macro_use`.
|
||||||
ungated!(macro_escape, Normal, template!(Word)), // Deprecated synonym for `macro_use`.
|
ungated!(macro_export, Normal, template!(Word, List: "local_inner_macros"), WarnFollowing),
|
||||||
ungated!(macro_export, Normal, template!(Word, List: "local_inner_macros")),
|
ungated!(proc_macro, Normal, template!(Word), ErrorFollowing),
|
||||||
ungated!(proc_macro, Normal, template!(Word)),
|
|
||||||
ungated!(
|
ungated!(
|
||||||
proc_macro_derive, Normal,
|
proc_macro_derive, Normal,
|
||||||
template!(List: "TraitName, /*opt*/ attributes(name1, name2, ...)"),
|
template!(List: "TraitName, /*opt*/ attributes(name1, name2, ...)"), ErrorFollowing,
|
||||||
),
|
),
|
||||||
ungated!(proc_macro_attribute, Normal, template!(Word)),
|
ungated!(proc_macro_attribute, Normal, template!(Word), ErrorFollowing),
|
||||||
|
|
||||||
// Lints:
|
// Lints:
|
||||||
ungated!(warn, Normal, template!(List: r#"lint1, lint2, ..., /*opt*/ reason = "...""#)),
|
ungated!(
|
||||||
ungated!(allow, Normal, template!(List: r#"lint1, lint2, ..., /*opt*/ reason = "...""#)),
|
warn, Normal, template!(List: r#"lint1, lint2, ..., /*opt*/ reason = "...""#), DuplicatesOk
|
||||||
ungated!(forbid, Normal, template!(List: r#"lint1, lint2, ..., /*opt*/ reason = "...""#)),
|
),
|
||||||
ungated!(deny, Normal, template!(List: r#"lint1, lint2, ..., /*opt*/ reason = "...""#)),
|
ungated!(
|
||||||
ungated!(must_use, AssumedUsed, template!(Word, NameValueStr: "reason")),
|
allow, Normal, template!(List: r#"lint1, lint2, ..., /*opt*/ reason = "...""#), DuplicatesOk
|
||||||
// FIXME(#14407)
|
),
|
||||||
|
gated!(
|
||||||
|
expect, Normal, template!(List: r#"lint1, lint2, ..., /*opt*/ reason = "...""#), DuplicatesOk,
|
||||||
|
lint_reasons, experimental!(expect)
|
||||||
|
),
|
||||||
|
ungated!(
|
||||||
|
forbid, Normal, template!(List: r#"lint1, lint2, ..., /*opt*/ reason = "...""#), DuplicatesOk
|
||||||
|
),
|
||||||
|
ungated!(
|
||||||
|
deny, Normal, template!(List: r#"lint1, lint2, ..., /*opt*/ reason = "...""#), DuplicatesOk
|
||||||
|
),
|
||||||
|
ungated!(must_use, Normal, template!(Word, NameValueStr: "reason"), FutureWarnFollowing),
|
||||||
|
gated!(
|
||||||
|
must_not_suspend, Normal, template!(Word, NameValueStr: "reason"), WarnFollowing,
|
||||||
|
experimental!(must_not_suspend)
|
||||||
|
),
|
||||||
ungated!(
|
ungated!(
|
||||||
deprecated, Normal,
|
deprecated, Normal,
|
||||||
template!(
|
template!(
|
||||||
|
@ -146,160 +169,198 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
|
||||||
List: r#"/*opt*/ since = "version", /*opt*/ note = "reason""#,
|
List: r#"/*opt*/ since = "version", /*opt*/ note = "reason""#,
|
||||||
NameValueStr: "reason"
|
NameValueStr: "reason"
|
||||||
),
|
),
|
||||||
|
ErrorFollowing
|
||||||
),
|
),
|
||||||
|
|
||||||
// Crate properties:
|
// Crate properties:
|
||||||
ungated!(crate_name, CrateLevel, template!(NameValueStr: "name")),
|
ungated!(crate_name, CrateLevel, template!(NameValueStr: "name"), FutureWarnFollowing),
|
||||||
ungated!(crate_type, CrateLevel, template!(NameValueStr: "bin|lib|...")),
|
ungated!(crate_type, CrateLevel, template!(NameValueStr: "bin|lib|..."), DuplicatesOk),
|
||||||
ungated!(crate_id, CrateLevel, template!(NameValueStr: "ignored")),
|
// crate_id is deprecated
|
||||||
|
ungated!(crate_id, CrateLevel, template!(NameValueStr: "ignored"), FutureWarnFollowing),
|
||||||
|
|
||||||
// ABI, linking, symbols, and FFI
|
// ABI, linking, symbols, and FFI
|
||||||
ungated!(
|
ungated!(
|
||||||
link, AssumedUsed,
|
link, Normal,
|
||||||
template!(List: r#"name = "...", /*opt*/ kind = "dylib|static|...", /*opt*/ wasm_import_module = "...""#),
|
template!(List: r#"name = "...", /*opt*/ kind = "dylib|static|...", /*opt*/ wasm_import_module = "...""#),
|
||||||
|
DuplicatesOk,
|
||||||
),
|
),
|
||||||
ungated!(link_name, AssumedUsed, template!(NameValueStr: "name")),
|
ungated!(link_name, Normal, template!(NameValueStr: "name"), FutureWarnPreceding),
|
||||||
ungated!(no_link, AssumedUsed, template!(Word)),
|
ungated!(no_link, Normal, template!(Word), WarnFollowing),
|
||||||
ungated!(repr, AssumedUsed, template!(List: "C")),
|
ungated!(repr, Normal, template!(List: "C"), DuplicatesOk),
|
||||||
ungated!(export_name, AssumedUsed, template!(NameValueStr: "name")),
|
ungated!(export_name, Normal, template!(NameValueStr: "name"), FutureWarnPreceding),
|
||||||
ungated!(link_section, AssumedUsed, template!(NameValueStr: "name")),
|
ungated!(link_section, Normal, template!(NameValueStr: "name"), FutureWarnPreceding),
|
||||||
ungated!(no_mangle, AssumedUsed, template!(Word)),
|
ungated!(no_mangle, Normal, template!(Word), WarnFollowing, @only_local: true),
|
||||||
ungated!(used, AssumedUsed, template!(Word)),
|
ungated!(used, Normal, template!(Word, List: "compiler|linker"), WarnFollowing, @only_local: true),
|
||||||
|
|
||||||
// Limits:
|
// Limits:
|
||||||
ungated!(recursion_limit, CrateLevel, template!(NameValueStr: "N")),
|
ungated!(recursion_limit, CrateLevel, template!(NameValueStr: "N"), FutureWarnFollowing),
|
||||||
ungated!(type_length_limit, CrateLevel, template!(NameValueStr: "N")),
|
ungated!(type_length_limit, CrateLevel, template!(NameValueStr: "N"), FutureWarnFollowing),
|
||||||
gated!(
|
gated!(
|
||||||
const_eval_limit, CrateLevel, template!(NameValueStr: "N"), const_eval_limit,
|
const_eval_limit, CrateLevel, template!(NameValueStr: "N"), ErrorFollowing,
|
||||||
experimental!(const_eval_limit)
|
const_eval_limit, experimental!(const_eval_limit)
|
||||||
),
|
),
|
||||||
gated!(
|
gated!(
|
||||||
move_size_limit, CrateLevel, template!(NameValueStr: "N"), large_assignments,
|
move_size_limit, CrateLevel, template!(NameValueStr: "N"), ErrorFollowing,
|
||||||
experimental!(move_size_limit)
|
large_assignments, experimental!(move_size_limit)
|
||||||
),
|
),
|
||||||
|
|
||||||
// Entry point:
|
// Entry point:
|
||||||
ungated!(main, Normal, template!(Word)),
|
ungated!(start, Normal, template!(Word), WarnFollowing),
|
||||||
ungated!(start, Normal, template!(Word)),
|
ungated!(no_start, CrateLevel, template!(Word), WarnFollowing),
|
||||||
ungated!(no_start, CrateLevel, template!(Word)),
|
ungated!(no_main, CrateLevel, template!(Word), WarnFollowing),
|
||||||
ungated!(no_main, CrateLevel, template!(Word)),
|
|
||||||
|
|
||||||
// Modules, prelude, and resolution:
|
// Modules, prelude, and resolution:
|
||||||
ungated!(path, Normal, template!(NameValueStr: "file")),
|
ungated!(path, Normal, template!(NameValueStr: "file"), FutureWarnFollowing),
|
||||||
ungated!(no_std, CrateLevel, template!(Word)),
|
ungated!(no_std, CrateLevel, template!(Word), WarnFollowing),
|
||||||
ungated!(no_implicit_prelude, Normal, template!(Word)),
|
ungated!(no_implicit_prelude, Normal, template!(Word), WarnFollowing),
|
||||||
ungated!(non_exhaustive, AssumedUsed, template!(Word)),
|
ungated!(non_exhaustive, Normal, template!(Word), WarnFollowing),
|
||||||
|
|
||||||
// Runtime
|
// Runtime
|
||||||
ungated!(windows_subsystem, AssumedUsed, template!(NameValueStr: "windows|console")),
|
ungated!(
|
||||||
ungated!(panic_handler, Normal, template!(Word)), // RFC 2070
|
windows_subsystem, CrateLevel,
|
||||||
|
template!(NameValueStr: "windows|console"), FutureWarnFollowing
|
||||||
|
),
|
||||||
|
ungated!(panic_handler, Normal, template!(Word), WarnFollowing), // RFC 2070
|
||||||
|
|
||||||
// Code generation:
|
// Code generation:
|
||||||
ungated!(inline, AssumedUsed, template!(Word, List: "always|never")),
|
ungated!(inline, Normal, template!(Word, List: "always|never"), FutureWarnFollowing, @only_local: true),
|
||||||
ungated!(cold, AssumedUsed, template!(Word)),
|
ungated!(cold, Normal, template!(Word), WarnFollowing, @only_local: true),
|
||||||
ungated!(no_builtins, AssumedUsed, template!(Word)),
|
ungated!(no_builtins, CrateLevel, template!(Word), WarnFollowing),
|
||||||
ungated!(target_feature, AssumedUsed, template!(List: r#"enable = "name""#)),
|
ungated!(target_feature, Normal, template!(List: r#"enable = "name""#), DuplicatesOk),
|
||||||
ungated!(track_caller, AssumedUsed, template!(Word)),
|
ungated!(track_caller, Normal, template!(Word), WarnFollowing),
|
||||||
gated!(
|
gated!(
|
||||||
no_sanitize, AssumedUsed,
|
no_sanitize, Normal,
|
||||||
template!(List: "address, memory, thread"),
|
template!(List: "address, memory, thread"), DuplicatesOk,
|
||||||
experimental!(no_sanitize)
|
experimental!(no_sanitize)
|
||||||
),
|
),
|
||||||
gated!(no_coverage, AssumedUsed, template!(Word), experimental!(no_coverage)),
|
gated!(no_coverage, Normal, template!(Word), WarnFollowing, experimental!(no_coverage)),
|
||||||
|
|
||||||
// FIXME: #14408 assume docs are used since rustdoc looks at them.
|
ungated!(
|
||||||
ungated!(doc, AssumedUsed, template!(List: "hidden|inline|...", NameValueStr: "string")),
|
doc, Normal, template!(List: "hidden|inline|...", NameValueStr: "string"), DuplicatesOk
|
||||||
|
),
|
||||||
|
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
// Unstable attributes:
|
// Unstable attributes:
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
// Linking:
|
// RFC #3191: #[debugger_visualizer] support
|
||||||
gated!(naked, AssumedUsed, template!(Word), naked_functions, experimental!(naked)),
|
|
||||||
gated!(
|
gated!(
|
||||||
link_ordinal, AssumedUsed, template!(List: "ordinal"), raw_dylib,
|
debugger_visualizer, Normal, template!(List: r#"natvis_file = "...", gdb_script_file = "...""#),
|
||||||
|
DuplicatesOk, experimental!(debugger_visualizer)
|
||||||
|
),
|
||||||
|
|
||||||
|
// Linking:
|
||||||
|
gated!(naked, Normal, template!(Word), WarnFollowing, @only_local: true, naked_functions, experimental!(naked)),
|
||||||
|
gated!(
|
||||||
|
link_ordinal, Normal, template!(List: "ordinal"), ErrorPreceding, raw_dylib,
|
||||||
experimental!(link_ordinal)
|
experimental!(link_ordinal)
|
||||||
),
|
),
|
||||||
|
|
||||||
// Plugins:
|
// Plugins:
|
||||||
// XXX Modified for use in rust-analyzer
|
// XXX Modified for use in rust-analyzer
|
||||||
gated!(plugin_registrar, Normal, template!(Word), experimental!()),
|
// BuiltinAttribute {
|
||||||
gated!(plugin, CrateLevel, template!(Word), experimental!()),
|
// name: sym::plugin,
|
||||||
|
// only_local: false,
|
||||||
|
// type_: CrateLevel,
|
||||||
|
// template: template!(List: "name"),
|
||||||
|
// duplicates: DuplicatesOk,
|
||||||
|
// gate: Gated(
|
||||||
|
// Stability::Deprecated(
|
||||||
|
// "https://github.com/rust-lang/rust/pull/64675",
|
||||||
|
// Some("may be removed in a future compiler version"),
|
||||||
|
// ),
|
||||||
|
// sym::plugin,
|
||||||
|
// "compiler plugins are deprecated",
|
||||||
|
// cfg_fn!(plugin)
|
||||||
|
// ),
|
||||||
|
// },
|
||||||
|
BuiltinAttribute {
|
||||||
|
name: "plugin",
|
||||||
|
template: template!(List: "name"),
|
||||||
|
},
|
||||||
|
|
||||||
// Testing:
|
// Testing:
|
||||||
gated!(allow_fail, Normal, template!(Word), experimental!(allow_fail)),
|
|
||||||
gated!(
|
gated!(
|
||||||
test_runner, CrateLevel, template!(List: "path"), custom_test_frameworks,
|
test_runner, CrateLevel, template!(List: "path"), ErrorFollowing, custom_test_frameworks,
|
||||||
"custom test frameworks are an unstable feature",
|
"custom test frameworks are an unstable feature",
|
||||||
),
|
),
|
||||||
// RFC #1268
|
// RFC #1268
|
||||||
gated!(marker, AssumedUsed, template!(Word), marker_trait_attr, experimental!(marker)),
|
|
||||||
gated!(
|
gated!(
|
||||||
thread_local, AssumedUsed, template!(Word),
|
marker, Normal, template!(Word), WarnFollowing, marker_trait_attr, experimental!(marker)
|
||||||
|
),
|
||||||
|
gated!(
|
||||||
|
thread_local, Normal, template!(Word), WarnFollowing,
|
||||||
"`#[thread_local]` is an experimental feature, and does not currently handle destructors",
|
"`#[thread_local]` is an experimental feature, and does not currently handle destructors",
|
||||||
),
|
),
|
||||||
gated!(no_core, CrateLevel, template!(Word), experimental!(no_core)),
|
gated!(no_core, CrateLevel, template!(Word), WarnFollowing, experimental!(no_core)),
|
||||||
// RFC 2412
|
// RFC 2412
|
||||||
gated!(
|
gated!(
|
||||||
optimize, AssumedUsed, template!(List: "size|speed"), optimize_attribute,
|
optimize, Normal, template!(List: "size|speed"), ErrorPreceding, optimize_attribute,
|
||||||
experimental!(optimize),
|
experimental!(optimize),
|
||||||
),
|
),
|
||||||
// RFC 2867
|
// RFC 2867
|
||||||
gated!(instruction_set, AssumedUsed, template!(List: "set"), isa_attribute, experimental!(instruction_set)),
|
|
||||||
|
|
||||||
gated!(ffi_returns_twice, AssumedUsed, template!(Word), experimental!(ffi_returns_twice)),
|
|
||||||
gated!(ffi_pure, AssumedUsed, template!(Word), experimental!(ffi_pure)),
|
|
||||||
gated!(ffi_const, AssumedUsed, template!(Word), experimental!(ffi_const)),
|
|
||||||
gated!(
|
gated!(
|
||||||
register_attr, CrateLevel, template!(List: "attr1, attr2, ..."),
|
instruction_set, Normal, template!(List: "set"), ErrorPreceding,
|
||||||
|
isa_attribute, experimental!(instruction_set)
|
||||||
|
),
|
||||||
|
|
||||||
|
gated!(
|
||||||
|
ffi_returns_twice, Normal, template!(Word), WarnFollowing, experimental!(ffi_returns_twice)
|
||||||
|
),
|
||||||
|
gated!(ffi_pure, Normal, template!(Word), WarnFollowing, experimental!(ffi_pure)),
|
||||||
|
gated!(ffi_const, Normal, template!(Word), WarnFollowing, experimental!(ffi_const)),
|
||||||
|
gated!(
|
||||||
|
register_attr, CrateLevel, template!(List: "attr1, attr2, ..."), DuplicatesOk,
|
||||||
experimental!(register_attr),
|
experimental!(register_attr),
|
||||||
),
|
),
|
||||||
gated!(
|
gated!(
|
||||||
register_tool, CrateLevel, template!(List: "tool1, tool2, ..."),
|
register_tool, CrateLevel, template!(List: "tool1, tool2, ..."), DuplicatesOk,
|
||||||
experimental!(register_tool),
|
experimental!(register_tool),
|
||||||
),
|
),
|
||||||
|
|
||||||
gated!(cmse_nonsecure_entry, AssumedUsed, template!(Word), experimental!(cmse_nonsecure_entry)),
|
gated!(
|
||||||
|
cmse_nonsecure_entry, Normal, template!(Word), WarnFollowing,
|
||||||
|
experimental!(cmse_nonsecure_entry)
|
||||||
|
),
|
||||||
// RFC 2632
|
// RFC 2632
|
||||||
gated!(
|
gated!(
|
||||||
default_method_body_is_const, AssumedUsed, template!(Word), const_trait_impl,
|
const_trait, Normal, template!(Word), WarnFollowing, const_trait_impl,
|
||||||
"`default_method_body_is_const` is a temporary placeholder for declaring default bodies \
|
"`const` is a temporary placeholder for marking a trait that is suitable for `const` \
|
||||||
as `const`, which may be removed or renamed in the future."
|
`impls` and all default bodies as `const`, which may be removed or renamed in the \
|
||||||
|
future."
|
||||||
|
),
|
||||||
|
// lang-team MCP 147
|
||||||
|
gated!(
|
||||||
|
deprecated_safe, Normal, template!(List: r#"since = "version", note = "...""#), ErrorFollowing,
|
||||||
|
experimental!(deprecated_safe),
|
||||||
),
|
),
|
||||||
|
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
// Internal attributes: Stability, deprecation, and unsafe:
|
// Internal attributes: Stability, deprecation, and unsafe:
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
ungated!(feature, CrateLevel, template!(List: "name1, name1, ...")),
|
ungated!(feature, CrateLevel, template!(List: "name1, name2, ..."), DuplicatesOk),
|
||||||
// FIXME(#14407) -- only looked at on-demand so we can't
|
// DuplicatesOk since it has its own validation
|
||||||
// guarantee they'll have already been checked.
|
|
||||||
// FIXME(jhpratt) remove this when #[rustc_deprecated] is fully removed from the compiler
|
|
||||||
ungated!(
|
ungated!(
|
||||||
rustc_deprecated, AssumedUsed,
|
stable, Normal, template!(List: r#"feature = "name", since = "version""#), DuplicatesOk,
|
||||||
template!(List: r#"since = "version", reason = "...""#)
|
|
||||||
),
|
),
|
||||||
// FIXME(#14407)
|
|
||||||
ungated!(stable, AssumedUsed, template!(List: r#"feature = "name", since = "version""#)),
|
|
||||||
// FIXME(#14407)
|
|
||||||
ungated!(
|
ungated!(
|
||||||
unstable, AssumedUsed,
|
unstable, Normal,
|
||||||
template!(List: r#"feature = "name", reason = "...", issue = "N""#),
|
template!(List: r#"feature = "name", reason = "...", issue = "N""#), DuplicatesOk,
|
||||||
),
|
),
|
||||||
// FIXME(#14407)
|
ungated!(rustc_const_unstable, Normal, template!(List: r#"feature = "name""#), DuplicatesOk),
|
||||||
ungated!(rustc_const_unstable, AssumedUsed, template!(List: r#"feature = "name""#)),
|
ungated!(rustc_const_stable, Normal, template!(List: r#"feature = "name""#), DuplicatesOk),
|
||||||
// FIXME(#14407)
|
|
||||||
ungated!(rustc_const_stable, AssumedUsed, template!(List: r#"feature = "name""#)),
|
|
||||||
gated!(
|
gated!(
|
||||||
allow_internal_unstable, AssumedUsed, template!(Word, List: "feat1, feat2, ..."),
|
allow_internal_unstable, Normal, template!(Word, List: "feat1, feat2, ..."), DuplicatesOk,
|
||||||
"allow_internal_unstable side-steps feature gating and stability checks",
|
"allow_internal_unstable side-steps feature gating and stability checks",
|
||||||
),
|
),
|
||||||
gated!(
|
gated!(
|
||||||
rustc_allow_const_fn_unstable, AssumedUsed, template!(Word, List: "feat1, feat2, ..."),
|
rustc_allow_const_fn_unstable, Normal,
|
||||||
|
template!(Word, List: "feat1, feat2, ..."), DuplicatesOk,
|
||||||
"rustc_allow_const_fn_unstable side-steps feature gating and stability checks"
|
"rustc_allow_const_fn_unstable side-steps feature gating and stability checks"
|
||||||
),
|
),
|
||||||
gated!(
|
gated!(
|
||||||
allow_internal_unsafe, Normal, template!(Word),
|
allow_internal_unsafe, Normal, template!(Word), WarnFollowing,
|
||||||
"allow_internal_unsafe side-steps the unsafe_code lint",
|
"allow_internal_unsafe side-steps the unsafe_code lint",
|
||||||
),
|
),
|
||||||
|
|
||||||
|
@ -307,9 +368,9 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
|
||||||
// Internal attributes: Type system related:
|
// Internal attributes: Type system related:
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
gated!(fundamental, AssumedUsed, template!(Word), experimental!(fundamental)),
|
gated!(fundamental, Normal, template!(Word), WarnFollowing, experimental!(fundamental)),
|
||||||
gated!(
|
gated!(
|
||||||
may_dangle, Normal, template!(Word), dropck_eyepatch,
|
may_dangle, Normal, template!(Word), WarnFollowing, dropck_eyepatch,
|
||||||
"`may_dangle` has unstable semantics and may be removed in the future",
|
"`may_dangle` has unstable semantics and may be removed in the future",
|
||||||
),
|
),
|
||||||
|
|
||||||
|
@ -317,26 +378,32 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
|
||||||
// Internal attributes: Runtime related:
|
// Internal attributes: Runtime related:
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
rustc_attr!(rustc_allocator, AssumedUsed, template!(Word), IMPL_DETAIL),
|
rustc_attr!(rustc_allocator, Normal, template!(Word), WarnFollowing, IMPL_DETAIL),
|
||||||
rustc_attr!(rustc_allocator_nounwind, AssumedUsed, template!(Word), IMPL_DETAIL),
|
rustc_attr!(rustc_allocator_nounwind, Normal, template!(Word), WarnFollowing, IMPL_DETAIL),
|
||||||
gated!(alloc_error_handler, Normal, template!(Word), experimental!(alloc_error_handler)),
|
|
||||||
gated!(
|
gated!(
|
||||||
default_lib_allocator, AssumedUsed, template!(Word), allocator_internals,
|
alloc_error_handler, Normal, template!(Word), WarnFollowing,
|
||||||
|
experimental!(alloc_error_handler)
|
||||||
|
),
|
||||||
|
gated!(
|
||||||
|
default_lib_allocator, Normal, template!(Word), WarnFollowing, allocator_internals,
|
||||||
experimental!(default_lib_allocator),
|
experimental!(default_lib_allocator),
|
||||||
),
|
),
|
||||||
gated!(
|
gated!(
|
||||||
needs_allocator, Normal, template!(Word), allocator_internals,
|
needs_allocator, Normal, template!(Word), WarnFollowing, allocator_internals,
|
||||||
experimental!(needs_allocator),
|
experimental!(needs_allocator),
|
||||||
),
|
),
|
||||||
gated!(panic_runtime, AssumedUsed, template!(Word), experimental!(panic_runtime)),
|
gated!(panic_runtime, Normal, template!(Word), WarnFollowing, experimental!(panic_runtime)),
|
||||||
gated!(needs_panic_runtime, AssumedUsed, template!(Word), experimental!(needs_panic_runtime)),
|
|
||||||
gated!(
|
gated!(
|
||||||
compiler_builtins, AssumedUsed, template!(Word),
|
needs_panic_runtime, Normal, template!(Word), WarnFollowing,
|
||||||
|
experimental!(needs_panic_runtime)
|
||||||
|
),
|
||||||
|
gated!(
|
||||||
|
compiler_builtins, Normal, template!(Word), WarnFollowing,
|
||||||
"the `#[compiler_builtins]` attribute is used to identify the `compiler_builtins` crate \
|
"the `#[compiler_builtins]` attribute is used to identify the `compiler_builtins` crate \
|
||||||
which contains compiler-rt intrinsics and will never be stable",
|
which contains compiler-rt intrinsics and will never be stable",
|
||||||
),
|
),
|
||||||
gated!(
|
gated!(
|
||||||
profiler_runtime, AssumedUsed, template!(Word),
|
profiler_runtime, Normal, template!(Word), WarnFollowing,
|
||||||
"the `#[profiler_runtime]` attribute is used to identify the `profiler_builtins` crate \
|
"the `#[profiler_runtime]` attribute is used to identify the `profiler_builtins` crate \
|
||||||
which contains the profiler runtime and will never be stable",
|
which contains the profiler runtime and will never be stable",
|
||||||
),
|
),
|
||||||
|
@ -346,24 +413,26 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
gated!(
|
gated!(
|
||||||
linkage, AssumedUsed, template!(NameValueStr: "external|internal|..."),
|
linkage, Normal, template!(NameValueStr: "external|internal|..."), ErrorPreceding, @only_local: true,
|
||||||
"the `linkage` attribute is experimental and not portable across platforms",
|
"the `linkage` attribute is experimental and not portable across platforms",
|
||||||
),
|
),
|
||||||
rustc_attr!(rustc_std_internal_symbol, AssumedUsed, template!(Word), INTERNAL_UNSTABLE),
|
rustc_attr!(
|
||||||
|
rustc_std_internal_symbol, Normal, template!(Word), WarnFollowing, @only_local: true, INTERNAL_UNSTABLE
|
||||||
|
),
|
||||||
|
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
// Internal attributes, Macro related:
|
// Internal attributes, Macro related:
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
rustc_attr!(
|
rustc_attr!(
|
||||||
rustc_builtin_macro, AssumedUsed,
|
rustc_builtin_macro, Normal,
|
||||||
template!(Word, List: "name, /*opt*/ attributes(name1, name2, ...)"),
|
template!(Word, List: "name, /*opt*/ attributes(name1, name2, ...)"), ErrorFollowing,
|
||||||
IMPL_DETAIL,
|
IMPL_DETAIL,
|
||||||
),
|
),
|
||||||
rustc_attr!(rustc_proc_macro_decls, Normal, template!(Word), INTERNAL_UNSTABLE),
|
rustc_attr!(rustc_proc_macro_decls, Normal, template!(Word), WarnFollowing, INTERNAL_UNSTABLE),
|
||||||
rustc_attr!(
|
rustc_attr!(
|
||||||
rustc_macro_transparency, AssumedUsed,
|
rustc_macro_transparency, Normal,
|
||||||
template!(NameValueStr: "transparent|semitransparent|opaque"),
|
template!(NameValueStr: "transparent|semitransparent|opaque"), ErrorFollowing,
|
||||||
"used internally for testing macro hygiene",
|
"used internally for testing macro hygiene",
|
||||||
),
|
),
|
||||||
|
|
||||||
|
@ -372,138 +441,214 @@ pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
rustc_attr!(
|
rustc_attr!(
|
||||||
rustc_on_unimplemented, AssumedUsed,
|
rustc_on_unimplemented, Normal,
|
||||||
template!(
|
template!(
|
||||||
List: r#"/*opt*/ message = "...", /*opt*/ label = "...", /*opt*/ note = "...""#,
|
List: r#"/*opt*/ message = "...", /*opt*/ label = "...", /*opt*/ note = "...""#,
|
||||||
NameValueStr: "message"
|
NameValueStr: "message"
|
||||||
),
|
),
|
||||||
|
ErrorFollowing,
|
||||||
INTERNAL_UNSTABLE
|
INTERNAL_UNSTABLE
|
||||||
),
|
),
|
||||||
// Enumerates "identity-like" conversion methods to suggest on type mismatch.
|
// Enumerates "identity-like" conversion methods to suggest on type mismatch.
|
||||||
rustc_attr!(rustc_conversion_suggestion, AssumedUsed, template!(Word), INTERNAL_UNSTABLE),
|
rustc_attr!(
|
||||||
|
rustc_conversion_suggestion, Normal, template!(Word), WarnFollowing, INTERNAL_UNSTABLE
|
||||||
|
),
|
||||||
|
// Prevents field reads in the marked trait or method to be considered
|
||||||
|
// during dead code analysis.
|
||||||
|
rustc_attr!(
|
||||||
|
rustc_trivial_field_reads, Normal, template!(Word), WarnFollowing, INTERNAL_UNSTABLE
|
||||||
|
),
|
||||||
|
// Used by the `rustc::potential_query_instability` lint to warn methods which
|
||||||
|
// might not be stable during incremental compilation.
|
||||||
|
rustc_attr!(rustc_lint_query_instability, Normal, template!(Word), WarnFollowing, INTERNAL_UNSTABLE),
|
||||||
|
// Used by the `rustc::untranslatable_diagnostic` and `rustc::diagnostic_outside_of_impl` lints
|
||||||
|
// to assist in changes to diagnostic APIs.
|
||||||
|
rustc_attr!(rustc_lint_diagnostics, Normal, template!(Word), WarnFollowing, INTERNAL_UNSTABLE),
|
||||||
|
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
// Internal attributes, Const related:
|
// Internal attributes, Const related:
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
rustc_attr!(rustc_promotable, AssumedUsed, template!(Word), IMPL_DETAIL),
|
rustc_attr!(rustc_promotable, Normal, template!(Word), WarnFollowing, IMPL_DETAIL),
|
||||||
rustc_attr!(rustc_legacy_const_generics, AssumedUsed, template!(List: "N"), INTERNAL_UNSTABLE),
|
rustc_attr!(
|
||||||
|
rustc_legacy_const_generics, Normal, template!(List: "N"), ErrorFollowing,
|
||||||
|
INTERNAL_UNSTABLE
|
||||||
|
),
|
||||||
|
// Do not const-check this function's body. It will always get replaced during CTFE.
|
||||||
|
rustc_attr!(
|
||||||
|
rustc_do_not_const_check, Normal, template!(Word), WarnFollowing, INTERNAL_UNSTABLE
|
||||||
|
),
|
||||||
|
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
// Internal attributes, Layout related:
|
// Internal attributes, Layout related:
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
rustc_attr!(
|
rustc_attr!(
|
||||||
rustc_layout_scalar_valid_range_start, AssumedUsed, template!(List: "value"),
|
rustc_layout_scalar_valid_range_start, Normal, template!(List: "value"), ErrorFollowing,
|
||||||
"the `#[rustc_layout_scalar_valid_range_start]` attribute is just used to enable \
|
"the `#[rustc_layout_scalar_valid_range_start]` attribute is just used to enable \
|
||||||
niche optimizations in libcore and will never be stable",
|
niche optimizations in libcore and libstd and will never be stable",
|
||||||
),
|
),
|
||||||
rustc_attr!(
|
rustc_attr!(
|
||||||
rustc_layout_scalar_valid_range_end, AssumedUsed, template!(List: "value"),
|
rustc_layout_scalar_valid_range_end, Normal, template!(List: "value"), ErrorFollowing,
|
||||||
"the `#[rustc_layout_scalar_valid_range_end]` attribute is just used to enable \
|
"the `#[rustc_layout_scalar_valid_range_end]` attribute is just used to enable \
|
||||||
niche optimizations in libcore and will never be stable",
|
niche optimizations in libcore and libstd and will never be stable",
|
||||||
),
|
),
|
||||||
rustc_attr!(
|
rustc_attr!(
|
||||||
rustc_nonnull_optimization_guaranteed, AssumedUsed, template!(Word),
|
rustc_nonnull_optimization_guaranteed, Normal, template!(Word), WarnFollowing,
|
||||||
"the `#[rustc_nonnull_optimization_guaranteed]` attribute is just used to enable \
|
"the `#[rustc_nonnull_optimization_guaranteed]` attribute is just used to enable \
|
||||||
niche optimizations in libcore and will never be stable",
|
niche optimizations in libcore and libstd and will never be stable",
|
||||||
),
|
),
|
||||||
|
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
// Internal attributes, Misc:
|
// Internal attributes, Misc:
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
gated!(
|
gated!(
|
||||||
lang, Normal, template!(NameValueStr: "name"), lang_items,
|
lang, Normal, template!(NameValueStr: "name"), DuplicatesOk, @only_local: true, lang_items,
|
||||||
"language items are subject to change",
|
"language items are subject to change",
|
||||||
),
|
),
|
||||||
gated!(rustc_diagnostic_item, Normal, template!(NameValueStr: "name"), experimental!()), // XXX Modified for use in rust-analyzer
|
rustc_attr!(
|
||||||
|
rustc_pass_by_value, Normal,
|
||||||
|
template!(Word), ErrorFollowing,
|
||||||
|
"#[rustc_pass_by_value] is used to mark types that must be passed by value instead of reference."
|
||||||
|
),
|
||||||
|
rustc_attr!(
|
||||||
|
rustc_coherence_is_core, AttributeType::CrateLevel, template!(Word), ErrorFollowing, @only_local: true,
|
||||||
|
"#![rustc_coherence_is_core] allows inherent methods on builtin types, only intended to be used in `core`."
|
||||||
|
),
|
||||||
|
rustc_attr!(
|
||||||
|
rustc_allow_incoherent_impl, AttributeType::Normal, template!(Word), ErrorFollowing, @only_local: true,
|
||||||
|
"#[rustc_allow_incoherent_impl] has to be added to all impl items of an incoherent inherent impl."
|
||||||
|
),
|
||||||
|
rustc_attr!(
|
||||||
|
rustc_has_incoherent_inherent_impls, AttributeType::Normal, template!(Word), ErrorFollowing,
|
||||||
|
"#[rustc_has_incoherent_inherent_impls] allows the addition of incoherent inherent impls for \
|
||||||
|
the given type by annotating all impl items with #[rustc_allow_incoherent_impl]."
|
||||||
|
),
|
||||||
|
rustc_attr!(
|
||||||
|
rustc_box, AttributeType::Normal, template!(Word), ErrorFollowing,
|
||||||
|
"#[rustc_box] allows creating boxes \
|
||||||
|
and it is only intended to be used in `alloc`."
|
||||||
|
),
|
||||||
|
|
||||||
|
// modified for r-a
|
||||||
|
// BuiltinAttribute {
|
||||||
|
// name: sym::rustc_diagnostic_item,
|
||||||
|
// // FIXME: This can be `true` once we always use `tcx.is_diagnostic_item`.
|
||||||
|
// only_local: false,
|
||||||
|
// type_: Normal,
|
||||||
|
// template: template!(NameValueStr: "name"),
|
||||||
|
// duplicates: ErrorFollowing,
|
||||||
|
// gate: Gated(
|
||||||
|
// Stability::Unstable,
|
||||||
|
// sym::rustc_attrs,
|
||||||
|
// "diagnostic items compiler internal support for linting",
|
||||||
|
// cfg_fn!(rustc_attrs),
|
||||||
|
// ),
|
||||||
|
// },
|
||||||
|
BuiltinAttribute {
|
||||||
|
name: "rustc_diagnostic_item",
|
||||||
|
template: template!(NameValueStr: "name"),
|
||||||
|
},
|
||||||
gated!(
|
gated!(
|
||||||
// Used in resolve:
|
// Used in resolve:
|
||||||
prelude_import, AssumedUsed, template!(Word),
|
prelude_import, Normal, template!(Word), WarnFollowing,
|
||||||
"`#[prelude_import]` is for use by rustc only",
|
"`#[prelude_import]` is for use by rustc only",
|
||||||
),
|
),
|
||||||
gated!(
|
gated!(
|
||||||
rustc_paren_sugar, Normal, template!(Word), unboxed_closures,
|
rustc_paren_sugar, Normal, template!(Word), WarnFollowing, unboxed_closures,
|
||||||
"unboxed_closures are still evolving",
|
"unboxed_closures are still evolving",
|
||||||
),
|
),
|
||||||
rustc_attr!(
|
rustc_attr!(
|
||||||
rustc_inherit_overflow_checks, AssumedUsed, template!(Word),
|
rustc_inherit_overflow_checks, Normal, template!(Word), WarnFollowing, @only_local: true,
|
||||||
"the `#[rustc_inherit_overflow_checks]` attribute is just used to control \
|
"the `#[rustc_inherit_overflow_checks]` attribute is just used to control \
|
||||||
overflow checking behavior of several libcore functions that are inlined \
|
overflow checking behavior of several libcore functions that are inlined \
|
||||||
across crates and will never be stable",
|
across crates and will never be stable",
|
||||||
),
|
),
|
||||||
rustc_attr!(rustc_reservation_impl, Normal, template!(NameValueStr: "reservation message"),
|
rustc_attr!(
|
||||||
"the `#[rustc_reservation_impl]` attribute is internally used \
|
rustc_reservation_impl, Normal,
|
||||||
for reserving for `for<T> From<!> for T` impl"
|
template!(NameValueStr: "reservation message"), ErrorFollowing,
|
||||||
|
"the `#[rustc_reservation_impl]` attribute is internally used \
|
||||||
|
for reserving for `for<T> From<!> for T` impl"
|
||||||
),
|
),
|
||||||
rustc_attr!(
|
rustc_attr!(
|
||||||
rustc_test_marker, Normal, template!(Word),
|
rustc_test_marker, Normal, template!(Word), WarnFollowing,
|
||||||
"the `#[rustc_test_marker]` attribute is used internally to track tests",
|
"the `#[rustc_test_marker]` attribute is used internally to track tests",
|
||||||
),
|
),
|
||||||
rustc_attr!(
|
rustc_attr!(
|
||||||
rustc_unsafe_specialization_marker, Normal, template!(Word),
|
rustc_unsafe_specialization_marker, Normal, template!(Word), WarnFollowing,
|
||||||
"the `#[rustc_unsafe_specialization_marker]` attribute is used to check specializations"
|
"the `#[rustc_unsafe_specialization_marker]` attribute is used to check specializations"
|
||||||
),
|
),
|
||||||
rustc_attr!(
|
rustc_attr!(
|
||||||
rustc_specialization_trait, Normal, template!(Word),
|
rustc_specialization_trait, Normal, template!(Word), WarnFollowing,
|
||||||
"the `#[rustc_specialization_trait]` attribute is used to check specializations"
|
"the `#[rustc_specialization_trait]` attribute is used to check specializations"
|
||||||
),
|
),
|
||||||
rustc_attr!(
|
rustc_attr!(
|
||||||
rustc_main, Normal, template!(Word),
|
rustc_main, Normal, template!(Word), WarnFollowing,
|
||||||
"the `#[rustc_main]` attribute is used internally to specify test entry point function",
|
"the `#[rustc_main]` attribute is used internally to specify test entry point function",
|
||||||
),
|
),
|
||||||
rustc_attr!(
|
rustc_attr!(
|
||||||
rustc_skip_array_during_method_dispatch, Normal, template!(Word),
|
rustc_skip_array_during_method_dispatch, Normal, template!(Word), WarnFollowing,
|
||||||
"the `#[rustc_skip_array_during_method_dispatch]` attribute is used to exclude a trait \
|
"the `#[rustc_skip_array_during_method_dispatch]` attribute is used to exclude a trait \
|
||||||
from method dispatch when the receiver is an array, for compatibility in editions < 2021."
|
from method dispatch when the receiver is an array, for compatibility in editions < 2021."
|
||||||
),
|
),
|
||||||
|
rustc_attr!(
|
||||||
|
rustc_must_implement_one_of, Normal, template!(List: "function1, function2, ..."), ErrorFollowing,
|
||||||
|
"the `#[rustc_must_implement_one_of]` attribute is used to change minimal complete \
|
||||||
|
definition of a trait, it's currently in experimental form and should be changed before \
|
||||||
|
being exposed outside of the std"
|
||||||
|
),
|
||||||
|
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
// Internal attributes, Testing:
|
// Internal attributes, Testing:
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
rustc_attr!(TEST, rustc_outlives, Normal, template!(Word)),
|
rustc_attr!(TEST, rustc_outlives, Normal, template!(Word), WarnFollowing),
|
||||||
rustc_attr!(TEST, rustc_capture_analysis, Normal, template!(Word)),
|
rustc_attr!(TEST, rustc_capture_analysis, Normal, template!(Word), WarnFollowing),
|
||||||
rustc_attr!(TEST, rustc_insignificant_dtor, Normal, template!(Word)),
|
rustc_attr!(TEST, rustc_insignificant_dtor, Normal, template!(Word), WarnFollowing),
|
||||||
rustc_attr!(TEST, rustc_variance, Normal, template!(Word)),
|
rustc_attr!(TEST, rustc_strict_coherence, Normal, template!(Word), WarnFollowing),
|
||||||
rustc_attr!(TEST, rustc_layout, Normal, template!(List: "field1, field2, ...")),
|
rustc_attr!(TEST, rustc_variance, Normal, template!(Word), WarnFollowing),
|
||||||
rustc_attr!(TEST, rustc_regions, Normal, template!(Word)),
|
rustc_attr!(TEST, rustc_layout, Normal, template!(List: "field1, field2, ..."), WarnFollowing),
|
||||||
|
rustc_attr!(TEST, rustc_regions, Normal, template!(Word), WarnFollowing),
|
||||||
rustc_attr!(
|
rustc_attr!(
|
||||||
TEST, rustc_error, AssumedUsed,
|
TEST, rustc_error, Normal,
|
||||||
template!(Word, List: "delay_span_bug_from_inside_query")
|
template!(Word, List: "delay_span_bug_from_inside_query"), WarnFollowingWordOnly
|
||||||
),
|
),
|
||||||
rustc_attr!(TEST, rustc_dump_user_substs, AssumedUsed, template!(Word)),
|
rustc_attr!(TEST, rustc_dump_user_substs, Normal, template!(Word), WarnFollowing),
|
||||||
rustc_attr!(TEST, rustc_evaluate_where_clauses, AssumedUsed, template!(Word)),
|
rustc_attr!(TEST, rustc_evaluate_where_clauses, Normal, template!(Word), WarnFollowing),
|
||||||
rustc_attr!(TEST, rustc_if_this_changed, AssumedUsed, template!(Word, List: "DepNode")),
|
|
||||||
rustc_attr!(TEST, rustc_then_this_would_need, AssumedUsed, template!(List: "DepNode")),
|
|
||||||
rustc_attr!(
|
rustc_attr!(
|
||||||
TEST, rustc_clean, AssumedUsed,
|
TEST, rustc_if_this_changed, Normal, template!(Word, List: "DepNode"), DuplicatesOk
|
||||||
|
),
|
||||||
|
rustc_attr!(
|
||||||
|
TEST, rustc_then_this_would_need, Normal, template!(List: "DepNode"), DuplicatesOk
|
||||||
|
),
|
||||||
|
rustc_attr!(
|
||||||
|
TEST, rustc_clean, Normal,
|
||||||
template!(List: r#"cfg = "...", /*opt*/ label = "...", /*opt*/ except = "...""#),
|
template!(List: r#"cfg = "...", /*opt*/ label = "...", /*opt*/ except = "...""#),
|
||||||
|
DuplicatesOk,
|
||||||
),
|
),
|
||||||
rustc_attr!(
|
rustc_attr!(
|
||||||
TEST, rustc_partition_reused, AssumedUsed,
|
TEST, rustc_partition_reused, Normal,
|
||||||
template!(List: r#"cfg = "...", module = "...""#),
|
template!(List: r#"cfg = "...", module = "...""#), DuplicatesOk,
|
||||||
),
|
),
|
||||||
rustc_attr!(
|
rustc_attr!(
|
||||||
TEST, rustc_partition_codegened, AssumedUsed,
|
TEST, rustc_partition_codegened, Normal,
|
||||||
template!(List: r#"cfg = "...", module = "...""#),
|
template!(List: r#"cfg = "...", module = "...""#), DuplicatesOk,
|
||||||
),
|
),
|
||||||
rustc_attr!(
|
rustc_attr!(
|
||||||
TEST, rustc_expected_cgu_reuse, AssumedUsed,
|
TEST, rustc_expected_cgu_reuse, Normal,
|
||||||
template!(List: r#"cfg = "...", module = "...", kind = "...""#),
|
template!(List: r#"cfg = "...", module = "...", kind = "...""#), DuplicatesOk,
|
||||||
),
|
),
|
||||||
rustc_attr!(TEST, rustc_synthetic, AssumedUsed, template!(Word)),
|
rustc_attr!(TEST, rustc_symbol_name, Normal, template!(Word), WarnFollowing),
|
||||||
rustc_attr!(TEST, rustc_symbol_name, AssumedUsed, template!(Word)),
|
rustc_attr!(TEST, rustc_polymorphize_error, Normal, template!(Word), WarnFollowing),
|
||||||
rustc_attr!(TEST, rustc_polymorphize_error, AssumedUsed, template!(Word)),
|
rustc_attr!(TEST, rustc_def_path, Normal, template!(Word), WarnFollowing),
|
||||||
rustc_attr!(TEST, rustc_def_path, AssumedUsed, template!(Word)),
|
rustc_attr!(TEST, rustc_mir, Normal, template!(List: "arg1, arg2, ..."), DuplicatesOk),
|
||||||
rustc_attr!(TEST, rustc_mir, AssumedUsed, template!(List: "arg1, arg2, ...")),
|
rustc_attr!(TEST, rustc_dump_program_clauses, Normal, template!(Word), WarnFollowing),
|
||||||
rustc_attr!(TEST, rustc_dump_program_clauses, AssumedUsed, template!(Word)),
|
rustc_attr!(TEST, rustc_dump_env_program_clauses, Normal, template!(Word), WarnFollowing),
|
||||||
rustc_attr!(TEST, rustc_dump_env_program_clauses, AssumedUsed, template!(Word)),
|
rustc_attr!(TEST, rustc_object_lifetime_default, Normal, template!(Word), WarnFollowing),
|
||||||
rustc_attr!(TEST, rustc_object_lifetime_default, AssumedUsed, template!(Word)),
|
rustc_attr!(TEST, rustc_dump_vtable, Normal, template!(Word), WarnFollowing),
|
||||||
rustc_attr!(TEST, rustc_dump_vtable, AssumedUsed, template!(Word)),
|
rustc_attr!(TEST, rustc_dummy, Normal, template!(Word /* doesn't matter*/), DuplicatesOk),
|
||||||
rustc_attr!(TEST, rustc_dummy, Normal, template!(Word /* doesn't matter*/)),
|
|
||||||
gated!(
|
gated!(
|
||||||
omit_gdb_pretty_printer_section, AssumedUsed, template!(Word),
|
omit_gdb_pretty_printer_section, Normal, template!(Word), WarnFollowing,
|
||||||
"the `#[omit_gdb_pretty_printer_section]` attribute is just used for the Rust test suite",
|
"the `#[omit_gdb_pretty_printer_section]` attribute is just used for the Rust test suite",
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in a new issue