about summary refs log tree commit diff
path: root/compiler/rustc_ast_lowering/src/errors.rs
diff options
context:
space:
mode:
authorEsteban Küber <esteban@kuber.com.ar>2025-02-28 03:35:13 +0000
committerEsteban Küber <esteban@kuber.com.ar>2025-02-28 03:35:13 +0000
commit86945c0a545643457e551a78e8c2a90355d0f17c (patch)
treea52ec432a83e44ea8f6930417cf9629e3913269c /compiler/rustc_ast_lowering/src/errors.rs
parentf45d4acf1bb635aa010f19f8a749eed8293203b3 (diff)
downloadrust-86945c0a545643457e551a78e8c2a90355d0f17c.tar.gz
rust-86945c0a545643457e551a78e8c2a90355d0f17c.zip
Tweak incorrect ABI suggestion
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]