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

rustdoc: fix position of default in method rendering #110765

Merged
merged 2 commits into from
Jul 20, 2023

Conversation

wackbyte
Copy link
Contributor

@wackbyte wackbyte commented Apr 24, 2023

With the following code:

#![feature(specialization)]

pub trait A {
    unsafe fn a();
}

impl A for () {
    default unsafe fn a() {}
}

rustdoc would render the impl of a as

unsafe default fn a()

which is inconsistent with the actual position of default.
This PR fixes this issue.

@rustbot
Copy link
Collaborator

rustbot commented Apr 24, 2023

r? @jsha

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Apr 24, 2023
@rustbot rustbot added the A-rustdoc-ui Area: Rustdoc UI (generated HTML) label Apr 28, 2023
Copy link
Member

@fmease fmease left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Could you add a test for this though?

@bors
Copy link
Contributor

bors commented Jun 23, 2023

☔ The latest upstream changes (presumably #112957) made this pull request unmergeable. Please resolve the merge conflicts.

Copy link
Member

@fmease fmease left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit, then it's good from my side at least. Thanks for adding the test cases.

@GuillaumeGomez
Copy link
Member

Nice, thanks!

@bors r=fmease,GuillaumeGomez rollup

@bors
Copy link
Contributor

bors commented Jul 20, 2023

📌 Commit 13f58a8 has been approved by fmease,GuillaumeGomez

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 20, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jul 20, 2023
… r=fmease,GuillaumeGomez

rustdoc: fix position of `default` in method rendering

With the following code:
```rs
#![feature(specialization)]

pub trait A {
    unsafe fn a();
}

impl A for () {
    default unsafe fn a() {}
}
```
rustdoc would render the `impl` of `a` as
```rs
unsafe default fn a()
```
which is inconsistent with the actual position of `default`.
This PR fixes this issue.
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 20, 2023
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#110765 (rustdoc: fix position of `default` in method rendering)
 - rust-lang#113529 (Permit pre-evaluated constants in simd_shuffle)
 - rust-lang#113800 (Avoid another gha group nesting)
 - rust-lang#113827 (Add Foreign, Never, FnDef, Closure and Generator tys to SMIR)
 - rust-lang#113835 (new solver: don't consider blanket impls multiple times)
 - rust-lang#113883 (Remove outdated Firefox-specific CSS for search's crate selector appearance)
 - rust-lang#113884 (Don't translate compiler-internal bug messages)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 80f749d into rust-lang:master Jul 20, 2023
@rustbot rustbot added this to the 1.73.0 milestone Jul 20, 2023
@wackbyte wackbyte deleted the fix-defaultness-position branch July 20, 2023 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants