diff options
| author | Lukas Wirth <lukastw97@gmail.com> | 2022-03-18 18:57:11 +0100 |
|---|---|---|
| committer | Lukas Wirth <lukastw97@gmail.com> | 2022-03-18 18:57:15 +0100 |
| commit | c22fed895e1debfa820f366ee21cdeaddfebb015 (patch) | |
| tree | db7dbd4618ebddcf8d62bd1569543a507ec90d99 | |
| parent | b634d99361997d8f973a0134459ac4d93fdbc7b8 (diff) | |
| download | rust-c22fed895e1debfa820f366ee21cdeaddfebb015.tar.gz rust-c22fed895e1debfa820f366ee21cdeaddfebb015.zip | |
Fix test fixtures
| -rw-r--r-- | crates/ide/src/inlay_hints.rs | 39 |
1 files changed, 2 insertions, 37 deletions
diff --git a/crates/ide/src/inlay_hints.rs b/crates/ide/src/inlay_hints.rs index e5918b4d96e..b908895a6b0 100644 --- a/crates/ide/src/inlay_hints.rs +++ b/crates/ide/src/inlay_hints.rs @@ -134,7 +134,7 @@ fn lifetime_hints( let param_list = func.param_list()?; let generic_param_list = func.generic_param_list(); let ret_type = func.ret_type(); - let self_param = param_list.self_param(); + let self_param = param_list.self_param().filter(|it| it.amp_token().is_some()); // FIXME: don't use already used lifetimenames @@ -1473,41 +1473,6 @@ fn main() { } #[test] - fn incomplete_for_no_hint() { - check_types( - r#" -fn main() { - let data = &[1i32, 2, 3]; - //^^^^ &[i32; 3] - for i -}"#, - ); - check( - r#" -pub struct Vec<T> {} - -impl<T> Vec<T> { - pub fn new() -> Self { Vec {} } - pub fn push(&mut self, t: T) {} -} - -impl<T> IntoIterator for Vec<T> { - type Item=T; -} - -fn main() { - let mut data = Vec::new(); - //^^^^ Vec<&str> - data.push("foo"); - for i in - - println!("Unit expr"); -} -"#, - ); - } - - #[test] fn complete_for_hint() { check_types( r#" @@ -2010,7 +1975,7 @@ fn main() { } #[test] - fn hints_sssin_attr_call() { + fn hints_lifetimes() { check( r#" fn empty() {} |
