diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2024-12-21 02:43:09 +0000 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2024-12-21 19:14:58 +0000 |
| commit | 94812f1c8f455579a3a1c127c2bbac48fc7cecef (patch) | |
| tree | dd89eca57cb897363de7f2c26e0936c74486b922 /compiler/rustc_builtin_macros/messages.ftl | |
| parent | d520b18316c71e1b61f2ed4df761f03149ff59e7 (diff) | |
| download | rust-94812f1c8f455579a3a1c127c2bbac48fc7cecef.tar.gz rust-94812f1c8f455579a3a1c127c2bbac48fc7cecef.zip | |
Use E0665 for missing `#[default]` error
Use orphaned error code for the same error it belonged to before.
```
error[E0665]: `#[derive(Default)]` on enum with no `#[default]`
--> $DIR/macros-nonfatal-errors.rs:42:10
|
LL | #[derive(Default)]
| ^^^^^^^
LL | / enum NoDeclaredDefault {
LL | | Foo,
LL | | Bar,
LL | | }
| |_- this enum needs a unit variant marked with `#[default]`
|
= note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
help: make this unit variant default by placing `#[default]` on it
|
LL | #[default] Foo,
| ~~~~~~~~~~~~~~
help: make this unit variant default by placing `#[default]` on it
|
LL | #[default] Bar,
| ~~~~~~~~~~~~~~
```
Diffstat (limited to 'compiler/rustc_builtin_macros/messages.ftl')
| -rw-r--r-- | compiler/rustc_builtin_macros/messages.ftl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_builtin_macros/messages.ftl b/compiler/rustc_builtin_macros/messages.ftl index 87d3d288013..7a31d2a2239 100644 --- a/compiler/rustc_builtin_macros/messages.ftl +++ b/compiler/rustc_builtin_macros/messages.ftl @@ -249,9 +249,9 @@ builtin_macros_naked_functions_testing_attribute = .label = function marked with testing attribute here .naked_attribute = `#[naked]` is incompatible with testing attributes -builtin_macros_no_default_variant = no default declared - .help = make a unit variant default by placing `#[default]` above it - .suggestion = make `{$ident}` default +builtin_macros_no_default_variant = `#[derive(Default)]` on enum with no `#[default]` + .label = this enum needs a unit variant marked with `#[default]` + .suggestion = make this unit variant default by placing `#[default]` on it builtin_macros_non_abi = at least one abi must be provided as an argument to `clobber_abi` |
