File tree 5 files changed +66
-9
lines changed
5 files changed +66
-9
lines changed Original file line number Diff line number Diff line change @@ -337,18 +337,13 @@ pub fn build_impl(
337
337
// reachable in rustdoc generated documentation
338
338
if !did. is_local ( ) {
339
339
if let Some ( traitref) = associated_trait {
340
- if !cx. renderinfo . borrow ( ) . access_levels . is_public ( traitref. def_id ) {
340
+ let did = traitref. def_id ;
341
+ if !cx. renderinfo . borrow ( ) . access_levels . is_public ( did) {
341
342
return ;
342
343
}
343
- }
344
344
345
- // Skip foreign unstable traits from lists of trait implementations and
346
- // such. This helps prevent dependencies of the standard library, for
347
- // example, from getting documented as "traits `u32` implements" which
348
- // isn't really too helpful.
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 ( ) {
345
+ if let Some ( stab) = tcx. lookup_stability ( did) {
346
+ if stab. level . is_unstable ( ) && stab. feature == sym:: rustc_private {
352
347
return ;
353
348
}
354
349
}
@@ -372,6 +367,12 @@ pub fn build_impl(
372
367
if !cx. renderinfo . borrow ( ) . access_levels . is_public ( did) {
373
368
return ;
374
369
}
370
+
371
+ if let Some ( stab) = tcx. lookup_stability ( did) {
372
+ if stab. level . is_unstable ( ) && stab. feature == sym:: rustc_private {
373
+ return ;
374
+ }
375
+ }
375
376
}
376
377
}
377
378
Original file line number Diff line number Diff line change
1
+ // aux-build:realcore.rs
2
+
3
+ #![ crate_name = "real_gimli" ]
4
+ #![ feature( staged_api, extremely_unstable) ]
5
+ #![ unstable( feature = "rustc_private" , issue = "none" ) ]
6
+
7
+ extern crate realcore;
8
+
9
+ #[ unstable( feature = "rustc_private" , issue = "none" ) ]
10
+ pub struct EndianSlice ;
11
+
12
+ #[ unstable( feature = "rustc_private" , issue = "none" ) ]
13
+ impl realcore:: Deref for EndianSlice { }
Original file line number Diff line number Diff line change
1
+ #![ crate_name = "realcore" ]
2
+ #![ feature( staged_api) ]
3
+ #![ unstable( feature = "extremely_unstable" , issue = "none" ) ]
4
+
5
+ #[ unstable( feature = "extremely_unstable_foo" , issue = "none" ) ]
6
+ pub struct Foo { }
7
+
8
+ #[ unstable( feature = "extremely_unstable_foo" , issue = "none" ) ]
9
+ pub trait Join { }
10
+
11
+ #[ unstable( feature = "extremely_unstable_foo" , issue = "none" ) ]
12
+ impl Join for Foo { }
13
+
14
+ #[ stable( feature = "faked_deref" , since = "1.47.0" ) ]
15
+ pub trait Deref { }
Original file line number Diff line number Diff line change
1
+ // ignore-tidy-linelength
2
+ // aux-build:realcore.rs
3
+ // aux-build:real_gimli.rs
4
+
5
+ // Ensure unstably exported traits have their Implementors sections.
6
+
7
+ #![ crate_name = "foo" ]
8
+ #![ feature( extremely_unstable_foo) ]
9
+
10
+ extern crate realcore;
11
+ extern crate real_gimli;
12
+
13
+ // issue #74672
14
+ // @!has foo/trait.Deref.html '//*[@id="impl-Deref-for-EndianSlice"]//code' 'impl Deref for EndianSlice'
15
+ pub use realcore:: Deref ;
16
+
17
+ // @has foo/trait.Join.html '//*[@id="impl-Join-for-Foo"]//code' 'impl Join for Foo'
18
+ pub use realcore:: Join ;
Original file line number Diff line number Diff line change @@ -142,6 +142,16 @@ fn is_exception(file: &Path, link: &str) -> bool {
142
142
if let Some ( entry) = LINKCHECK_EXCEPTIONS . iter ( ) . find ( |& ( f, _) | file. ends_with ( f) ) {
143
143
entry. 1 . contains ( & link)
144
144
} else {
145
+ // FIXME(#63351): Concat trait in alloc/slice reexported in primitive page
146
+ //
147
+ // NOTE: This cannot be added to `LINKCHECK_EXCEPTIONS` because the resolved path
148
+ // calculated in `check` function is outside `build/<triple>/doc` dir.
149
+ // So the `strip_prefix` method just returns the old absolute broken path.
150
+ if file. ends_with ( "std/primitive.slice.html" ) {
151
+ if link. ends_with ( "primitive.slice.html" ) {
152
+ return true ;
153
+ }
154
+ }
145
155
false
146
156
}
147
157
}
You can’t perform that action at this time.
0 commit comments