refactor: disable "unused" lint using parameter name

This commit is contained in:
davidsemakula 2024-02-05 01:05:39 +03:00
parent d761d86f03
commit 33b3b6dbf9

View file

@ -103,7 +103,7 @@ fn invalid_args_range(
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use crate::tests::{check_diagnostics, check_diagnostics_with_disabled}; use crate::tests::check_diagnostics;
#[test] #[test]
fn simple_free_fn_zero() { fn simple_free_fn_zero() {
@ -197,16 +197,15 @@ fn f() {
fn method_unknown_receiver() { fn method_unknown_receiver() {
// note: this is incorrect code, so there might be errors on this in the // note: this is incorrect code, so there might be errors on this in the
// future, but we shouldn't emit an argument count diagnostic here // future, but we shouldn't emit an argument count diagnostic here
check_diagnostics_with_disabled( check_diagnostics(
r#" r#"
trait Foo { fn method(&self, arg: usize) {} } trait Foo { fn method(&self, _arg: usize) {} }
fn f() { fn f() {
let x; let x;
x.method(); x.method();
} }
"#, "#,
std::iter::once("unused_variables".to_string()),
); );
} }