File tree Expand file tree Collapse file tree 3 files changed +42
-3
lines changed Expand file tree Collapse file tree 3 files changed +42
-3
lines changed Original file line number Diff line number Diff line change @@ -346,9 +346,11 @@ pub fn build_impl(
346346 // such. This helps prevent dependencies of the standard library, for
347347 // example, from getting documented as "traits `u32` implements" which
348348 // isn't really too helpful.
349- if let Some ( stab) = cx. tcx . lookup_stability ( did) {
350- if stab. level . is_unstable ( ) {
351- return ;
349+ if let Some ( trait_did) = associated_trait {
350+ if let Some ( stab) = cx. tcx . lookup_stability ( trait_did. def_id ) {
351+ if stab. level . is_unstable ( ) {
352+ return ;
353+ }
352354 }
353355 }
354356 }
Original file line number Diff line number Diff line change 1+ #![ feature( staged_api) ]
2+ #![ stable( feature = "private_general" , since = "1.0.0" ) ]
3+
4+ #[ unstable( feature = "private_trait" , issue = "none" ) ]
5+ pub trait Bar { }
6+
7+ #[ stable( feature = "private_general" , since = "1.0.0" ) ]
8+ pub struct Foo {
9+ // nothing
10+ }
11+
12+ impl Foo {
13+ #[ stable( feature = "private_general" , since = "1.0.0" ) ]
14+ pub fn stable_impl ( ) { }
15+ }
16+
17+ impl Foo {
18+ #[ unstable( feature = "private_trait" , issue = "none" ) ]
19+ pub fn bar ( ) { }
20+
21+ #[ stable( feature = "private_general" , since = "1.0.0" ) ]
22+ pub fn bar2 ( ) { }
23+ }
24+
25+ #[ stable( feature = "private_general" , since = "1.0.0" ) ]
26+ impl Bar for Foo { }
Original file line number Diff line number Diff line change 1+ // aux-build:unstable-trait.rs
2+
3+ #![ crate_name = "foo" ]
4+ #![ feature( private_trait) ]
5+
6+ extern crate unstable_trait;
7+
8+ // @has foo/struct.Foo.html 'bar'
9+ // @has foo/struct.Foo.html 'bar2'
10+ #[ doc( inline) ]
11+ pub use unstable_trait:: Foo ;
You can’t perform that action at this time.
0 commit comments