macros: subdiagnostic derive
Add a new derive, `#[derive(SessionSubdiagnostic)]`, which enables deriving structs for labels, notes, helps and suggestions. Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
parent
aa2abc9d12
commit
49ec909ca7
10 changed files with 1735 additions and 151 deletions
|
@ -1,5 +1,6 @@
|
|||
#![feature(proc_macro_diagnostic)]
|
||||
#![feature(allow_internal_unstable)]
|
||||
#![feature(let_else)]
|
||||
#![feature(proc_macro_diagnostic)]
|
||||
#![allow(rustc::default_hash_types)]
|
||||
#![recursion_limit = "128"]
|
||||
|
||||
|
@ -77,3 +78,18 @@ decl_derive!(
|
|||
suggestion_hidden,
|
||||
suggestion_verbose)] => session_diagnostic::session_diagnostic_derive
|
||||
);
|
||||
decl_derive!(
|
||||
[SessionSubdiagnostic, attributes(
|
||||
// struct/variant attributes
|
||||
label,
|
||||
help,
|
||||
note,
|
||||
suggestion,
|
||||
suggestion_short,
|
||||
suggestion_hidden,
|
||||
suggestion_verbose,
|
||||
// field attributes
|
||||
skip_arg,
|
||||
primary_span,
|
||||
applicability)] => session_diagnostic::session_subdiagnostic_derive
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue