-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Do not call object_lifetime_default on lifetime params. #101214
Conversation
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 93c6bea070d47b4878ef230860bd8ae1586c05d1 with merge 1b139018b0f4c6e673ea9aef642ae9f62f27f9a4... |
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
Queued 1b139018b0f4c6e673ea9aef642ae9f62f27f9a4 with parent 350cca3, future comparison URL. |
Finished benchmarking commit (1b139018b0f4c6e673ea9aef642ae9f62f27f9a4): comparison URL. Overall result: ✅ improvements - 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 is a highly reliable metric that was used to determine the overall result at the top of this comment.
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 |
r? compiler |
@@ -415,26 +413,21 @@ impl CheckAttrVisitor<'_> { | |||
} | |||
|
|||
/// Debugging aid for `object_lifetime_default` query. | |||
fn check_object_lifetime_default(&self, hir_id: HirId, span: Span) { | |||
fn check_object_lifetime_default(&self, hir_id: HirId) { | |||
let tcx = self.tcx; | |||
if let Some(generics) = tcx.hir().get_generics(tcx.hir().local_def_id(hir_id)) { |
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 could be replaced with let
/else { return; }
, but isn't necessary in this PR.
let param_hir_id = tcx.local_def_id_to_hir_id(param_def_id); | ||
let param = generics.params.iter().find(|p| p.hir_id == param_hir_id)?; | ||
let param = generics.params.iter().find(|p| p.hir_id == param_hir_id).unwrap(); | ||
|
||
// Scan the bounds and where-clauses on parameters to extract bounds | ||
// of the form `T:'a` so as to determine the `ObjectLifetimeDefault` | ||
// for each type parameter. | ||
match param.kind { |
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 can be if let
now.
// in an arbitrary order. | ||
Some(ObjectLifetimeDefault::Empty) | ||
_ => { | ||
bug!("object_lifetime_default_raw must only be called on a type parameter") |
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.
Can we include some extra info on what this method was called on?
@bors r+ |
📌 Commit ca287871a58918fe44245b9a4c51599bafdb9a28 has been approved by It is now in the queue for this repository. |
☔ The latest upstream changes (presumably #98960) made this pull request unmergeable. Please resolve the merge conflicts. |
@bors r=estebank |
☀️ Test successful - checks-actions |
Finished benchmarking commit (84f0c3f): comparison URL. Overall result: ❌✅ regressions and improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
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.
CyclesThis benchmark run did not return any relevant results for this metric. Footnotes |
Small cleanup to avoid unnecessary query invocations in trivial cases.