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)]
mod tests {
use crate::tests::{check_diagnostics, check_diagnostics_with_disabled};
use crate::tests::check_diagnostics;
#[test]
fn simple_free_fn_zero() {
@ -197,16 +197,15 @@ fn f() {
fn method_unknown_receiver() {
// 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
check_diagnostics_with_disabled(
check_diagnostics(
r#"
trait Foo { fn method(&self, arg: usize) {} }
trait Foo { fn method(&self, _arg: usize) {} }
fn f() {
let x;
x.method();
}
"#,
std::iter::once("unused_variables".to_string()),
);
}