File tree Expand file tree Collapse file tree 3 files changed +38
-3
lines changed Expand file tree Collapse file tree 3 files changed +38
-3
lines changed Original file line number Diff line number Diff line change @@ -1540,6 +1540,13 @@ impl Type {
15401540 _ => None ,
15411541 }
15421542 }
1543+
1544+ pub fn is_generic ( & self ) -> bool {
1545+ match * self {
1546+ ResolvedPath { is_generic, .. } => is_generic,
1547+ _ => false ,
1548+ }
1549+ }
15431550}
15441551
15451552impl GetDefId for Type {
Original file line number Diff line number Diff line change @@ -115,9 +115,9 @@ impl<'a> fold::DocFolder for Stripper<'a> {
115115
116116 // trait impls for private items should be stripped
117117 clean:: ImplItem ( clean:: Impl {
118- for_ : clean:: ResolvedPath { did, .. } , ..
118+ for_ : clean:: ResolvedPath { did, is_generic , .. } , ..
119119 } ) => {
120- if did. is_local ( ) && !self . access_levels . is_exported ( did) {
120+ if did. is_local ( ) && !is_generic && ! self . access_levels . is_exported ( did) {
121121 return None ;
122122 }
123123 }
@@ -183,7 +183,9 @@ impl<'a> fold::DocFolder for ImplStripper<'a> {
183183 fn fold_item ( & mut self , i : Item ) -> Option < Item > {
184184 if let clean:: ImplItem ( ref imp) = i. inner {
185185 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+ {
187189 return None ;
188190 }
189191 }
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