pub const BUILTIN_ATTRIBUTES: &'static [(&'static str, AttributeType, AttributeGate)] =
&[("warn", Normal, Ungated), ("allow", Normal, Ungated),
("forbid", Normal, Ungated), ("deny", Normal, Ungated),
("macro_reexport", Normal, Ungated), ("macro_use", Normal, Ungated),
("macro_export", Normal, Ungated), ("plugin_registrar", Normal, Ungated),
("cfg", Normal, Ungated), ("cfg_attr", Normal, Ungated),
("main", Normal, Ungated), ("start", Normal, Ungated),
("test", Normal, Ungated), ("bench", Normal, Ungated),
("simd", Normal, Ungated), ("repr", Normal, Ungated),
("path", Normal, Ungated), ("abi", Normal, Ungated),
("automatically_derived", Normal, Ungated), ("no_mangle", Normal, Ungated),
("no_link", Normal, Ungated), ("derive", Normal, Ungated),
("should_panic", Normal, Ungated), ("ignore", Normal, Ungated),
("no_implicit_prelude", Normal, Ungated),
("reexport_test_harness_main", Normal, Ungated),
("link_args", Normal, Ungated), ("macro_escape", Normal, Ungated),
("structural_match", Whitelisted,
Gated(Stability::Unstable, "structural_match",
"the semantics of constant patterns is not yet settled",
{
fn f(features: &Features) -> bool { features.structural_match }
f as fn(&Features) -> bool
})), ("no_stack_check", Normal, Ungated),
("plugin", CrateLevel,
Gated(Stability::Unstable, "plugin",
"compiler plugins are experimental and possibly buggy",
{
fn f(features: &Features) -> bool { features.plugin }
f as fn(&Features) -> bool
})), ("no_std", CrateLevel, Ungated),
("no_core", CrateLevel,
Gated(Stability::Unstable, "no_core", "no_core is experimental",
{
fn f(features: &Features) -> bool { features.no_core }
f as fn(&Features) -> bool
})),
("lang", Normal,
Gated(Stability::Unstable, "lang_items",
"language items are subject to change",
{
fn f(features: &Features) -> bool { features.lang_items }
f as fn(&Features) -> bool
})),
("linkage", Whitelisted,
Gated(Stability::Unstable, "linkage",
"the `linkage` attribute is experimental and not portable across platforms",
{
fn f(features: &Features) -> bool { features.linkage }
f as fn(&Features) -> bool
})),
("thread_local", Whitelisted,
Gated(Stability::Unstable, "thread_local",
"`#[thread_local]` is an experimental feature, and does not currently handle destructors. There is no corresponding `#[task_local]` mapping to the task model",
{
fn f(features: &Features) -> bool { features.thread_local }
f as fn(&Features) -> bool
})),
("rustc_on_unimplemented", Normal,
Gated(Stability::Unstable, "on_unimplemented",
"the `#[rustc_on_unimplemented]` attribute is an experimental feature",
{
fn f(features: &Features) -> bool { features.on_unimplemented }
f as fn(&Features) -> bool
})),
("allocator", Whitelisted,
Gated(Stability::Unstable, "allocator",
"the `#[allocator]` attribute is an experimental feature",
{
fn f(features: &Features) -> bool { features.allocator }
f as fn(&Features) -> bool
})),
("needs_allocator", Normal,
Gated(Stability::Unstable, "needs_allocator",
"the `#[needs_allocator]` attribute is an experimental feature",
{
fn f(features: &Features) -> bool { features.needs_allocator }
f as fn(&Features) -> bool
})),
("panic_runtime", Whitelisted,
Gated(Stability::Unstable, "panic_runtime",
"the `#[panic_runtime]` attribute is an experimental feature",
{
fn f(features: &Features) -> bool { features.panic_runtime }
f as fn(&Features) -> bool
})),
("needs_panic_runtime", Whitelisted,
Gated(Stability::Unstable, "needs_panic_runtime",
"the `#[needs_panic_runtime]` attribute is an experimental feature",
{
fn f(features: &Features)
-> bool { features.needs_panic_runtime }
f as fn(&Features) -> bool
})),
("rustc_variance", Normal,
Gated(Stability::Unstable, "rustc_attrs",
"the `#[rustc_variance]` attribute is just used for rustc unit tests and will never be stable",
{
fn f(features: &Features) -> bool { features.rustc_attrs }
f as fn(&Features) -> bool
})),
("rustc_error", Whitelisted,
Gated(Stability::Unstable, "rustc_attrs",
"the `#[rustc_error]` attribute is just used for rustc unit tests and will never be stable",
{
fn f(features: &Features) -> bool { features.rustc_attrs }
f as fn(&Features) -> bool
})),
("rustc_if_this_changed", Whitelisted,
Gated(Stability::Unstable, "rustc_attrs",
"the `#[rustc_if_this_changed]` attribute is just used for rustc unit tests and will never be stable",
{
fn f(features: &Features) -> bool { features.rustc_attrs }
f as fn(&Features) -> bool
})),
("rustc_then_this_would_need", Whitelisted,
Gated(Stability::Unstable, "rustc_attrs",
"the `#[rustc_if_this_changed]` attribute is just used for rustc unit tests and will never be stable",
{
fn f(features: &Features) -> bool { features.rustc_attrs }
f as fn(&Features) -> bool
})),
("rustc_dirty", Whitelisted,
Gated(Stability::Unstable, "rustc_attrs",
"the `#[rustc_dirty]` attribute is just used for rustc unit tests and will never be stable",
{
fn f(features: &Features) -> bool { features.rustc_attrs }
f as fn(&Features) -> bool
})),
("rustc_clean", Whitelisted,
Gated(Stability::Unstable, "rustc_attrs",
"the `#[rustc_clean]` attribute is just used for rustc unit tests and will never be stable",
{
fn f(features: &Features) -> bool { features.rustc_attrs }
f as fn(&Features) -> bool
})),
("rustc_metadata_dirty", Whitelisted,
Gated(Stability::Unstable, "rustc_attrs",
"the `#[rustc_metadata_dirty]` attribute is just used for rustc unit tests and will never be stable",
{
fn f(features: &Features) -> bool { features.rustc_attrs }
f as fn(&Features) -> bool
})),
("rustc_metadata_clean", Whitelisted,
Gated(Stability::Unstable, "rustc_attrs",
"the `#[rustc_metadata_clean]` attribute is just used for rustc unit tests and will never be stable",
{
fn f(features: &Features) -> bool { features.rustc_attrs }
f as fn(&Features) -> bool
})),
("rustc_partition_reused", Whitelisted,
Gated(Stability::Unstable, "rustc_attrs",
"this attribute is just used for rustc unit tests and will never be stable",
{
fn f(features: &Features) -> bool { features.rustc_attrs }
f as fn(&Features) -> bool
})),
("rustc_partition_translated", Whitelisted,
Gated(Stability::Unstable, "rustc_attrs",
"this attribute is just used for rustc unit tests and will never be stable",
{
fn f(features: &Features) -> bool { features.rustc_attrs }
f as fn(&Features) -> bool
})),
("rustc_symbol_name", Whitelisted,
Gated(Stability::Unstable, "rustc_attrs",
"internal rustc attributes will never be stable",
{
fn f(features: &Features) -> bool { features.rustc_attrs }
f as fn(&Features) -> bool
})),
("rustc_item_path", Whitelisted,
Gated(Stability::Unstable, "rustc_attrs",
"internal rustc attributes will never be stable",
{
fn f(features: &Features) -> bool { features.rustc_attrs }
f as fn(&Features) -> bool
})),
("rustc_move_fragments", Normal,
Gated(Stability::Unstable, "rustc_attrs",
"the `#[rustc_move_fragments]` attribute is just used for rustc unit tests and will never be stable",
{
fn f(features: &Features) -> bool { features.rustc_attrs }
f as fn(&Features) -> bool
})),
("rustc_mir", Whitelisted,
Gated(Stability::Unstable, "rustc_attrs",
"the `#[rustc_mir]` attribute is just used for rustc unit tests and will never be stable",
{
fn f(features: &Features) -> bool { features.rustc_attrs }
f as fn(&Features) -> bool
})),
("rustc_inherit_overflow_checks", Whitelisted,
Gated(Stability::Unstable, "rustc_attrs",
"the `#[rustc_inherit_overflow_checks]` attribute is just used to control overflow checking behavior of several libcore functions that are inlined across crates and will never be stable",
{
fn f(features: &Features) -> bool { features.rustc_attrs }
f as fn(&Features) -> bool
})),
("compiler_builtins", Whitelisted,
Gated(Stability::Unstable, "compiler_builtins",
"the `#[compiler_builtins]` attribute is used to identify the `compiler_builtins` crate which contains compiler-rt intrinsics and will never be stable",
{
fn f(features: &Features) -> bool { features.compiler_builtins }
f as fn(&Features) -> bool
})),
("allow_internal_unstable", Normal,
Gated(Stability::Unstable, "allow_internal_unstable",
EXPLAIN_ALLOW_INTERNAL_UNSTABLE,
{
fn f(features: &Features)
-> bool { features.allow_internal_unstable }
f as fn(&Features) -> bool
})),
("fundamental", Whitelisted,
Gated(Stability::Unstable, "fundamental",
"the `#[fundamental]` attribute is an experimental feature",
{
fn f(features: &Features) -> bool { features.fundamental }
f as fn(&Features) -> bool
})), ("proc_macro_derive", Normal, Ungated),
("rustc_copy_clone_marker", Whitelisted,
Gated(Stability::Unstable, "rustc_attrs", "internal implementation detail",
{
fn f(features: &Features) -> bool { features.rustc_attrs }
f as fn(&Features) -> bool
})), ("doc", Whitelisted, Ungated), ("cold", Whitelisted, Ungated),
("naked", Whitelisted,
Gated(Stability::Unstable, "naked_functions",
"the `#[naked]` attribute is an experimental feature",
{
fn f(features: &Features) -> bool { features.naked_functions }
f as fn(&Features) -> bool
})),
("target_feature", Whitelisted,
Gated(Stability::Unstable, "target_feature",
"the `#[target_feature]` attribute is an experimental feature",
{
fn f(features: &Features) -> bool { features.target_feature }
f as fn(&Features) -> bool
})), ("export_name", Whitelisted, Ungated),
("inline", Whitelisted, Ungated), ("link", Whitelisted, Ungated),
("link_name", Whitelisted, Ungated), ("link_section", Whitelisted, Ungated),
("no_builtins", Whitelisted, Ungated), ("no_mangle", Whitelisted, Ungated),
("no_debug", Whitelisted,
Gated(Stability::Deprecated("https://github.com/rust-lang/rust/issues/29721"),
"no_debug", "the `#[no_debug]` attribute is an experimental feature",
{
fn f(features: &Features) -> bool { features.no_debug }
f as fn(&Features) -> bool
})),
("omit_gdb_pretty_printer_section", Whitelisted,
Gated(Stability::Unstable, "omit_gdb_pretty_printer_section",
"the `#[omit_gdb_pretty_printer_section]` attribute is just used for the Rust test suite",
{
fn f(features: &Features)
-> bool { features.omit_gdb_pretty_printer_section }
f as fn(&Features) -> bool
})),
("unsafe_destructor_blind_to_params", Normal,
Gated(Stability::Deprecated("https://github.com/rust-lang/rust/issues/34761"),
"dropck_parametricity",
"unsafe_destructor_blind_to_params has been replaced by may_dangle and will be removed in the future",
{
fn f(features: &Features)
-> bool { features.dropck_parametricity }
f as fn(&Features) -> bool
})),
("may_dangle", Normal,
Gated(Stability::Unstable, "dropck_eyepatch",
"may_dangle has unstable semantics and may be removed in the future",
{
fn f(features: &Features) -> bool { features.dropck_eyepatch }
f as fn(&Features) -> bool
})),
("unwind", Whitelisted,
Gated(Stability::Unstable, "unwind_attributes",
"#[unwind] is experimental",
{
fn f(features: &Features) -> bool { features.unwind_attributes }
f as fn(&Features) -> bool
})),
("prelude_import", Whitelisted,
Gated(Stability::Unstable, "prelude_import",
"`#[prelude_import]` is for use by rustc only",
{
fn f(features: &Features) -> bool { features.prelude_import }
f as fn(&Features) -> bool
})), ("rustc_deprecated", Whitelisted, Ungated),
("must_use", Whitelisted, Ungated), ("stable", Whitelisted, Ungated),
("unstable", Whitelisted, Ungated), ("deprecated", Normal, Ungated),
("rustc_paren_sugar", Normal,
Gated(Stability::Unstable, "unboxed_closures",
"unboxed_closures are still evolving",
{
fn f(features: &Features) -> bool { features.unboxed_closures }
f as fn(&Features) -> bool
})),
("rustc_reflect_like", Whitelisted,
Gated(Stability::Unstable, "reflect",
"defining reflective traits is still evolving",
{
fn f(features: &Features) -> bool { features.reflect }
f as fn(&Features) -> bool
})),
("windows_subsystem", Whitelisted,
Gated(Stability::Unstable, "windows_subsystem",
"the windows subsystem attribute is currently unstable",
{
fn f(features: &Features) -> bool { features.windows_subsystem }
f as fn(&Features) -> bool
})),
("proc_macro_attribute", Normal,
Gated(Stability::Unstable, "proc_macro",
"attribute proc macros are currently unstable",
{
fn f(features: &Features) -> bool { features.proc_macro }
f as fn(&Features) -> bool
})),
("rustc_derive_registrar", Normal,
Gated(Stability::Unstable, "rustc_derive_registrar",
"used internally by rustc",
{
fn f(features: &Features) -> bool { features.rustc_attrs }
f as fn(&Features) -> bool
})), ("crate_name", CrateLevel, Ungated),
("crate_type", CrateLevel, Ungated), ("crate_id", CrateLevel, Ungated),
("feature", CrateLevel, Ungated), ("no_start", CrateLevel, Ungated),
("no_main", CrateLevel, Ungated), ("no_builtins", CrateLevel, Ungated),
("recursion_limit", CrateLevel, Ungated),
("type_length_limit", CrateLevel, Ungated)]