Skip to content

Fix const deref methods display#91291

Merged
bors merged 4 commits into
rust-lang:masterfrom
GuillaumeGomez:const-deref-method
Dec 2, 2021
Merged

Fix const deref methods display#91291
bors merged 4 commits into
rust-lang:masterfrom
GuillaumeGomez:const-deref-method

Conversation

@GuillaumeGomez

Copy link
Copy Markdown
Member

Fixes #90855 (more information in the issue).

r? @camelid

@GuillaumeGomez GuillaumeGomez added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-rustdoc-ui Area: Rustdoc UI (generated HTML) labels Nov 27, 2021
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 27, 2021
Comment thread src/librustdoc/html/render/mod.rs Outdated
Comment thread src/test/rustdoc/deref-const-fn.rs Outdated
Comment thread src/librustdoc/html/render/mod.rs Outdated
Comment thread src/librustdoc/html/render/mod.rs Outdated
@camelid camelid added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 27, 2021
@GuillaumeGomez GuillaumeGomez added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 28, 2021
@GuillaumeGomez

Copy link
Copy Markdown
Member Author

Updated!

Comment thread src/librustdoc/html/render/mod.rs Outdated
@GuillaumeGomez

Copy link
Copy Markdown
Member Author

@camelid I think you had a great idea: replacing the &str with Symbol could be very interesting. Let's run a perf check.

@bors try @rust-timer queue

@rust-timer

Copy link
Copy Markdown
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 28, 2021
@bors

bors commented Nov 28, 2021

Copy link
Copy Markdown
Collaborator

⌛ Trying commit 9e8cd4f0e1f6af9c8d7fa8ee9aed757dd85e1e6f with merge 394b433d1b670f0bf2f0d876a42390d2f07474a4...

@bors

bors commented Nov 28, 2021

Copy link
Copy Markdown
Collaborator

☀️ Try build successful - checks-actions
Build commit: 394b433d1b670f0bf2f0d876a42390d2f07474a4 (394b433d1b670f0bf2f0d876a42390d2f07474a4)

@rust-timer

Copy link
Copy Markdown
Collaborator

Queued 394b433d1b670f0bf2f0d876a42390d2f07474a4 with parent e6d2de9, future comparison URL.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (394b433d1b670f0bf2f0d876a42390d2f07474a4): comparison url.

Summary: This change led to large relevant improvements 🎉 in compiler performance.

  • Large improvement in instruction counts (up to -3.9% on incr-unchanged builds of deep-vector)

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf.

@bors rollup=never
@rustbot label: +S-waiting-on-review -S-waiting-on-perf -perf-regression

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Nov 28, 2021
@camelid

camelid commented Nov 29, 2021

Copy link
Copy Markdown
Member

Some slight doc instructions improvements, and the cleanup is good anyway. The improvements reported in the summary are just deep-vector being spurious as usual.

Comment thread src/librustdoc/clean/types.rs Outdated
Comment thread src/librustdoc/html/render/mod.rs Outdated
Comment thread src/librustdoc/html/render/mod.rs Outdated
Comment thread src/librustdoc/html/render/mod.rs Outdated
Comment thread src/test/rustdoc/deref-const-fn.rs Outdated
Comment thread src/librustdoc/html/render/mod.rs Outdated
Comment thread src/librustdoc/html/render/mod.rs Outdated
Comment thread src/test/rustdoc/deref-const-fn.rs Outdated
Comment thread src/test/rustdoc/deref-const-fn.rs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hmm, shouldn't stability be shown? Or I guess it depends on when the Deref impl was added too.

Weirdly, https://doc.rust-lang.org/nightly/std/string/struct.String.html#deref-methods-str shows regular and const stability, but https://doc.rust-lang.org/nightly/std/path/struct.PathBuf.html#deref-methods-Path shows neither. Something fishy's going on with re-exports, since https://doc.rust-lang.org/nightly/alloc/string/struct.String.html#deref-methods-str shows stability for some methods but not all and is missing many methods that the std version has. (I think I opened an issue for part of this at some point.)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Since you already opened the issue, I'll mark this discussion as resolved.

@camelid camelid Dec 1, 2021

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No, the issue I opened was just about how different methods were shown between std and alloc. But I guess this bug is unrelated to this PR?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I thought 1.0.0 without the const version is hidden. Maybe that's why? If there is a stable const version, then we show 1.0.0 (const: 1.xx.0) or const: unstable.

@camelid camelid added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 30, 2021
@GuillaumeGomez GuillaumeGomez added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 30, 2021
@GuillaumeGomez

Copy link
Copy Markdown
Member Author

Updated!

@rust-log-analyzer

This comment has been minimized.

@camelid

camelid commented Dec 1, 2021

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Dec 1, 2021

Copy link
Copy Markdown
Collaborator

📌 Commit 02782bb has been approved by camelid

@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 Dec 1, 2021
@bors

bors commented Dec 2, 2021

Copy link
Copy Markdown
Collaborator

⌛ Testing commit 02782bb with merge d9baa36...

@bors

bors commented Dec 2, 2021

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-actions
Approved by: camelid
Pushing d9baa36 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 2, 2021
@bors bors merged commit d9baa36 into rust-lang:master Dec 2, 2021
@rustbot rustbot added this to the 1.59.0 milestone Dec 2, 2021
@GuillaumeGomez GuillaumeGomez deleted the const-deref-method branch December 2, 2021 09:11
@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (d9baa36): comparison url.

Summary: This benchmark run did not return any relevant changes.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

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) merged-by-bors This PR was explicitly merged by bors. 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.

Rustdoc: Methods from Deref should not be const

9 participants