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

Fix const deref methods display #91291

Merged
merged 4 commits into from
Dec 2, 2021

Conversation

GuillaumeGomez
Copy link
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
src/test/rustdoc/deref-const-fn.rs Outdated Show resolved Hide resolved
src/librustdoc/html/render/mod.rs Outdated Show resolved Hide resolved
src/librustdoc/html/render/mod.rs Outdated Show resolved Hide resolved
@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
Member Author

Updated!

@GuillaumeGomez
Copy link
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
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
Copy link
Contributor

bors commented Nov 28, 2021

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

@bors
Copy link
Contributor

bors commented Nov 28, 2021

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

@rust-timer
Copy link
Collaborator

Queued 394b433d1b670f0bf2f0d876a42390d2f07474a4 with parent e6d2de9, future comparison URL.

@rust-timer
Copy link
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
Copy link
Member

camelid commented Nov 29, 2021

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.

src/librustdoc/html/render/mod.rs Outdated Show resolved Hide resolved
src/librustdoc/html/render/mod.rs Outdated Show resolved Hide resolved
src/test/rustdoc/deref-const-fn.rs Outdated Show resolved Hide resolved

// @has 'foo/struct.Foo.html'
// @has - '//*[@id="method.len"]' 'pub fn len(&self) -> usize'
// @!has - '//*[@id="method.len"]//span[@class="since"]' '1.0.0'
Copy link
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
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.

Copy link
Member

@camelid camelid Dec 1, 2021

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
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
Member Author

Updated!

@rust-log-analyzer

This comment has been minimized.

@camelid
Copy link
Member

camelid commented Dec 1, 2021

@bors r+

@bors
Copy link
Contributor

bors commented Dec 1, 2021

📌 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
Copy link
Contributor

bors commented Dec 2, 2021

⌛ Testing commit 02782bb with merge d9baa36...

@bors
Copy link
Contributor

bors commented Dec 2, 2021

☀️ 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
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