You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently it reports the source line of the let; then the replacement code, but the actual original init is not shown.
e.g.
warning: unneeded late initalization
--> src\cli\job.rs:82:9
|
82 | let mut info: JOBOBJECT_EXTENDED_LIMIT_INFORMATION;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(clippy::needless_late_init)]` on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
help: declare `info` here
|
83 | let mut info: JOBOBJECT_EXTENDED_LIMIT_INFORMATION = mem::zeroed();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
could be instead
warning: unneeded late initalization
--> src\cli\job.rs:82:9
|
82 | let mut info: JOBOBJECT_EXTENDED_LIMIT_INFORMATION;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ created here
83 | info = mem::zeroed();
^^^^^^^^^^^^^^^^^^^^ initialised here
|
= note: #[warn(clippy::needless_late_init)] on by default
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
help: declare info here
|
83 | let mut info: JOBOBJECT_EXTENDED_LIMIT_INFORMATION = mem::zeroed();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Easier readability for `needless_late_init` message
Closes#8530
Updated the lint to use a `MultiSpan`, showing where the `let` statement was first used and where the initialisation statement was done, as in the format described, for easier readability.
Was wondering why, when pushing the span label for the initialisation statement, that sometimes the prior statement above the initialisation statement gets pulled into the output as well - any insight is appreciated!
Description
Currently it reports the source line of the let; then the replacement code, but the actual original init is not shown.
e.g.
could be instead
warning: unneeded late initalization
--> src\cli\job.rs:82:9
|
82 | let mut info: JOBOBJECT_EXTENDED_LIMIT_INFORMATION;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ created here
83 | info = mem::zeroed();
^^^^^^^^^^^^^^^^^^^^ initialised here
|
= note:
#[warn(clippy::needless_late_init)]
on by default= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init
help: declare
info
here|
83 | let mut info: JOBOBJECT_EXTENDED_LIMIT_INFORMATION = mem::zeroed();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: