aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_completion
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-05-23 12:03:18 +0100
committerGitHub <[email protected]>2021-05-23 12:03:18 +0100
commit0ec4ce1e9bceb2d7b0833de2ab59e2cd583e01ec (patch)
tree56ee0561e7f7240a0571e0c1be484c83bf985541 /crates/ide_completion
parent808ebe4b865176dcc394ea4adcb3a24f60955734 (diff)
parent34a3bc4196db302ea5b31c51b6d555336965be5f (diff)
Merge #8938
8938: internal: Fix #8931 r=flodiebold a=flodiebold - and add some better checking for similar bugs Co-authored-by: Florian Diebold <[email protected]>
Diffstat (limited to 'crates/ide_completion')
-rw-r--r--crates/ide_completion/src/completions/dot.rs30
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"]
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 me foo() fn(&self) -> &[u8]
484 "#]],
485 );
486 }
457} 487}