mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 02:03:53 +00:00
internal: add a test for broken refactor
This commit is contained in:
parent
f42648e305
commit
5021f10660
@ -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);
|
||||
}
|
||||
"#,
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user