diff options
| author | Deadbeef <ent3rm4n@gmail.com> | 2023-04-03 15:11:30 +0000 |
|---|---|---|
| committer | Deadbeef <ent3rm4n@gmail.com> | 2023-04-06 04:55:58 +0000 |
| commit | 25fdea009ef0db01134d17cf97cd09b507beca99 (patch) | |
| tree | a48b7bad24ef7e044e000254c25f8763100fe677 /compiler/rustc_macros | |
| parent | fc01b4b63c5336a0f296b049525e18798b95b374 (diff) | |
| download | rust-25fdea009ef0db01134d17cf97cd09b507beca99.tar.gz rust-25fdea009ef0db01134d17cf97cd09b507beca99.zip | |
fix errors
Diffstat (limited to 'compiler/rustc_macros')
| -rw-r--r-- | compiler/rustc_macros/src/diagnostics/subdiagnostic.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_macros/src/diagnostics/utils.rs | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_macros/src/diagnostics/subdiagnostic.rs b/compiler/rustc_macros/src/diagnostics/subdiagnostic.rs index 2f42a3b0bd4..62d49c1c64e 100644 --- a/compiler/rustc_macros/src/diagnostics/subdiagnostic.rs +++ b/compiler/rustc_macros/src/diagnostics/subdiagnostic.rs @@ -422,6 +422,7 @@ impl<'parent, 'a> SubdiagnosticDeriveVariantBuilder<'parent, 'a> { list.parse_nested_meta(|nested| { if nested.path.is_ident("code") { let code_field = new_code_ident(); + let span = nested.path.span().unwrap(); let formatting_init = build_suggestion_code( &code_field, nested, diff --git a/compiler/rustc_macros/src/diagnostics/utils.rs b/compiler/rustc_macros/src/diagnostics/utils.rs index bc104941c38..838347ecb61 100644 --- a/compiler/rustc_macros/src/diagnostics/utils.rs +++ b/compiler/rustc_macros/src/diagnostics/utils.rs @@ -727,7 +727,7 @@ impl SubdiagnosticKind { fields, AllowMultipleAlternatives::Yes, ); - code.set_once(code_init, span); + code.set_once(code_init, path_span); } ( "applicability", |
