about summary refs log tree commit diff
path: root/compiler/rustc_ast_lowering/src/errors.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2025-03-01 05:49:56 +0100
committerGitHub <noreply@github.com>2025-03-01 05:49:56 +0100
commite5a639dbd020f9f76b799c15e1343f3d26f5b2cf (patch)
treef2ffc96c2e39855bf8305a0f4d6dcb3bd38153b4 /compiler/rustc_ast_lowering/src/errors.rs
parent472bc0ee257ab6f387e5d9b9dd2a718372fa0c3a (diff)
parent86945c0a545643457e551a78e8c2a90355d0f17c (diff)
downloadrust-e5a639dbd020f9f76b799c15e1343f3d26f5b2cf.tar.gz
rust-e5a639dbd020f9f76b799c15e1343f3d26f5b2cf.zip
Rollup merge of #137771 - estebank:abi-sugg, r=compiler-errors
Tweak incorrect ABI suggestion and make suggestion verbose

Provide a better suggestion message, and make the suggestion verbose.

```
error[E0703]: invalid ABI: found `riscv-interrupt`
  --> $DIR/riscv-discoverability-guidance.rs:17:8
   |
LL | extern "riscv-interrupt" fn isr() {}
   |        ^^^^^^^^^^^^^^^^^ invalid ABI
   |
   = note: invoke `rustc --print=calling-conventions` for a full list of supported calling conventions
help: there's a similarly named valid ABI `riscv-interrupt-m`
   |
LL | extern "riscv-interrupt-m" fn isr() {}
   |                        ++
```
Diffstat (limited to 'compiler/rustc_ast_lowering/src/errors.rs')
-rw-r--r--compiler/rustc_ast_lowering/src/errors.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_ast_lowering/src/errors.rs b/compiler/rustc_ast_lowering/src/errors.rs
index f31e2db051d..766c0233408 100644
--- a/compiler/rustc_ast_lowering/src/errors.rs
+++ b/compiler/rustc_ast_lowering/src/errors.rs
@@ -46,8 +46,9 @@ pub(crate) struct TupleStructWithDefault {
 #[derive(Subdiagnostic)]
 #[suggestion(
     ast_lowering_invalid_abi_suggestion,
-    code = "{suggestion}",
-    applicability = "maybe-incorrect"
+    code = "\"{suggestion}\"",
+    applicability = "maybe-incorrect",
+    style = "verbose"
 )]
 pub(crate) struct InvalidAbiSuggestion {
     #[primary_span]