diff options
Diffstat (limited to 'crates/ide_assists/src')
-rw-r--r-- | crates/ide_assists/src/handlers/add_turbo_fish.rs | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/crates/ide_assists/src/handlers/add_turbo_fish.rs b/crates/ide_assists/src/handlers/add_turbo_fish.rs index f18e3edf9..a08b55ebb 100644 --- a/crates/ide_assists/src/handlers/add_turbo_fish.rs +++ b/crates/ide_assists/src/handlers/add_turbo_fish.rs | |||
@@ -37,7 +37,6 @@ pub(crate) fn add_turbo_fish(acc: &mut Assists, ctx: &AssistContext) -> Option<( | |||
37 | let next_token = ident.next_token()?; | 37 | let next_token = ident.next_token()?; |
38 | if next_token.kind() == T![::] { | 38 | if next_token.kind() == T![::] { |
39 | mark::hit!(add_turbo_fish_one_fish_is_enough); | 39 | mark::hit!(add_turbo_fish_one_fish_is_enough); |
40 | mark::hit!(add_type_ascription_turbofished); | ||
41 | return None; | 40 | return None; |
42 | } | 41 | } |
43 | let name_ref = ast::NameRef::cast(ident.parent())?; | 42 | let name_ref = ast::NameRef::cast(ident.parent())?; |
@@ -52,7 +51,6 @@ pub(crate) fn add_turbo_fish(acc: &mut Assists, ctx: &AssistContext) -> Option<( | |||
52 | let generics = hir::GenericDef::Function(fun).params(ctx.sema.db); | 51 | let generics = hir::GenericDef::Function(fun).params(ctx.sema.db); |
53 | if generics.is_empty() { | 52 | if generics.is_empty() { |
54 | mark::hit!(add_turbo_fish_non_generic); | 53 | mark::hit!(add_turbo_fish_non_generic); |
55 | mark::hit!(add_type_ascription_non_generic); | ||
56 | return None; | 54 | return None; |
57 | } | 55 | } |
58 | 56 | ||
@@ -251,20 +249,6 @@ fn main() { | |||
251 | } | 249 | } |
252 | 250 | ||
253 | #[test] | 251 | #[test] |
254 | fn add_type_ascription_turbofished() { | ||
255 | mark::check!(add_type_ascription_turbofished); | ||
256 | check_assist_not_applicable( | ||
257 | add_turbo_fish, | ||
258 | r#" | ||
259 | fn make<T>() -> T {} | ||
260 | fn main() { | ||
261 | let x = make$0::<()>(); | ||
262 | } | ||
263 | "#, | ||
264 | ); | ||
265 | } | ||
266 | |||
267 | #[test] | ||
268 | fn add_type_ascription_already_typed() { | 252 | fn add_type_ascription_already_typed() { |
269 | mark::check!(add_type_ascription_already_typed); | 253 | mark::check!(add_type_ascription_already_typed); |
270 | check_assist( | 254 | check_assist( |
@@ -283,18 +267,4 @@ fn main() { | |||
283 | "#, | 267 | "#, |
284 | ); | 268 | ); |
285 | } | 269 | } |
286 | |||
287 | #[test] | ||
288 | fn add_type_ascription_non_generic() { | ||
289 | mark::check!(add_type_ascription_non_generic); | ||
290 | check_assist_not_applicable( | ||
291 | add_turbo_fish, | ||
292 | r#" | ||
293 | fn make() -> () {} | ||
294 | fn main() { | ||
295 | let x = make$0(); | ||
296 | } | ||
297 | "#, | ||
298 | ); | ||
299 | } | ||
300 | } | 270 | } |