-
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
Make sure to instantiate placeholders correctly in old solver #119947
Make sure to instantiate placeholders correctly in old solver #119947
Conversation
trait Everyone {} | ||
impl<T: ?Sized> Everyone for T {} | ||
|
||
fn hello() where for<T> <T as Id>::Output: Everyone {} |
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'm somewhat concerned that this doesn't fail if we, for example, replace with this for<'a> <&'a () as Id>::Output
, which should have this same issue? 🤔
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 think this is also an issue for regions, but we may never canonicalize placeholders from a non-root universe?
in MIR typeck we instantiate the binder in the query, so it doesn't contain placeholders.
Method probing also only has root variables 🤔
Where else do we use the old canonicalizer?
@bors try @rust-timer queue r=me after perf |
This comment has been minimized.
This comment has been minimized.
…te-response, r=<try> Make sure to instantiate placeholders correctly in old solver When creating the query substitution guess for an input placeholder type like `!1_T` (in universe 1), we were guessing the response substitution with something like `!0_T`. This failed to unify with `!1_T`, causing an ICE. This PR reworks the query substitution guess code to work a bit more like the new solver. I'm *pretty* sure this is correct, though I'd really appreciate some scrutiny from someone (*cough* lcnr) who knows a bit more about query instantiation :) Fixes rust-lang#119941 r? lcnr
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (4d4360e): 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.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 666.737s -> 667.157s (0.06%) |
uwu @bors r=lcnr |
☀️ Test successful - checks-actions |
Finished benchmarking commit (533cfde): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression 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.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 664.881s -> 664.25s (-0.09%) |
When creating the query substitution guess for an input placeholder type like
!1_T
(in universe 1), we were guessing the response substitution with something like!0_T
. This failed to unify with!1_T
, causing an ICE.This PR reworks the query substitution guess code to work a bit more like the new solver. I'm pretty sure this is correct, though I'd really appreciate some scrutiny from someone (cough lcnr) who knows a bit more about query instantiation :)
Fixes #119941
r? lcnr