diff options
| author | Georg Semmler <github@weiznich.de> | 2023-06-02 13:55:46 +0200 |
|---|---|---|
| committer | Georg Semmler <github@weiznich.de> | 2023-09-12 20:03:18 +0200 |
| commit | 5b8a7a09178f73a581db2b21cf516fea7be9b49f (patch) | |
| tree | 369b9a76b0f426403c66d007390830fb15208f89 /compiler/rustc_resolve/src | |
| parent | e5fedceabf4e0564231db592b6d1f35e1ca27908 (diff) | |
| download | rust-5b8a7a09178f73a581db2b21cf516fea7be9b49f.tar.gz rust-5b8a7a09178f73a581db2b21cf516fea7be9b49f.zip | |
`#[diagnostic::on_unimplemented]` without filters
This commit adds support for a `#[diagnostic::on_unimplemented]` attribute with the following options: * `message` to customize the primary error message * `note` to add a customized note message to an error message * `label` to customize the label part of the error message Co-authored-by: León Orell Valerian Liehr <me@fmease.dev> Co-authored-by: Michael Goulet <michael@errs.io>
Diffstat (limited to 'compiler/rustc_resolve/src')
| -rw-r--r-- | compiler/rustc_resolve/src/macros.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_resolve/src/macros.rs b/compiler/rustc_resolve/src/macros.rs index 82060716575..90ae08ce37c 100644 --- a/compiler/rustc_resolve/src/macros.rs +++ b/compiler/rustc_resolve/src/macros.rs @@ -26,7 +26,7 @@ use rustc_middle::middle::stability; use rustc_middle::ty::RegisteredTools; use rustc_middle::ty::{TyCtxt, Visibility}; use rustc_session::lint::builtin::{ - LEGACY_DERIVE_HELPERS, SOFT_UNSTABLE, UNKNOWN_DIAGNOSTIC_ATTRIBUTES, + LEGACY_DERIVE_HELPERS, SOFT_UNSTABLE, UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES, }; use rustc_session::lint::builtin::{UNUSED_MACROS, UNUSED_MACRO_RULES}; use rustc_session::lint::BuiltinLintDiagnostics; @@ -610,9 +610,10 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { if res == Res::NonMacroAttr(NonMacroAttrKind::Tool) && path.segments.len() >= 2 && path.segments[0].ident.name == sym::diagnostic + && path.segments[1].ident.name != sym::on_unimplemented { self.tcx.sess.parse_sess.buffer_lint( - UNKNOWN_DIAGNOSTIC_ATTRIBUTES, + UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES, path.segments[1].span(), node_id, "unknown diagnostic attribute", |
