File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
src/librustdoc/html/render Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -215,17 +215,24 @@ fn get_index_type_name(clean_type: &clean::Type) -> Option<Symbol> {
215
215
let path = & bounds[ 0 ] . trait_ ;
216
216
Some ( path. segments . last ( ) . unwrap ( ) . name )
217
217
}
218
+ clean:: ImplTrait ( ref bounds) => {
219
+ let first_trait = bounds. iter ( ) . find_map ( |b| match b {
220
+ clean:: GenericBound :: TraitBound ( poly_trait, _) => Some ( & poly_trait. trait_ ) ,
221
+ clean:: GenericBound :: Outlives ( _) => None ,
222
+ } ) ;
223
+ first_trait. map ( |t| t. segments . last ( ) . unwrap ( ) . name )
224
+ }
218
225
clean:: Generic ( s) => Some ( s) ,
219
226
clean:: Primitive ( ref p) => Some ( p. as_sym ( ) ) ,
220
- clean:: BorrowedRef { ref type_, .. } => get_index_type_name ( type_) ,
227
+ clean:: BorrowedRef { ref type_, .. } | clean:: RawPointer ( _, ref type_) => {
228
+ get_index_type_name ( type_)
229
+ }
221
230
clean:: BareFunction ( _)
222
231
| clean:: Tuple ( _)
223
232
| clean:: Slice ( _)
224
233
| clean:: Array ( _, _)
225
- | clean:: RawPointer ( _, _)
226
234
| clean:: QPath { .. }
227
- | clean:: Infer
228
- | clean:: ImplTrait ( _) => None ,
235
+ | clean:: Infer => None ,
229
236
}
230
237
}
231
238
You can’t perform that action at this time.
0 commit comments