Closed as not planned
Description
The following code:
fn foo(arg: i32) {
todo!()
}
fn main() {
foo(35);
}
Currently emits a warning:
warning: unused variable: `arg`
--> src/main.rs:1:8
|
1 | fn foo(arg: i32) {
| ^^^ help: if this is intentional, prefix it with an underscore: `_arg`
|
= note: `#[warn(unused_variables)]` on by default
warning: 1 warning emitted
But todo!()
clearly indicates that the argument is unused neither because it's intended to be ignored (in which case it'd be appropriate to rename it to _arg
), nor because the author forgot to use it — but simply because the relevant code to use it has not been written yet.
Since todo!()
itself does not trigger any warnings (meaning, rustc is fine with trying to compile code with parts that are explicitly not implemented yet), it doesn't seem appropriate to warn about unused variables that are "covered" by todo!()
.