macros: spanless subdiagnostics from () fields

Type attributes could previously be used to support spanless
subdiagnostics but these couldn't easily be made optional in the same
way that spanned subdiagnostics could by using a field attribute on a
field with an `Option<Span>` type. Spanless subdiagnostics can now be
specified on fields with `()` type or `Option<()>` type.

Signed-off-by: David Wood <david.wood@huawei.com>
This commit is contained in:
David Wood
2022-05-07 06:02:11 +01:00
parent 1d2ea98cff
commit 7b7061dd89
4 changed files with 97 additions and 33 deletions

View File

@@ -1,5 +1,6 @@
#![feature(allow_internal_unstable)]
#![feature(let_else)]
#![feature(never_type)]
#![feature(proc_macro_diagnostic)]
#![allow(rustc::default_hash_types)]
#![recursion_limit = "128"]