X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_ast_lowering%2Fsrc%2Ferrors.rs;h=63ff64b00bed617fc009d611398c0ff30e67cac4;hb=a8f7e244b785feb1b1d696abf0a7efb5cb7aed30;hp=1ad5fa21d8530515976b9a4c60131fd19c28d125;hpb=7a8636c843bd24038fe1d1f69b4a8e4b0ea55d4e;p=rust.git diff --git a/compiler/rustc_ast_lowering/src/errors.rs b/compiler/rustc_ast_lowering/src/errors.rs index 1ad5fa21d85..63ff64b00be 100644 --- a/compiler/rustc_ast_lowering/src/errors.rs +++ b/compiler/rustc_ast_lowering/src/errors.rs @@ -29,14 +29,28 @@ fn add_to_diagnostic(self, diag: &mut Diagnostic) { } #[derive(Diagnostic)] -#[help] #[diag(ast_lowering::invalid_abi, code = "E0703")] +#[note] pub struct InvalidAbi { #[primary_span] #[label] pub span: Span, pub abi: Symbol, - pub valid_abis: String, + pub command: String, + #[subdiagnostic] + pub suggestion: Option, +} + +#[derive(Subdiagnostic)] +#[suggestion( + ast_lowering::invalid_abi_suggestion, + code = "{suggestion}", + applicability = "maybe-incorrect" +)] +pub struct InvalidAbiSuggestion { + #[primary_span] + pub span: Span, + pub suggestion: String, } #[derive(Diagnostic, Clone, Copy)]