File tree 3 files changed +38
-3
lines changed
3 files changed +38
-3
lines changed Original file line number Diff line number Diff line change @@ -1540,6 +1540,13 @@ impl Type {
1540
1540
_ => None ,
1541
1541
}
1542
1542
}
1543
+
1544
+ pub fn is_generic ( & self ) -> bool {
1545
+ match * self {
1546
+ ResolvedPath { is_generic, .. } => is_generic,
1547
+ _ => false ,
1548
+ }
1549
+ }
1543
1550
}
1544
1551
1545
1552
impl GetDefId for Type {
Original file line number Diff line number Diff line change @@ -115,9 +115,9 @@ impl<'a> fold::DocFolder for Stripper<'a> {
115
115
116
116
// trait impls for private items should be stripped
117
117
clean:: ImplItem ( clean:: Impl {
118
- for_ : clean:: ResolvedPath { did, .. } , ..
118
+ for_ : clean:: ResolvedPath { did, is_generic , .. } , ..
119
119
} ) => {
120
- if did. is_local ( ) && !self . access_levels . is_exported ( did) {
120
+ if did. is_local ( ) && !is_generic && ! self . access_levels . is_exported ( did) {
121
121
return None ;
122
122
}
123
123
}
@@ -183,7 +183,9 @@ impl<'a> fold::DocFolder for ImplStripper<'a> {
183
183
fn fold_item ( & mut self , i : Item ) -> Option < Item > {
184
184
if let clean:: ImplItem ( ref imp) = i. inner {
185
185
if let Some ( did) = imp. for_ . def_id ( ) {
186
- if did. is_local ( ) && !self . retained . contains ( & did) {
186
+ if did. is_local ( ) && !imp. for_ . is_generic ( ) &&
187
+ !self . retained . contains ( & did)
188
+ {
187
189
return None ;
188
190
}
189
191
}
Original file line number Diff line number Diff line change
1
+ // Copyright 2016 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
+ use std:: fmt;
12
+
13
+ // @has issue_29503/trait.MyTrait.html
14
+ pub trait MyTrait {
15
+ fn my_string ( & self ) -> String ;
16
+ }
17
+
18
+ // @has - "//ul[@id='implementors-list']/li" "impl<T> MyTrait for T where T: Debug"
19
+ impl < T > MyTrait for T where T : fmt:: Debug {
20
+ fn my_string ( & self ) -> String {
21
+ format ! ( "{:?}" , self )
22
+ }
23
+ }
24
+
25
+ pub fn main ( ) {
26
+ }
You can’t perform that action at this time.
0 commit comments