-
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-verboseDiagnostics: Too much output caused by a single piece of incorrect code.Diagnostics: Too much output caused by a single piece of 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:
#[derive(Debug)]
pub struct Whatever {
pub field0: (),
field1: (),
field2: (),
field3: (),
field4: (),
}
The current output is:
warning: field is never read: `field1`
--> src\cmake\preset.rs:23:3
|
23 | field1: (),
| ^^^^^^^^^^
|
note: `Whatever` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
--> src\cmake\preset.rs:20:10
|
20 | #[derive(Debug)]
| ^^^^^
= note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: field is never read: `field2`
--> src\cmake\preset.rs:24:3
|
24 | field2: (),
| ^^^^^^^^^^
|
note: `Whatever` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
--> src\cmake\preset.rs:20:10
|
20 | #[derive(Debug)]
| ^^^^^
= note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: field is never read: `field3`
--> src\cmake\preset.rs:25:3
|
25 | field3: (),
| ^^^^^^^^^^
|
note: `Whatever` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
--> src\cmake\preset.rs:20:10
|
20 | #[derive(Debug)]
| ^^^^^
= note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
warning: field is never read: `field4`
--> src\cmake\preset.rs:26:3
|
26 | field4: (),
| ^^^^^^^^^^
|
note: `Whatever` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
--> src\cmake\preset.rs:20:10
|
20 | #[derive(Debug)]
| ^^^^^
= note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
Ideally the output should look like:
warning: field is never read: `field1`
--> src\cmake\preset.rs:23:3
|
23 | field1: (),
| ^^^^^^^^^^
|
warning: field is never read: `field2`
--> src\cmake\preset.rs:24:3
|
24 | field2: (),
| ^^^^^^^^^^
|
warning: field is never read: `field3`
--> src\cmake\preset.rs:25:3
|
25 | field3: (),
| ^^^^^^^^^^
|
warning: field is never read: `field4`
--> src\cmake\preset.rs:26:3
|
26 | field4: (),
| ^^^^^^^^^^
|
note: `Whatever` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
--> src\cmake\preset.rs:20:10
|
20 | #[derive(Debug)]
| ^^^^^
= note: this warning originates in the derive macro `Debug` (in Nightly builds, run with -Z macro-backtrace for more info)
Or something even more compact if possible. Without this, compiler output is almost double, and mostly unnecessary.
dullbananas, Adanos020, cs-t1, zohnannor, lxgr-linux and 2 moresandalbanditten
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsD-verboseDiagnostics: Too much output caused by a single piece of incorrect code.Diagnostics: Too much output caused by a single piece of 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.