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 @@ -2042,7 +2042,7 @@ fn main() {
2042
2042
}
2043
2043
2044
2044
#[ test]
2045
- fn associated_fn_relevanes ( ) {
2045
+ fn associated_fn_relevances ( ) {
2046
2046
check_relevance (
2047
2047
r#"
2048
2048
struct AStruct;
@@ -2078,7 +2078,7 @@ fn test() {
2078
2078
"# ] ] ,
2079
2079
) ;
2080
2080
2081
- // Generic
2081
+ // Generic 1
2082
2082
check_relevance (
2083
2083
r#"
2084
2084
struct AStruct<T: Default>(T);
@@ -2095,7 +2095,6 @@ impl<T: Default> AStruct<T> {
2095
2095
}
2096
2096
2097
2097
fn test() {
2098
- //let a : Res<AStruct<u32>> = self::AStruct::fn_ctr();
2099
2098
let a = self::AStruct::<u32>::$0;
2100
2099
}
2101
2100
"# ,
@@ -2108,6 +2107,36 @@ fn test() {
2108
2107
me fn_no_ret(…) [type_could_unify]
2109
2108
"# ] ] ,
2110
2109
) ;
2110
+
2111
+ // Generic 2
2112
+ check_relevance (
2113
+ r#"
2114
+ struct AStruct<T: Default>(T);
2115
+ struct AStructBuilder;
2116
+ struct Res<T>(T);
2117
+
2118
+ impl<T: Default> AStruct<T> {
2119
+ fn fn_no_ret(&self) {}
2120
+ fn fn_ctr_with_args(input: T) -> AStruct<T> { AStruct(input) }
2121
+ fn fn_direct_ctr() -> Self { AStruct(<_>::default()) }
2122
+ fn fn_ctr() -> Res<Self> { Res(Self::fn_direct_ctr()) }
2123
+ fn fn_other() -> Res<u32> { Res(0) }
2124
+ fn fn_builder() -> AStructBuilder { AStructBuilder }
2125
+ }
2126
+
2127
+ fn test() {
2128
+ let a : Res<AStruct<u32>> = AStruct::$0;
2129
+ }
2130
+ "# ,
2131
+ expect ! [ [ r#"
2132
+ fn fn_direct_ctr() []
2133
+ fn fn_ctr_with_args(…) []
2134
+ fn fn_builder() []
2135
+ fn fn_ctr() []
2136
+ fn fn_other() []
2137
+ me fn_no_ret(…) []
2138
+ "# ] ] ,
2139
+ ) ;
2111
2140
}
2112
2141
2113
2142
#[ test]
You can’t perform that action at this time.
0 commit comments