aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_completion
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2021-05-23 11:52:41 +0100
committerFlorian Diebold <[email protected]>2021-05-23 11:52:41 +0100
commita5d85a6356dc761d047f46bf04eae09dc9ab80f9 (patch)
treec02c9f04b9f1ef694d2a1e0680e137e060a7cda2 /crates/ide_completion
parentbc1ba1549d97e7d5ddceb16b7238ae8aab5794d0 (diff)
Add test for #8931 and better checking
Diffstat (limited to 'crates/ide_completion')
-rw-r--r--crates/ide_completion/src/completions/dot.rs29
1 files changed, 29 insertions, 0 deletions
diff --git a/crates/ide_completion/src/completions/dot.rs b/crates/ide_completion/src/completions/dot.rs
index 7e4efe589..1bff55936 100644
--- a/crates/ide_completion/src/completions/dot.rs
+++ b/crates/ide_completion/src/completions/dot.rs
@@ -454,4 +454,33 @@ mod foo {
454 "#]], 454 "#]],
455 ); 455 );
456 } 456 }
457
458 #[test]
459 fn issue_8931() {
460 check(
461 r#"
462#[lang = "fn_once"]
463trait FnOnce<Args> {
464 type Output;
465}
466struct S;
467
468struct Foo;
469impl Foo {
470 fn foo(&self) -> &[u8] { loop {} }
471}
472
473impl 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 "#]],
484 );
485 }
457} 486}