aboutsummaryrefslogtreecommitdiff
path: root/crates/ide
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-03-30 01:10:30 +0100
committerGitHub <[email protected]>2021-03-30 01:10:30 +0100
commit904bdff2241a54c6aebe0f6fd39e6560550a66b0 (patch)
tree02afde0f2d0406abb3bc4089eae7267924f81899 /crates/ide
parentb3ca06e4fd8fe3a3ab081c55ecaa1ec3e79fe18d (diff)
parent41c7448e1242de8fadf7c46efd3171368b5ff92e (diff)
Merge #8250
8250: More accurately classify assoc. types in paths r=jonas-schievink a=jonas-schievink Previously `Iterator<Whoops$0 = ()>` would go to the `Iterator` trait. This fixes that and correctly marks `Whoops` as unresolved. bors r+ Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/ide')
-rw-r--r--crates/ide/src/goto_definition.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/crates/ide/src/goto_definition.rs b/crates/ide/src/goto_definition.rs
index a2c97061f..c6556c487 100644
--- a/crates/ide/src/goto_definition.rs
+++ b/crates/ide/src/goto_definition.rs
@@ -918,6 +918,21 @@ fn f() -> impl Iterator<Item$0 = u8> {}
918 } 918 }
919 919
920 #[test] 920 #[test]
921 #[should_panic = "unresolved reference"]
922 fn unknown_assoc_ty() {
923 check(
924 r#"
925trait Iterator {
926 type Item;
927 //^^^^
928}
929
930fn f() -> impl Iterator<Invalid$0 = u8> {}
931 "#,
932 )
933 }
934
935 #[test]
921 fn goto_def_for_assoc_ty_in_path_multiple() { 936 fn goto_def_for_assoc_ty_in_path_multiple() {
922 check( 937 check(
923 r#" 938 r#"