File tree Expand file tree Collapse file tree 1 file changed +32
-3
lines changed
crates/ide-completion/src Expand file tree Collapse file tree 1 file changed +32
-3
lines changed Original file line number Diff line number Diff line change @@ -2045,7 +2045,7 @@ fn main() {
2045
2045
}
2046
2046
2047
2047
#[ test]
2048
- fn associated_fn_relevanes ( ) {
2048
+ fn associated_fn_relevances ( ) {
2049
2049
check_relevance (
2050
2050
r#"
2051
2051
struct AStruct;
@@ -2081,7 +2081,7 @@ fn test() {
2081
2081
"# ] ] ,
2082
2082
) ;
2083
2083
2084
- // Generic
2084
+ // Generic 1
2085
2085
check_relevance (
2086
2086
r#"
2087
2087
struct AStruct<T: Default>(T);
@@ -2098,7 +2098,6 @@ impl<T: Default> AStruct<T> {
2098
2098
}
2099
2099
2100
2100
fn test() {
2101
- //let a : Res<AStruct<u32>> = self::AStruct::fn_ctr();
2102
2101
let a = self::AStruct::<u32>::$0;
2103
2102
}
2104
2103
"# ,
@@ -2111,6 +2110,36 @@ fn test() {
2111
2110
me fn_no_ret(…) [type_could_unify]
2112
2111
"# ] ] ,
2113
2112
) ;
2113
+
2114
+ // Generic 2
2115
+ check_relevance (
2116
+ r#"
2117
+ struct AStruct<T: Default>(T);
2118
+ struct AStructBuilder;
2119
+ struct Res<T>(T);
2120
+
2121
+ impl<T: Default> AStruct<T> {
2122
+ fn fn_no_ret(&self) {}
2123
+ fn fn_ctr_with_args(input: T) -> AStruct<T> { AStruct(input) }
2124
+ fn fn_direct_ctr() -> Self { AStruct(<_>::default()) }
2125
+ fn fn_ctr() -> Res<Self> { Res(Self::fn_direct_ctr()) }
2126
+ fn fn_other() -> Res<u32> { Res(0) }
2127
+ fn fn_builder() -> AStructBuilder { AStructBuilder }
2128
+ }
2129
+
2130
+ fn test() {
2131
+ let a : Res<AStruct<u32>> = AStruct::$0;
2132
+ }
2133
+ "# ,
2134
+ expect ! [ [ r#"
2135
+ fn fn_direct_ctr() []
2136
+ fn fn_ctr_with_args(…) []
2137
+ fn fn_builder() []
2138
+ fn fn_ctr() []
2139
+ fn fn_other() []
2140
+ me fn_no_ret(…) []
2141
+ "# ] ] ,
2142
+ ) ;
2114
2143
}
2115
2144
2116
2145
#[ test]
You can’t perform that action at this time.
0 commit comments