File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
crates/ide-assists/src/handlers Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -171,6 +171,25 @@ fn collect_used_generics<'gp>(
171
171
ast:: Type :: RefType ( ref_) => generics. extend (
172
172
ref_. lifetime ( ) . and_then ( |lt| known_generics. iter ( ) . find ( find_lifetime ( & lt. text ( ) ) ) ) ,
173
173
) ,
174
+ ast:: Type :: ArrayType ( ar) => {
175
+ if let Some ( expr) = ar. expr ( ) {
176
+ if let ast:: Expr :: PathExpr ( p) = expr {
177
+ if let Some ( path) = p. path ( ) {
178
+ if let Some ( name_ref) = path. as_single_name_ref ( ) {
179
+ if let Some ( param) = known_generics. iter ( ) . find ( |gp| {
180
+ if let ast:: GenericParam :: ConstParam ( cp) = gp {
181
+ cp. name ( ) . map_or ( false , |n| n. text ( ) == name_ref. text ( ) )
182
+ } else {
183
+ false
184
+ }
185
+ } ) {
186
+ generics. push ( param) ;
187
+ }
188
+ }
189
+ }
190
+ }
191
+ }
192
+ } ,
174
193
_ => ( ) ,
175
194
} ) ;
176
195
// stable resort to lifetime, type, const
You can’t perform that action at this time.
0 commit comments