File tree 2 files changed +29
-4
lines changed
2 files changed +29
-4
lines changed Original file line number Diff line number Diff line change @@ -1325,7 +1325,7 @@ impl DocFolder for Cache {
1325
1325
// Figure out the id of this impl. This may map to a
1326
1326
// primitive rather than always to a struct/enum.
1327
1327
// Note: matching twice to restrict the lifetime of the `i` borrow.
1328
- let mut dids = vec ! [ ] ;
1328
+ let mut dids = FxHashSet ( ) ;
1329
1329
if let clean:: Item { inner : clean:: ImplItem ( ref i) , .. } = item {
1330
1330
let masked_trait = i. trait_ . def_id ( ) . map_or ( false ,
1331
1331
|d| self . masked_crates . contains ( & d. krate ) ) ;
@@ -1335,15 +1335,15 @@ impl DocFolder for Cache {
1335
1335
clean:: BorrowedRef {
1336
1336
type_ : box clean:: ResolvedPath { did, .. } , ..
1337
1337
} => {
1338
- dids. push ( did) ;
1338
+ dids. insert ( did) ;
1339
1339
}
1340
1340
ref t => {
1341
1341
let did = t. primitive_type ( ) . and_then ( |t| {
1342
1342
self . primitive_locations . get ( & t) . cloned ( )
1343
1343
} ) ;
1344
1344
1345
1345
if let Some ( did) = did {
1346
- dids. push ( did) ;
1346
+ dids. insert ( did) ;
1347
1347
}
1348
1348
}
1349
1349
}
@@ -1352,7 +1352,7 @@ impl DocFolder for Cache {
1352
1352
if let Some ( generics) = i. trait_ . as_ref ( ) . and_then ( |t| t. generics ( ) ) {
1353
1353
for bound in generics {
1354
1354
if let Some ( did) = bound. def_id ( ) {
1355
- dids. push ( did) ;
1355
+ dids. insert ( did) ;
1356
1356
}
1357
1357
}
1358
1358
}
Original file line number Diff line number Diff line change
1
+ // Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ #![ crate_name = "foo" ]
12
+
13
+ pub trait Bar < T , U > { }
14
+
15
+ // @has 'foo/struct.Foo1.html'
16
+ pub struct Foo1 ;
17
+ // @count - '//*[@class="impl"]' 1
18
+ // @has - '//*[@class="impl"]' "impl Bar<Foo1, &'static Foo1> for Foo1"
19
+ impl Bar < Foo1 , & ' static Foo1 > for Foo1 { }
20
+
21
+ // @has 'foo/struct.Foo2.html'
22
+ pub struct Foo2 ;
23
+ // @count - '//*[@class="impl"]' 1
24
+ // @has - '//*[@class="impl"]' "impl Bar<&'static Foo2, Foo2> for u8"
25
+ impl Bar < & ' static Foo2 , Foo2 > for u8 { }
You can’t perform that action at this time.
0 commit comments