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

Track derive attrs for more accurate suggestion #98965

Closed
wants to merge 1 commit into from

Conversation

estebank
Copy link
Contributor

@estebank estebank commented Jul 5, 2022

No description provided.

@rustbot rustbot added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jul 5, 2022
@rust-highfive
Copy link
Collaborator

r? @wesleywiser

(rust-highfive has picked a reviewer for you, use r? to override)

@rustbot
Copy link
Collaborator

rustbot commented Jul 5, 2022

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 5, 2022
@estebank
Copy link
Contributor Author

estebank commented Jul 5, 2022

@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 Jul 5, 2022
@bors
Copy link
Contributor

bors commented Jul 5, 2022

⌛ Trying commit 867d666 with merge a04efadf063b0b15950cb94e70984666c444fa0a...

@bors
Copy link
Contributor

bors commented Jul 6, 2022

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

@rust-timer
Copy link
Collaborator

Queued a04efadf063b0b15950cb94e70984666c444fa0a with parent 7b46aa5, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (a04efadf063b0b15950cb94e70984666c444fa0a): comparison url.

Instruction count

  • Primary benchmarks: mixed results
  • Secondary benchmarks: 🎉 relevant improvements found
mean1 max count2
Regressions 😿
(primary)
0.4% 0.4% 5
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
-0.4% -0.4% 1
Improvements 🎉
(secondary)
-1.2% -2.2% 13
All 😿🎉 (primary) 0.2% 0.4% 6

Max RSS (memory usage)

Results
  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: mixed results
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
2.8% 2.8% 1
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
-8.2% -8.2% 1
All 😿🎉 (primary) N/A N/A 0

Cycles

Results
  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: 🎉 relevant improvements found
mean1 max count2
Regressions 😿
(primary)
N/A N/A 0
Regressions 😿
(secondary)
N/A N/A 0
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
-2.9% -4.0% 3
All 😿🎉 (primary) N/A N/A 0

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 may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

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

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jul 6, 2022
@estebank
Copy link
Contributor Author

estebank commented Jul 6, 2022

@petrochenkov I was looking at alternatives to address #98822. Because we remove the derive attr post-expansion, that information is understandably no longer available by the time we're doing trait evaluation as it never carries into the HIR. This is a hack to avoid potential unintended fallout, but would like to hear your take on how we could tackle this.

@Mark-Simulacrum
Copy link
Member

FWIW, I think it may not be a bug worth fixing -- adding the extra context may almost be more confusing in my eyes than showing the derive standalone (e.g., leading to a conclusion that the extra bits are needed). It seems like more of a stylistic lint to keep all derives in the same block, maybe best for Clippy or rustfmt to do that re-arranging.

It probably adds to the confusion though that we're emitting a "code block" in the lint help text, rather than just saying to annotate with derive(Debug) without additional context. If that included the struct Foo then that would make more sense, but as-is seems like just noise to me.

@estebank
Copy link
Contributor Author

estebank commented Aug 4, 2022

If this approach isn't worth it, I'm closing this PR. We can look for alternative approaches (but I'm uncertain we'll find a better approach).

@estebank estebank closed this Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants