From 26e9990198d3c7262d58468f18a722920c897e35 Mon Sep 17 00:00:00 2001 From: Oliver Scherer Date: Sun, 19 May 2019 20:16:04 +0200 Subject: Add a "diagnostic item" scheme This allows lints and other diagnostics to refer to items by a unique ID instead of relying on whacky path resolution schemes that may break when items are relocated. --- src/libsyntax/feature_gate/builtin_attrs.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/libsyntax') diff --git a/src/libsyntax/feature_gate/builtin_attrs.rs b/src/libsyntax/feature_gate/builtin_attrs.rs index b934f2e7f64..ee7ac3b15d9 100644 --- a/src/libsyntax/feature_gate/builtin_attrs.rs +++ b/src/libsyntax/feature_gate/builtin_attrs.rs @@ -461,6 +461,17 @@ pub const BUILTIN_ATTRIBUTES: &[BuiltinAttribute] = &[ lang, Normal, template!(NameValueStr: "name"), lang_items, "language items are subject to change", ), + ( + sym::rustc_diagnostic_item, + Normal, + template!(NameValueStr: "name"), + Gated( + Stability::Unstable, + sym::rustc_attrs, + "diagnostic items compiler internal support for linting", + cfg_fn!(rustc_attrs), + ), + ), ( sym::no_debug, Whitelisted, template!(Word), Gated( -- cgit 1.4.1-3-g733a5