-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Labels
I-suggestion-causes-errorIssue: The suggestions provided by this Lint cause an ICE/error when appliedIssue: The suggestions provided by this Lint cause an ICE/error when applied
Description
Using the following flags
--force-warn clippy::empty-enum-variants-with-brackets
this code:
// check-pass
#![feature(more_qualified_paths)]
enum E { V() }
fn main() {
<E>::V() = E::V(); // OK, destructuring assignment
<E>::V {} = E::V(); // OK, destructuring assignment
}caused the following diagnostics:
Checking _7c1d4a29d1383868b149ffee737fb9ef207b9cae v0.1.0 (/tmp/icemaker_global_tempdir.1Qj3l2y6tEaS/icemaker_clippyfix_tempdir.EsFeWHkoH0Uw/_7c1d4a29d1383868b149ffee737fb9ef207b9cae)
warning: enum variant has empty brackets
--> src/main.rs:5:11
|
5 | enum E { V() }
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_enum_variants_with_brackets
= note: requested on the command line with `--force-warn clippy::empty-enum-variants-with-brackets`
help: remove the brackets
|
5 ~ enum E { V }
6 |
7 | fn main() {
8 ~ <E>::V() = E::V; // OK, destructuring assignment
9 ~ <E>::V {} = E::V; // OK, destructuring assignment
|
warning: `_7c1d4a29d1383868b149ffee737fb9ef207b9cae` (bin "_7c1d4a29d1383868b149ffee737fb9ef207b9cae") generated 1 warning
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.21s
However after applying these diagnostics, the resulting code:
// check-pass
#![feature(more_qualified_paths)]
enum E { V }
fn main() {
<E>::V() = E::V; // OK, destructuring assignment
<E>::V {} = E::V; // OK, destructuring assignment
}no longer compiled:
Checking _7c1d4a29d1383868b149ffee737fb9ef207b9cae v0.1.0 (/tmp/icemaker_global_tempdir.1Qj3l2y6tEaS/icemaker_clippyfix_tempdir.EsFeWHkoH0Uw/_7c1d4a29d1383868b149ffee737fb9ef207b9cae)
error[E0164]: expected tuple struct or tuple variant, found unit variant `E::V`
--> src/main.rs:8:5
|
8 | <E>::V() = E::V; // OK, destructuring assignment
| ^^^^^^^^ not a tuple struct or tuple variant
For more information about this error, try `rustc --explain E0164`.
error: could not compile `_7c1d4a29d1383868b149ffee737fb9ef207b9cae` (bin "_7c1d4a29d1383868b149ffee737fb9ef207b9cae") due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `_7c1d4a29d1383868b149ffee737fb9ef207b9cae` (bin "_7c1d4a29d1383868b149ffee737fb9ef207b9cae" test) due to 1 previous error
Version:
rustc 1.93.0-nightly (3ff30e7ea 2025-11-29)
binary: rustc
commit-hash: 3ff30e7eafc1da7104c3960187d17939172428ed
commit-date: 2025-11-29
host: x86_64-unknown-linux-gnu
release: 1.93.0-nightly
LLVM version: 21.1.5
Metadata
Metadata
Assignees
Labels
I-suggestion-causes-errorIssue: The suggestions provided by this Lint cause an ICE/error when appliedIssue: The suggestions provided by this Lint cause an ICE/error when applied