-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
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 (playground):
union U {
value: Vec<isize>,
}
The current output is:
error[E0740]: unions may not contain fields that need dropping
--> src/lib.rs:2:5
|
2 | value: Vec<isize>,
| ^^^^^^^^^^^^^^^^^
|
note: `std::mem::ManuallyDrop` can be used to wrap the type
--> src/lib.rs:2:5
|
2 | value: Vec<isize>,
| ^^^^^^^^^^^^^^^^^
Ideally the output should look like:
error[E0740]: unions may not contain fields that need dropping
--> src/lib.rs:2:5
|
2 | value: Vec<isize>,
| ^^^^^^^^^^^^^^^^^
|
note: `std::mem::ManuallyDrop` can be used to wrap the type
--> src/lib.rs:2:5
|
2 | value: std::mem::ManuallyDrop<Vec<isize>>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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.