-
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
extend simplify_type
#86986
extend simplify_type
#86986
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
@bors try @rust-timer queue |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
⌛ Trying commit 45273f8187cea4bdd13b5381f00b5fbce354f22b with merge 42b0078198bdfc32d8c25b4bac110afe8785e596... |
I'm not the right reviewer. Looks like you wanted to assign #85048 to |
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
Queued 42b0078198bdfc32d8c25b4bac110afe8785e596 with parent aa65b08, future comparison URL. |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking try commit (42b0078198bdfc32d8c25b4bac110afe8785e596): comparison url. Summary: This change led to significant mixed results 🤷 in compiler performance.
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. Next Steps: If you can justify the regressions found in this perf run, please indicate this with @bors rollup=never |
This comment has been minimized.
This comment has been minimized.
while CI is failing here, I am not able to reproduce this locally 🤔 has someone an idea why that might be? |
@lcnr I'm rather surprised by the 9% regression! It seems like these changes make the "fast reject" more precise without introducing significantly more work, and that seems like it can only be helpful. Do you have any idea what I'm missing here? |
a40cabd
to
aa1c088
Compare
@bors try @rust-timer queue @oli-obk found one case where we end up doing more work. Before that I wasn't sure why we had to rerun more queries with this PR, but tbh i didn't bother as I considered the impact to be negligible. Let's see if this fixes that |
Awaiting bors try build completion. @rustbot label: +S-waiting-on-perf |
/// ² FIXME(@lcnr): this seems like it can actually end up being unsound with the way it's used during | ||
/// candidate selection. We do not consider non blanket impls for `<_ as Trait>::Assoc` even | ||
/// though `_` can be inferred to a concrete type later at which point a concrete impl | ||
/// could actually apply. After experimenting for about an hour I wasn't able to cause any issues | ||
/// this way so I am not going to change this until we actually find an issue as I am really | ||
/// interesting in getting an actual test for this. |
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.
@nikomatsakis does this comment make sense to you? I hoped to trigger it by using something like the following, but wasn't able to make much progress. We either normalize the projection because it is already concrete enough or fail for some different reason. Not sure if this is actually exploitable if it even is an issue.
trait Id {
type Assoc;
}
impl<T> Id for T {
type Assoc = Self;
}
trait Bar<T> {
type Assoc;
fn bar(self) -> Self::Assoc;
}
impl Bar<u32> for i32 {
type Assoc = i32;
fn bar(self) -> Self::Assoc {
1
}
}
fn main() {
let mut x = <<_ as Id>::Assoc>::default();
x = <_ as Bar<u32>>::bar(x);
}
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #91354) made this pull request unmergeable. Please resolve the merge conflicts. |
☔ The latest upstream changes (presumably #91549) made this pull request unmergeable. Please resolve the merge conflicts. |
This comment has been minimized.
This comment has been minimized.
@bors r=nikomatsakis,oli-obk |
📌 Commit 00cbacb has been approved by |
☀️ Test successful - checks-actions |
Finished benchmarking commit (69ac533): comparison url. Summary: This change led to very large relevant mixed results 🤷 in compiler performance.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression |
the only regressions are small changes to some incr-patched tests, so this does seem like a strict perf improvement to me |
@rustbot label: +perf-regression-triaged |
might cause a slight perf inprovement and imo more accurately represents what types there are.
considering that I was going to use this in #85048 it seems like we might need this in the future anyways 🤷