-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Closed as not planned
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-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
pub trait AutoSplitter {
type Data;
fn update(&mut self) -> Option<Self::Data>;
fn should_start(data: &Self::Data) -> bool {
false
}
}
The current output is:
warning: unused variable: `data`
--> src/lib.rs:4:21
|
4 | fn should_start(data: &Self::Data) -> bool {
| ^^^^ help: if this is intentional, prefix it with an underscore: `_data`
|
= note: `#[warn(unused_variables)]` on by default
Ideally the compiler should not emit any warnings as prefixing the parameter with an underscore would negatively affect the documentation and auto generated implementations via an IDE / rust-analyzer.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsT-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.