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 @@ -1326,7 +1326,7 @@ impl DocFolder for Cache {
1326
1326
// Figure out the id of this impl. This may map to a
1327
1327
// primitive rather than always to a struct/enum.
1328
1328
// Note: matching twice to restrict the lifetime of the `i` borrow.
1329
- let mut dids = vec ! [ ] ;
1329
+ let mut dids = FxHashSet ( ) ;
1330
1330
if let clean:: Item { inner : clean:: ImplItem ( ref i) , .. } = item {
1331
1331
let masked_trait = i. trait_ . def_id ( ) . map_or ( false ,
1332
1332
|d| self . masked_crates . contains ( & d. krate ) ) ;
@@ -1336,15 +1336,15 @@ impl DocFolder for Cache {
1336
1336
clean:: BorrowedRef {
1337
1337
type_ : box clean:: ResolvedPath { did, .. } , ..
1338
1338
} => {
1339
- dids. push ( did) ;
1339
+ dids. insert ( did) ;
1340
1340
}
1341
1341
ref t => {
1342
1342
let did = t. primitive_type ( ) . and_then ( |t| {
1343
1343
self . primitive_locations . get ( & t) . cloned ( )
1344
1344
} ) ;
1345
1345
1346
1346
if let Some ( did) = did {
1347
- dids. push ( did) ;
1347
+ dids. insert ( did) ;
1348
1348
}
1349
1349
}
1350
1350
}
@@ -1353,7 +1353,7 @@ impl DocFolder for Cache {
1353
1353
if let Some ( generics) = i. trait_ . as_ref ( ) . and_then ( |t| t. generics ( ) ) {
1354
1354
for bound in generics {
1355
1355
if let Some ( did) = bound. def_id ( ) {
1356
- dids. push ( did) ;
1356
+ dids. insert ( did) ;
1357
1357
}
1358
1358
}
1359
1359
}
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