internal: add a test for broken refactor

This commit is contained in:
Aleksey Kladov 2021-07-11 15:05:16 +03:00
parent f42648e305
commit 5021f10660

View File

@ -310,6 +310,36 @@ use super::foo;
fn bar() {
let _ = foo(1);
}
"#,
)
}
#[test]
fn remove_method_param() {
// FIXME: This is completely wrong:
// * method call expressions are not handled
// * assoc function syntax removes the wrong argument.
check_assist(
remove_unused_param,
r#"
struct S;
impl S { fn f(&self, $0_unused: i32) {} }
fn main() {
S.f(92);
S.f();
S.f(92, 92);
S::f(&S, 92);
}
"#,
r#"
struct S;
impl S { fn f(&self) {} }
fn main() {
S.f(92);
S.f();
S.f(92, 92);
S::f(92);
}
"#,
)
}