]> git.lizzy.rs Git - rust.git/commit
macros: support `MultiSpan` in diag derives
authorDavid Wood <david.wood@huawei.com>
Mon, 11 Jul 2022 16:15:31 +0000 (17:15 +0100)
committerDavid Wood <david.wood@huawei.com>
Fri, 15 Jul 2022 15:13:49 +0000 (16:13 +0100)
commit88c11c5bfffea445c6cc49b62da17f172eb8f055
tree1b5cbd5bd5b9a384bbd6ed7830777f42ba39c309
parentc3fdf748856fa220dc251647808db8535ac0bba2
macros: support `MultiSpan` in diag derives

Add support for `MultiSpan` with any of the attributes that work on a
`Span` - requires that diagnostic logic generated for these attributes
are emitted in the by-move block rather than the by-ref block that they
would normally have been generated in.

Signed-off-by: David Wood <david.wood@huawei.com>
compiler/rustc_macros/src/diagnostics/diagnostic_builder.rs
compiler/rustc_macros/src/diagnostics/utils.rs
src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.rs
src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr
src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs
src/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive.stderr