diff options
Diffstat (limited to 'crates/ide_completion')
-rw-r--r-- | crates/ide_completion/src/completions/dot.rs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/crates/ide_completion/src/completions/dot.rs b/crates/ide_completion/src/completions/dot.rs index 7e4efe589..fd9738743 100644 --- a/crates/ide_completion/src/completions/dot.rs +++ b/crates/ide_completion/src/completions/dot.rs | |||
@@ -454,4 +454,34 @@ mod foo { | |||
454 | "#]], | 454 | "#]], |
455 | ); | 455 | ); |
456 | } | 456 | } |
457 | |||
458 | #[test] | ||
459 | fn issue_8931() { | ||
460 | check( | ||
461 | r#" | ||
462 | #[lang = "fn_once"] | ||
463 | trait FnOnce<Args> { | ||
464 | type Output; | ||
465 | } | ||
466 | struct S; | ||
467 | |||
468 | struct Foo; | ||
469 | impl Foo { | ||
470 | fn foo(&self) -> &[u8] { loop {} } | ||
471 | } | ||
472 | |||
473 | impl S { | ||
474 | fn indented(&mut self, f: impl FnOnce(&mut Self)) { | ||
475 | } | ||
476 | |||
477 | fn f(&mut self, v: Foo) { | ||
478 | self.indented(|this| v.$0) | ||
479 | } | ||
480 | } | ||
481 | "#, | ||
482 | expect![[r#" | ||
483 | me foo() fn(&self) -> &[u8] | ||
484 | "#]], | ||
485 | ); | ||
486 | } | ||
457 | } | 487 | } |