-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Suppress unused_mut if unused_variables is reported #101977
Conversation
r? @nagisa (rust-highfive has picked a reviewer for you, use r? to override) |
69c3666
to
50f8558
Compare
This comment has been minimized.
This comment has been minimized.
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 50f8558 with merge b3d31c22c20e7390b577ec096a8c97ea87df12fa... |
☀️ Try build successful - checks-actions |
Queued b3d31c22c20e7390b577ec096a8c97ea87df12fa with parent 11bb80a, future comparison URL. |
Finished benchmarking commit (b3d31c22c20e7390b577ec096a8c97ea87df12fa): comparison URL. Overall result: no relevant changes - no action neededBenchmarking 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. @bors rollup=never Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Footnotes |
@@ -830,7 +830,8 @@ rustc_queries! { | |||
desc { |tcx| "checking privacy in {}", describe_as_module(key, tcx) } | |||
} | |||
|
|||
query check_liveness(key: DefId) { | |||
query check_liveness(key: DefId) -> Option<FxIndexSet<Span>> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spans are not a very robust source of information. Do we have a better, more "semantic" source of information?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried, but couldn't find one. Rather, there is a lot on liveness side working on HIR, but they are missing on borrowck side working on MIR, which needs to use this information.
.into_iter() | ||
.map(|(_, _, ident_span)| ident_span) | ||
.collect::<Vec<_>>(); | ||
self.unused_variables_spans.borrow_mut().extend(&spans); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will populate unused_variables_spans
even if we do not emit an unused_variable lint, if explicitly allowed for instance. This may be surprising, not to have a lint at all in those cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. It is troublesome indeed. I will think about it.
@cjgillot you want to keep reviewing this to the end or should I take a look at this still? |
I can take it you don't want to keep it. |
☔ The latest upstream changes (presumably #101986) made this pull request unmergeable. Please resolve the merge conflicts. |
@sanxiyn Ping from triage: I'm closing this due to inactivity, Please reopen when you are ready to continue with this. @rustbot label: +S-inactive |
Fix #97074.