1 //! Builtin attributes resolved by nameres.
3 //! The actual definitions were copied from rustc's `compiler/rustc_feature/src/builtin_attrs.rs`.
5 //! It was last synchronized with upstream commit c1a2db3372a4d6896744919284f3287650a38ab7.
7 //! The macros were adjusted to only expand to the attribute name, since that is all we need to do
8 //! name resolution, and `BUILTIN_ATTRIBUTES` is almost entirely unchanged from the original, to
11 use once_cell::sync::OnceCell;
12 use rustc_hash::FxHashMap;
14 /// Ignored attribute namespaces used by tools.
15 pub const TOOL_MODULES: &[&str] = &["rustfmt", "clippy"];
17 pub struct BuiltinAttribute {
18 pub name: &'static str,
19 pub template: AttributeTemplate,
22 /// A template that the attribute input must match.
23 /// Only top-level shape (`#[attr]` vs `#[attr(...)]` vs `#[attr = ...]`) is considered now.
24 #[derive(Clone, Copy)]
25 pub struct AttributeTemplate {
27 pub list: Option<&'static str>,
28 pub name_value_str: Option<&'static str>,
31 pub fn find_builtin_attr_idx(name: &str) -> Option<usize> {
32 static BUILTIN_LOOKUP_TABLE: OnceCell<FxHashMap<&'static str, usize>> = OnceCell::new();
35 INERT_ATTRIBUTES.iter().map(|attr| attr.name).enumerate().map(|(a, b)| (b, a)).collect()
41 // impl AttributeTemplate {
42 // const DEFAULT: AttributeTemplate =
43 // AttributeTemplate { word: false, list: None, name_value_str: None };
46 /// A convenience macro for constructing attribute templates.
47 /// E.g., `template!(Word, List: "description")` means that the attribute
48 /// supports forms `#[attr]` and `#[attr(description)]`.
49 macro_rules! template {
50 (Word) => { template!(@ true, None, None) };
51 (List: $descr: expr) => { template!(@ false, Some($descr), None) };
52 (NameValueStr: $descr: expr) => { template!(@ false, None, Some($descr)) };
53 (Word, List: $descr: expr) => { template!(@ true, Some($descr), None) };
54 (Word, NameValueStr: $descr: expr) => { template!(@ true, None, Some($descr)) };
55 (List: $descr1: expr, NameValueStr: $descr2: expr) => {
56 template!(@ false, Some($descr1), Some($descr2))
58 (Word, List: $descr1: expr, NameValueStr: $descr2: expr) => {
59 template!(@ true, Some($descr1), Some($descr2))
61 (@ $word: expr, $list: expr, $name_value_str: expr) => {
63 word: $word, list: $list, name_value_str: $name_value_str
68 macro_rules! ungated {
69 ($attr:ident, $typ:expr, $tpl:expr, $duplicates:expr $(, @only_local: $only_local:expr)? $(,)?) => {
70 BuiltinAttribute { name: stringify!($attr), template: $tpl }
75 ($attr:ident, $typ:expr, $tpl:expr, $duplicates:expr $(, @only_local: $only_local:expr)?, $gate:ident, $msg:expr $(,)?) => {
76 BuiltinAttribute { name: stringify!($attr), template: $tpl }
78 ($attr:ident, $typ:expr, $tpl:expr, $duplicates:expr $(, @only_local: $only_local:expr)?, $msg:expr $(,)?) => {
79 BuiltinAttribute { name: stringify!($attr), template: $tpl }
83 macro_rules! rustc_attr {
84 (TEST, $attr:ident, $typ:expr, $tpl:expr, $duplicate:expr $(, @only_local: $only_local:expr)? $(,)?) => {
90 $(@only_local: $only_local,)?
94 "]` attribute is just used for rustc unit tests \
95 and will never be stable",
99 ($attr:ident, $typ:expr, $tpl:expr, $duplicates:expr $(, @only_local: $only_local:expr)?, $msg:expr $(,)?) => {
100 BuiltinAttribute { name: stringify!($attr), template: $tpl }
104 #[allow(unused_macros)]
105 macro_rules! experimental {
107 concat!("the `#[", stringify!($attr), "]` attribute is an experimental feature")
111 /// "Inert" built-in attributes that have a special meaning to rustc or rustdoc.
113 pub const INERT_ATTRIBUTES: &[BuiltinAttribute] = &[
114 // ==========================================================================
115 // Stable attributes:
116 // ==========================================================================
118 // Conditional compilation:
119 ungated!(cfg, Normal, template!(List: "predicate"), DuplicatesOk),
120 ungated!(cfg_attr, Normal, template!(List: "predicate, attr1, attr2, ..."), DuplicatesOk),
123 ungated!(ignore, Normal, template!(Word, NameValueStr: "reason"), WarnFollowing),
125 should_panic, Normal,
126 template!(Word, List: r#"expected = "reason"#, NameValueStr: "reason"), FutureWarnFollowing,
128 // FIXME(Centril): This can be used on stable but shouldn't.
129 ungated!(reexport_test_harness_main, CrateLevel, template!(NameValueStr: "name"), ErrorFollowing),
132 ungated!(automatically_derived, Normal, template!(Word), WarnFollowing),
133 ungated!(macro_use, Normal, template!(Word, List: "name1, name2, ..."), WarnFollowingWordOnly),
134 ungated!(macro_escape, Normal, template!(Word), WarnFollowing), // Deprecated synonym for `macro_use`.
135 ungated!(macro_export, Normal, template!(Word, List: "local_inner_macros"), WarnFollowing),
136 ungated!(proc_macro, Normal, template!(Word), ErrorFollowing),
138 proc_macro_derive, Normal,
139 template!(List: "TraitName, /*opt*/ attributes(name1, name2, ...)"), ErrorFollowing,
141 ungated!(proc_macro_attribute, Normal, template!(Word), ErrorFollowing),
145 warn, Normal, template!(List: r#"lint1, lint2, ..., /*opt*/ reason = "...""#), DuplicatesOk
148 allow, Normal, template!(List: r#"lint1, lint2, ..., /*opt*/ reason = "...""#), DuplicatesOk
151 expect, Normal, template!(List: r#"lint1, lint2, ..., /*opt*/ reason = "...""#), DuplicatesOk,
152 lint_reasons, experimental!(expect)
155 forbid, Normal, template!(List: r#"lint1, lint2, ..., /*opt*/ reason = "...""#), DuplicatesOk
158 deny, Normal, template!(List: r#"lint1, lint2, ..., /*opt*/ reason = "...""#), DuplicatesOk
160 ungated!(must_use, Normal, template!(Word, NameValueStr: "reason"), FutureWarnFollowing),
162 must_not_suspend, Normal, template!(Word, NameValueStr: "reason"), WarnFollowing,
163 experimental!(must_not_suspend)
169 List: r#"/*opt*/ since = "version", /*opt*/ note = "reason""#,
170 NameValueStr: "reason"
176 ungated!(crate_name, CrateLevel, template!(NameValueStr: "name"), FutureWarnFollowing),
177 ungated!(crate_type, CrateLevel, template!(NameValueStr: "bin|lib|..."), DuplicatesOk),
178 // crate_id is deprecated
179 ungated!(crate_id, CrateLevel, template!(NameValueStr: "ignored"), FutureWarnFollowing),
181 // ABI, linking, symbols, and FFI
184 template!(List: r#"name = "...", /*opt*/ kind = "dylib|static|...", /*opt*/ wasm_import_module = "...""#),
187 ungated!(link_name, Normal, template!(NameValueStr: "name"), FutureWarnPreceding),
188 ungated!(no_link, Normal, template!(Word), WarnFollowing),
189 ungated!(repr, Normal, template!(List: "C"), DuplicatesOk),
190 ungated!(export_name, Normal, template!(NameValueStr: "name"), FutureWarnPreceding),
191 ungated!(link_section, Normal, template!(NameValueStr: "name"), FutureWarnPreceding),
192 ungated!(no_mangle, Normal, template!(Word), WarnFollowing, @only_local: true),
193 ungated!(used, Normal, template!(Word, List: "compiler|linker"), WarnFollowing, @only_local: true),
196 ungated!(recursion_limit, CrateLevel, template!(NameValueStr: "N"), FutureWarnFollowing),
197 ungated!(type_length_limit, CrateLevel, template!(NameValueStr: "N"), FutureWarnFollowing),
199 const_eval_limit, CrateLevel, template!(NameValueStr: "N"), ErrorFollowing,
200 const_eval_limit, experimental!(const_eval_limit)
203 move_size_limit, CrateLevel, template!(NameValueStr: "N"), ErrorFollowing,
204 large_assignments, experimental!(move_size_limit)
208 ungated!(start, Normal, template!(Word), WarnFollowing),
209 ungated!(no_start, CrateLevel, template!(Word), WarnFollowing),
210 ungated!(no_main, CrateLevel, template!(Word), WarnFollowing),
212 // Modules, prelude, and resolution:
213 ungated!(path, Normal, template!(NameValueStr: "file"), FutureWarnFollowing),
214 ungated!(no_std, CrateLevel, template!(Word), WarnFollowing),
215 ungated!(no_implicit_prelude, Normal, template!(Word), WarnFollowing),
216 ungated!(non_exhaustive, Normal, template!(Word), WarnFollowing),
220 windows_subsystem, CrateLevel,
221 template!(NameValueStr: "windows|console"), FutureWarnFollowing
223 ungated!(panic_handler, Normal, template!(Word), WarnFollowing), // RFC 2070
226 ungated!(inline, Normal, template!(Word, List: "always|never"), FutureWarnFollowing, @only_local: true),
227 ungated!(cold, Normal, template!(Word), WarnFollowing, @only_local: true),
228 ungated!(no_builtins, CrateLevel, template!(Word), WarnFollowing),
229 ungated!(target_feature, Normal, template!(List: r#"enable = "name""#), DuplicatesOk),
230 ungated!(track_caller, Normal, template!(Word), WarnFollowing),
233 template!(List: "address, memory, thread"), DuplicatesOk,
234 experimental!(no_sanitize)
236 gated!(no_coverage, Normal, template!(Word), WarnFollowing, experimental!(no_coverage)),
239 doc, Normal, template!(List: "hidden|inline|...", NameValueStr: "string"), DuplicatesOk
242 // ==========================================================================
243 // Unstable attributes:
244 // ==========================================================================
246 // RFC #3191: #[debugger_visualizer] support
248 debugger_visualizer, Normal, template!(List: r#"natvis_file = "...", gdb_script_file = "...""#),
249 DuplicatesOk, experimental!(debugger_visualizer)
253 gated!(naked, Normal, template!(Word), WarnFollowing, @only_local: true, naked_functions, experimental!(naked)),
255 link_ordinal, Normal, template!(List: "ordinal"), ErrorPreceding, raw_dylib,
256 experimental!(link_ordinal)
260 // XXX Modified for use in rust-analyzer
261 // BuiltinAttribute {
262 // name: sym::plugin,
263 // only_local: false,
264 // type_: CrateLevel,
265 // template: template!(List: "name"),
266 // duplicates: DuplicatesOk,
268 // Stability::Deprecated(
269 // "https://github.com/rust-lang/rust/pull/64675",
270 // Some("may be removed in a future compiler version"),
273 // "compiler plugins are deprecated",
279 template: template!(List: "name"),
284 test_runner, CrateLevel, template!(List: "path"), ErrorFollowing, custom_test_frameworks,
285 "custom test frameworks are an unstable feature",
289 marker, Normal, template!(Word), WarnFollowing, marker_trait_attr, experimental!(marker)
292 thread_local, Normal, template!(Word), WarnFollowing,
293 "`#[thread_local]` is an experimental feature, and does not currently handle destructors",
295 gated!(no_core, CrateLevel, template!(Word), WarnFollowing, experimental!(no_core)),
298 optimize, Normal, template!(List: "size|speed"), ErrorPreceding, optimize_attribute,
299 experimental!(optimize),
303 instruction_set, Normal, template!(List: "set"), ErrorPreceding,
304 isa_attribute, experimental!(instruction_set)
308 ffi_returns_twice, Normal, template!(Word), WarnFollowing, experimental!(ffi_returns_twice)
310 gated!(ffi_pure, Normal, template!(Word), WarnFollowing, experimental!(ffi_pure)),
311 gated!(ffi_const, Normal, template!(Word), WarnFollowing, experimental!(ffi_const)),
313 register_attr, CrateLevel, template!(List: "attr1, attr2, ..."), DuplicatesOk,
314 experimental!(register_attr),
317 register_tool, CrateLevel, template!(List: "tool1, tool2, ..."), DuplicatesOk,
318 experimental!(register_tool),
322 cmse_nonsecure_entry, Normal, template!(Word), WarnFollowing,
323 experimental!(cmse_nonsecure_entry)
327 const_trait, Normal, template!(Word), WarnFollowing, const_trait_impl,
328 "`const` is a temporary placeholder for marking a trait that is suitable for `const` \
329 `impls` and all default bodies as `const`, which may be removed or renamed in the \
334 deprecated_safe, Normal, template!(List: r#"since = "version", note = "...""#), ErrorFollowing,
335 experimental!(deprecated_safe),
338 // ==========================================================================
339 // Internal attributes: Stability, deprecation, and unsafe:
340 // ==========================================================================
342 ungated!(feature, CrateLevel, template!(List: "name1, name2, ..."), DuplicatesOk),
343 // DuplicatesOk since it has its own validation
345 stable, Normal, template!(List: r#"feature = "name", since = "version""#), DuplicatesOk,
349 template!(List: r#"feature = "name", reason = "...", issue = "N""#), DuplicatesOk,
351 ungated!(rustc_const_unstable, Normal, template!(List: r#"feature = "name""#), DuplicatesOk),
352 ungated!(rustc_const_stable, Normal, template!(List: r#"feature = "name""#), DuplicatesOk),
354 allow_internal_unstable, Normal, template!(Word, List: "feat1, feat2, ..."), DuplicatesOk,
355 "allow_internal_unstable side-steps feature gating and stability checks",
358 rustc_allow_const_fn_unstable, Normal,
359 template!(Word, List: "feat1, feat2, ..."), DuplicatesOk,
360 "rustc_allow_const_fn_unstable side-steps feature gating and stability checks"
363 allow_internal_unsafe, Normal, template!(Word), WarnFollowing,
364 "allow_internal_unsafe side-steps the unsafe_code lint",
367 // ==========================================================================
368 // Internal attributes: Type system related:
369 // ==========================================================================
371 gated!(fundamental, Normal, template!(Word), WarnFollowing, experimental!(fundamental)),
373 may_dangle, Normal, template!(Word), WarnFollowing, dropck_eyepatch,
374 "`may_dangle` has unstable semantics and may be removed in the future",
377 // ==========================================================================
378 // Internal attributes: Runtime related:
379 // ==========================================================================
381 rustc_attr!(rustc_allocator, Normal, template!(Word), WarnFollowing, IMPL_DETAIL),
382 rustc_attr!(rustc_allocator_nounwind, Normal, template!(Word), WarnFollowing, IMPL_DETAIL),
384 alloc_error_handler, Normal, template!(Word), WarnFollowing,
385 experimental!(alloc_error_handler)
388 default_lib_allocator, Normal, template!(Word), WarnFollowing, allocator_internals,
389 experimental!(default_lib_allocator),
392 needs_allocator, Normal, template!(Word), WarnFollowing, allocator_internals,
393 experimental!(needs_allocator),
395 gated!(panic_runtime, Normal, template!(Word), WarnFollowing, experimental!(panic_runtime)),
397 needs_panic_runtime, Normal, template!(Word), WarnFollowing,
398 experimental!(needs_panic_runtime)
401 compiler_builtins, Normal, template!(Word), WarnFollowing,
402 "the `#[compiler_builtins]` attribute is used to identify the `compiler_builtins` crate \
403 which contains compiler-rt intrinsics and will never be stable",
406 profiler_runtime, Normal, template!(Word), WarnFollowing,
407 "the `#[profiler_runtime]` attribute is used to identify the `profiler_builtins` crate \
408 which contains the profiler runtime and will never be stable",
411 // ==========================================================================
412 // Internal attributes, Linkage:
413 // ==========================================================================
416 linkage, Normal, template!(NameValueStr: "external|internal|..."), ErrorPreceding, @only_local: true,
417 "the `linkage` attribute is experimental and not portable across platforms",
420 rustc_std_internal_symbol, Normal, template!(Word), WarnFollowing, @only_local: true, INTERNAL_UNSTABLE
423 // ==========================================================================
424 // Internal attributes, Macro related:
425 // ==========================================================================
428 rustc_builtin_macro, Normal,
429 template!(Word, List: "name, /*opt*/ attributes(name1, name2, ...)"), ErrorFollowing,
432 rustc_attr!(rustc_proc_macro_decls, Normal, template!(Word), WarnFollowing, INTERNAL_UNSTABLE),
434 rustc_macro_transparency, Normal,
435 template!(NameValueStr: "transparent|semitransparent|opaque"), ErrorFollowing,
436 "used internally for testing macro hygiene",
439 // ==========================================================================
440 // Internal attributes, Diagnostics related:
441 // ==========================================================================
444 rustc_on_unimplemented, Normal,
446 List: r#"/*opt*/ message = "...", /*opt*/ label = "...", /*opt*/ note = "...""#,
447 NameValueStr: "message"
452 // Enumerates "identity-like" conversion methods to suggest on type mismatch.
454 rustc_conversion_suggestion, Normal, template!(Word), WarnFollowing, INTERNAL_UNSTABLE
456 // Prevents field reads in the marked trait or method to be considered
457 // during dead code analysis.
459 rustc_trivial_field_reads, Normal, template!(Word), WarnFollowing, INTERNAL_UNSTABLE
461 // Used by the `rustc::potential_query_instability` lint to warn methods which
462 // might not be stable during incremental compilation.
463 rustc_attr!(rustc_lint_query_instability, Normal, template!(Word), WarnFollowing, INTERNAL_UNSTABLE),
464 // Used by the `rustc::untranslatable_diagnostic` and `rustc::diagnostic_outside_of_impl` lints
465 // to assist in changes to diagnostic APIs.
466 rustc_attr!(rustc_lint_diagnostics, Normal, template!(Word), WarnFollowing, INTERNAL_UNSTABLE),
468 // ==========================================================================
469 // Internal attributes, Const related:
470 // ==========================================================================
472 rustc_attr!(rustc_promotable, Normal, template!(Word), WarnFollowing, IMPL_DETAIL),
474 rustc_legacy_const_generics, Normal, template!(List: "N"), ErrorFollowing,
477 // Do not const-check this function's body. It will always get replaced during CTFE.
479 rustc_do_not_const_check, Normal, template!(Word), WarnFollowing, INTERNAL_UNSTABLE
482 // ==========================================================================
483 // Internal attributes, Layout related:
484 // ==========================================================================
487 rustc_layout_scalar_valid_range_start, Normal, template!(List: "value"), ErrorFollowing,
488 "the `#[rustc_layout_scalar_valid_range_start]` attribute is just used to enable \
489 niche optimizations in libcore and libstd and will never be stable",
492 rustc_layout_scalar_valid_range_end, Normal, template!(List: "value"), ErrorFollowing,
493 "the `#[rustc_layout_scalar_valid_range_end]` attribute is just used to enable \
494 niche optimizations in libcore and libstd and will never be stable",
497 rustc_nonnull_optimization_guaranteed, Normal, template!(Word), WarnFollowing,
498 "the `#[rustc_nonnull_optimization_guaranteed]` attribute is just used to enable \
499 niche optimizations in libcore and libstd and will never be stable",
502 // ==========================================================================
503 // Internal attributes, Misc:
504 // ==========================================================================
506 lang, Normal, template!(NameValueStr: "name"), DuplicatesOk, @only_local: true, lang_items,
507 "language items are subject to change",
510 rustc_pass_by_value, Normal,
511 template!(Word), ErrorFollowing,
512 "#[rustc_pass_by_value] is used to mark types that must be passed by value instead of reference."
515 rustc_coherence_is_core, AttributeType::CrateLevel, template!(Word), ErrorFollowing, @only_local: true,
516 "#![rustc_coherence_is_core] allows inherent methods on builtin types, only intended to be used in `core`."
519 rustc_allow_incoherent_impl, AttributeType::Normal, template!(Word), ErrorFollowing, @only_local: true,
520 "#[rustc_allow_incoherent_impl] has to be added to all impl items of an incoherent inherent impl."
523 rustc_has_incoherent_inherent_impls, AttributeType::Normal, template!(Word), ErrorFollowing,
524 "#[rustc_has_incoherent_inherent_impls] allows the addition of incoherent inherent impls for \
525 the given type by annotating all impl items with #[rustc_allow_incoherent_impl]."
528 rustc_box, AttributeType::Normal, template!(Word), ErrorFollowing,
529 "#[rustc_box] allows creating boxes \
530 and it is only intended to be used in `alloc`."
534 // BuiltinAttribute {
535 // name: sym::rustc_diagnostic_item,
536 // // FIXME: This can be `true` once we always use `tcx.is_diagnostic_item`.
537 // only_local: false,
539 // template: template!(NameValueStr: "name"),
540 // duplicates: ErrorFollowing,
542 // Stability::Unstable,
544 // "diagnostic items compiler internal support for linting",
545 // cfg_fn!(rustc_attrs),
549 name: "rustc_diagnostic_item",
550 template: template!(NameValueStr: "name"),
554 prelude_import, Normal, template!(Word), WarnFollowing,
555 "`#[prelude_import]` is for use by rustc only",
558 rustc_paren_sugar, Normal, template!(Word), WarnFollowing, unboxed_closures,
559 "unboxed_closures are still evolving",
562 rustc_inherit_overflow_checks, Normal, template!(Word), WarnFollowing, @only_local: true,
563 "the `#[rustc_inherit_overflow_checks]` attribute is just used to control \
564 overflow checking behavior of several libcore functions that are inlined \
565 across crates and will never be stable",
568 rustc_reservation_impl, Normal,
569 template!(NameValueStr: "reservation message"), ErrorFollowing,
570 "the `#[rustc_reservation_impl]` attribute is internally used \
571 for reserving for `for<T> From<!> for T` impl"
574 rustc_test_marker, Normal, template!(Word), WarnFollowing,
575 "the `#[rustc_test_marker]` attribute is used internally to track tests",
578 rustc_unsafe_specialization_marker, Normal, template!(Word), WarnFollowing,
579 "the `#[rustc_unsafe_specialization_marker]` attribute is used to check specializations"
582 rustc_specialization_trait, Normal, template!(Word), WarnFollowing,
583 "the `#[rustc_specialization_trait]` attribute is used to check specializations"
586 rustc_main, Normal, template!(Word), WarnFollowing,
587 "the `#[rustc_main]` attribute is used internally to specify test entry point function",
590 rustc_skip_array_during_method_dispatch, Normal, template!(Word), WarnFollowing,
591 "the `#[rustc_skip_array_during_method_dispatch]` attribute is used to exclude a trait \
592 from method dispatch when the receiver is an array, for compatibility in editions < 2021."
595 rustc_must_implement_one_of, Normal, template!(List: "function1, function2, ..."), ErrorFollowing,
596 "the `#[rustc_must_implement_one_of]` attribute is used to change minimal complete \
597 definition of a trait, it's currently in experimental form and should be changed before \
598 being exposed outside of the std"
601 // ==========================================================================
602 // Internal attributes, Testing:
603 // ==========================================================================
605 rustc_attr!(TEST, rustc_outlives, Normal, template!(Word), WarnFollowing),
606 rustc_attr!(TEST, rustc_capture_analysis, Normal, template!(Word), WarnFollowing),
607 rustc_attr!(TEST, rustc_insignificant_dtor, Normal, template!(Word), WarnFollowing),
608 rustc_attr!(TEST, rustc_strict_coherence, Normal, template!(Word), WarnFollowing),
609 rustc_attr!(TEST, rustc_variance, Normal, template!(Word), WarnFollowing),
610 rustc_attr!(TEST, rustc_layout, Normal, template!(List: "field1, field2, ..."), WarnFollowing),
611 rustc_attr!(TEST, rustc_regions, Normal, template!(Word), WarnFollowing),
613 TEST, rustc_error, Normal,
614 template!(Word, List: "delay_span_bug_from_inside_query"), WarnFollowingWordOnly
616 rustc_attr!(TEST, rustc_dump_user_substs, Normal, template!(Word), WarnFollowing),
617 rustc_attr!(TEST, rustc_evaluate_where_clauses, Normal, template!(Word), WarnFollowing),
619 TEST, rustc_if_this_changed, Normal, template!(Word, List: "DepNode"), DuplicatesOk
622 TEST, rustc_then_this_would_need, Normal, template!(List: "DepNode"), DuplicatesOk
625 TEST, rustc_clean, Normal,
626 template!(List: r#"cfg = "...", /*opt*/ label = "...", /*opt*/ except = "...""#),
630 TEST, rustc_partition_reused, Normal,
631 template!(List: r#"cfg = "...", module = "...""#), DuplicatesOk,
634 TEST, rustc_partition_codegened, Normal,
635 template!(List: r#"cfg = "...", module = "...""#), DuplicatesOk,
638 TEST, rustc_expected_cgu_reuse, Normal,
639 template!(List: r#"cfg = "...", module = "...", kind = "...""#), DuplicatesOk,
641 rustc_attr!(TEST, rustc_symbol_name, Normal, template!(Word), WarnFollowing),
642 rustc_attr!(TEST, rustc_polymorphize_error, Normal, template!(Word), WarnFollowing),
643 rustc_attr!(TEST, rustc_def_path, Normal, template!(Word), WarnFollowing),
644 rustc_attr!(TEST, rustc_mir, Normal, template!(List: "arg1, arg2, ..."), DuplicatesOk),
645 rustc_attr!(TEST, rustc_dump_program_clauses, Normal, template!(Word), WarnFollowing),
646 rustc_attr!(TEST, rustc_dump_env_program_clauses, Normal, template!(Word), WarnFollowing),
647 rustc_attr!(TEST, rustc_object_lifetime_default, Normal, template!(Word), WarnFollowing),
648 rustc_attr!(TEST, rustc_dump_vtable, Normal, template!(Word), WarnFollowing),
649 rustc_attr!(TEST, rustc_dummy, Normal, template!(Word /* doesn't matter*/), DuplicatesOk),
651 omit_gdb_pretty_printer_section, Normal, template!(Word), WarnFollowing,
652 "the `#[omit_gdb_pretty_printer_section]` attribute is just used for the Rust test suite",