Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 7 pull requests #86399

Merged
merged 26 commits into from Jun 17, 2021
Merged

Rollup of 7 pull requests #86399

merged 26 commits into from Jun 17, 2021

Conversation

JohnTitor
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

Thomasdezeeuw and others added 26 commits May 29, 2021 10:08
To make way for a new IoSlice(Mut)::advance function that advances a
single slice.

Also changes the signature to accept a `&mut &mut [IoSlice]`, not
returning anything. This will better match the future IoSlice::advance
function.
Advance the internal cursor of a single slice.
Currently the same message is used for hard errors and soft errors. This
makes hard errors use a message that indicates the reality of the
situation correctly, since usage of the constant is never allowed when
there was a hard error evaluating it.
The previous linking seemed confusing: within "the sum() method on
iterators", "sum()" was linked to `Sum::sum`, not `Iterator::sum`, even
though the sentence is talking about the latter.

I have rewritten the sentence to be, I believe, clearer, as well as
changing the link destinations; applying the same change to the
`Product` documentation as well as `Sum`.
These were hidden by default, and duplicated information already on the
page anyhow.

Also remove the "Auto-hide trait implementors of a trait" setting,
which is not needed anymore.
This method on the Iterator trait is doc(hidden), and about half of
implementations were doc(hidden). This adds the attribute to the
remaining implementations.
That means it will be visible under "Implementors" on trait pages, and
under "Implementations" on struct/enum pages, even when all methods are
collapsed.

Switch to a float layout for rightside elements.
This covers rendering of stability_since and the srclink across methods
and trait implementations, so their DOM representation is consistent.
Also factor out outer_version and const_outer_version into
render_rightside.
These were previously removed along with the details in the
"Implementors" section of trait pages. But for "Implementations on
Foreign Types," we need to include the details because they will not be
documented anywhere else.
…ou-se

Rename IoSlice(Mut)::advance to advance_slice and add IoSlice(Mut)::advance

Also changes the signature of `advance_slice` to accept a `&mut &mut [IoSlice]`, not returning anything. This will better match the `IoSlice::advance` function.

Updates rust-lang#62726.
…=GuillaumeGomez

Remove methods under Implementors on trait pages

As discussed at rust-lang#84326 (comment).

On a trait page, the "Implementors" section currently lists all methods of each implementor. That duplicates the method definitions on the trait itself, and is usually not very useful. So the implementors are collapsed by default. This PR changes rustdoc to just not render them at all. Any documentation specific to an implementor can be found by clicking through to the implementor's page.

This moves the "portability" info inside the `<summary>` tags so it is still visible on trait pages (as originally implemented in rust-lang#79201). That also means it will be visible on struct/enum pages when methods are collapsed.

Add `#[doc(hidden)]` to all implementations of `Iterator::__iterator_get_unchecked` that didn't already have it. Otherwise, due to rust-lang#86145, the structs/enums with those implementations would generate documentation for them, and that documentation would have a broken link into the Iterator page. Those links were already "broken" but not detected by the link-checker, because they pointed to one of the Implementors on the Iterator page, which happened to have the right anchor name.

This reduces the Read trait's page size from 128kB to 68kB (uncompressed) and from 12,125 bytes to 9,989 bytes (gzipped
Demo:

https://hoffman-andrews.com/rust/remove-methods-implementors/std/string/struct.String.html#trait-implementations
https://hoffman-andrews.com/rust/remove-methods-implementors/std/io/trait.Read.html#implementors

r? `@GuillaumeGomez`
…=RalfJung

Use better error message for hard errors in CTFE

I noticed this while working on rust-lang#86255: currently the same message is used for hard errors and soft errors in CTFE. This changes the error messages to make hard errors use a message that indicates the reality of the situation correctly, since usage of the constant is never allowed when there was a hard error evaluating it. This doesn't affect the behaviour of these error messages, only the content.

This changes the error logic to check if the error should be hard or soft where it is generated, instead of where it is emitted, to allow this distinction in error messages.
Do not emit invalid suggestions on multiple mutable borrow errors

Fixes rust-lang#85581
Remove invalid suggestions for assoc consts on placeholder type error

Fixes rust-lang#82158
This also moves some tests to typeck.
r? ``@estebank``
Make `sum()` and `product()` documentation hyperlinks refer to `Iterator` methods.

The previous linking seemed confusing: within "the sum() method on iterators", "sum()" was linked to `Sum::sum`, not `Iterator::sum`, even though the sentence is talking about the latter. I have rewritten the sentence to be, I believe, clearer, as well as changing the link destinations; applying the same change to the `Product` documentation as well as `Sum`.

I reviewed other traits in the same module and did not see similar issues, and previewed the results using `./x.py doc library/std`.
@rustbot rustbot added the rollup A PR which is a rollup label Jun 17, 2021
@JohnTitor
Copy link
Member Author

@bors r+ p=7 rollup=never

@bors
Copy link
Contributor

bors commented Jun 17, 2021

📌 Commit 65d412b has been approved by JohnTitor

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jun 17, 2021
@bors
Copy link
Contributor

bors commented Jun 17, 2021

⌛ Testing commit 65d412b with merge 4d3ce2e...

@bors
Copy link
Contributor

bors commented Jun 17, 2021

☀️ Test successful - checks-actions
Approved by: JohnTitor
Pushing 4d3ce2e to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 17, 2021
@bors bors merged commit 4d3ce2e into rust-lang:master Jun 17, 2021
@rustbot rustbot added this to the 1.55.0 milestone Jun 17, 2021
@rust-highfive
Copy link
Collaborator

📣 Toolstate changed by #86399!

Tested on commit 4d3ce2e.
Direct link to PR: #86399

💔 miri on windows: test-pass → test-fail (cc @RalfJung @oli-obk @eddyb).
💔 miri on linux: test-pass → test-fail (cc @RalfJung @oli-obk @eddyb).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants