forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#119997 - GuillaumeGomez:fix-stripped-impl-on-ty-alias, r=notriddle Fix impl stripped in rustdoc HTML whereas it should not be in case the impl is implemented on a type alias Fixes rust-lang#119015. I talked about it a bit with ```@petrochenkov.``` They might change what `EffectiveVisibilities` return for impl items like this one and make them not only reachable but also re-exported, which would fix this case. It could also potentially break other things, so it'll be done whenever they can and then we can check together. Surprisingly, this fix is making rustdoc even closer to rustc in term of errors (the CI currently fails because currently accepted broken codes aren't working anymore with this change). Not sure exactly why though. This is linked to rust-lang#110631 from what I could find. So either I'm missing something here, or we consider it's ok and we consider the failing tests as "should fail" and I'll update `rustdoc-ui` ones. r? ```@notriddle```
- Loading branch information
Showing
3 changed files
with
57 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#![crate_name = "foo"] | ||
|
||
// @has 'foo/index.html' | ||
// There should be only `type A`. | ||
// @count - '//*[@class="item-table"]//*[@class="item-name"]' 1 | ||
// @has - '//*[@class="item-name"]/a[@href="type.A.html"]' 'A' | ||
|
||
mod foo { | ||
pub struct S; | ||
} | ||
|
||
use foo::S; | ||
|
||
pub type A = S; | ||
|
||
// @has 'foo/type.A.html' | ||
// @has - '//*[@id="method.default"]/h4' 'fn default() -> Self' | ||
impl Default for A { | ||
fn default() -> Self { | ||
S | ||
} | ||
} | ||
|
||
// @has - '//*[@id="method.a"]/h4' 'pub fn a(&self)' | ||
impl A { | ||
pub fn a(&self) {} | ||
} |