-
Notifications
You must be signed in to change notification settings - Fork 13k
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 #103254 - fmease:fix-24183, r=GuillaumeGomez
rustdoc: do not filter out cross-crate `Self: Sized` bounds All type parameters **except `Self`** are implicitly `Sized` ([via](https://doc.rust-lang.org/nightly/std/marker/trait.Sized.html)). Previously, we disregarded the exception of `Self` and omitted cross-crate `Sized` bounds of *any* type parameter *including* `Self` when rendering. From now on, we *do* render cross-crate `Self: Sized` bounds. Most notably, in `std` we now finally properly render the `Sized` bound of the `Clone` trait as well as the `Self: Sized` bound on `Iterator::map`. Fixes #24183. ``@rustbot`` label T-rustdoc A-cross-crate-reexports r? rustdoc
- Loading branch information
Showing
4 changed files
with
56 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#![crate_type = "lib"] | ||
|
||
pub trait U/*: ?Sized */ { | ||
fn modified(self) -> Self | ||
where | ||
Self: Sized | ||
{ | ||
self | ||
} | ||
|
||
fn touch(&self)/* where Self: ?Sized */{} | ||
} | ||
|
||
pub trait S: Sized {} |
1 change: 1 addition & 0 deletions
1
src/test/rustdoc/inline_cross/issue-24183.method_no_where_self_sized.html
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 @@ | ||
<h4 class="code-header">fn <a href="#method.touch" class="fnname">touch</a>(&self)</h4> |
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,18 @@ | ||
#![crate_type = "lib"] | ||
#![crate_name = "usr"] | ||
|
||
// aux-crate:issue_24183=issue-24183.rs | ||
// edition: 2021 | ||
|
||
// @has usr/trait.U.html | ||
// @has - '//*[@class="item-decl"]' "pub trait U {" | ||
// @has - '//*[@id="method.modified"]' \ | ||
// "fn modified(self) -> Self\ | ||
// where \ | ||
// Self: Sized" | ||
// @snapshot method_no_where_self_sized - '//*[@id="method.touch"]/*[@class="code-header"]' | ||
pub use issue_24183::U; | ||
|
||
// @has usr/trait.S.html | ||
// @has - '//*[@class="item-decl"]' 'pub trait S: Sized {' | ||
pub use issue_24183::S; |