diff options
Diffstat (limited to 'crates/ide/src/goto_definition.rs')
-rw-r--r-- | crates/ide/src/goto_definition.rs | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/crates/ide/src/goto_definition.rs b/crates/ide/src/goto_definition.rs index 7a12e9965..47dd85ceb 100644 --- a/crates/ide/src/goto_definition.rs +++ b/crates/ide/src/goto_definition.rs | |||
@@ -750,6 +750,31 @@ fn test() { | |||
750 | } | 750 | } |
751 | 751 | ||
752 | #[test] | 752 | #[test] |
753 | fn goto_through_included_file() { | ||
754 | check( | ||
755 | r#" | ||
756 | //- /main.rs | ||
757 | #[rustc_builtin_macro] | ||
758 | macro_rules! include {} | ||
759 | |||
760 | include!("foo.rs"); | ||
761 | //^^^^^^^^^^^^^^^^^^^ | ||
762 | |||
763 | fn f() { | ||
764 | foo<|>(); | ||
765 | } | ||
766 | |||
767 | mod confuse_index { | ||
768 | pub fn foo() {} | ||
769 | } | ||
770 | |||
771 | //- /foo.rs | ||
772 | fn foo() {} | ||
773 | "#, | ||
774 | ); | ||
775 | } | ||
776 | |||
777 | #[test] | ||
753 | fn goto_for_type_param() { | 778 | fn goto_for_type_param() { |
754 | check( | 779 | check( |
755 | r#" | 780 | r#" |
@@ -1077,4 +1102,32 @@ fn foo<'foobar>(_: &'foobar ()) { | |||
1077 | }"#, | 1102 | }"#, |
1078 | ) | 1103 | ) |
1079 | } | 1104 | } |
1105 | |||
1106 | #[test] | ||
1107 | #[ignore] // requires the HIR to somehow track these hrtb lifetimes | ||
1108 | fn goto_lifetime_hrtb() { | ||
1109 | check( | ||
1110 | r#"trait Foo<T> {} | ||
1111 | fn foo<T>() where for<'a> T: Foo<&'a<|> (u8, u16)>, {} | ||
1112 | //^^ | ||
1113 | "#, | ||
1114 | ); | ||
1115 | check( | ||
1116 | r#"trait Foo<T> {} | ||
1117 | fn foo<T>() where for<'a<|>> T: Foo<&'a (u8, u16)>, {} | ||
1118 | //^^ | ||
1119 | "#, | ||
1120 | ); | ||
1121 | } | ||
1122 | |||
1123 | #[test] | ||
1124 | #[ignore] // requires ForTypes to be implemented | ||
1125 | fn goto_lifetime_hrtb_for_type() { | ||
1126 | check( | ||
1127 | r#"trait Foo<T> {} | ||
1128 | fn foo<T>() where T: for<'a> Foo<&'a<|> (u8, u16)>, {} | ||
1129 | //^^ | ||
1130 | "#, | ||
1131 | ); | ||
1132 | } | ||
1080 | } | 1133 | } |