-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Given the following code:
#![feature(box_patterns)]
#![feature(box_syntax)]
enum E {
StructVar { boxed: Box<i32> },
}
fn main() {
let a = E::StructVar { boxed: box 3 };
match a {
E::StructVar { box boxed } => {}
}
}cargo fix
warning: build failed, waiting for other jobs to finish...
warning: failed to automatically apply fixes suggested by rustc to crate `g`
after fixes were automatically applied the compiler reported errors within these files:
* src/main.rs
This likely indicates a bug in either rustc or cargo itself,
and we would appreciate a bug report! You're likely to see
a number of compiler warnings after this message which cargo
attempted to fix but failed. If you could open an issue at
https://github.com/rust-lang/rust/issues
quoting the full output of this command we'd be very appreciative!
Note that you may be able to make some more progress in the near-term
fixing code with the `--broken-code` flag
The following errors were reported:
error[E0026]: variant `E::StructVar` does not have a field named `_boxed`
--> src/main.rs:11:28
|
11 | E::StructVar { box _boxed } => { }
| ^^^^^^
| |
| variant `E::StructVar` does not have this field
| help: a field with a similar name exists: `boxed`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0026`.
Original diagnostics will follow.
warning: unused variable: `boxed`
--> src/main.rs:11:28
|
11 | E::StructVar { box boxed } => { }
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_boxed`
|
= note: `#[warn(unused_variables)]` on by default
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-invalid-suggestionDiagnostics: A structured suggestion resulting in incorrect code.Diagnostics: A structured suggestion resulting in incorrect code.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.