-
Notifications
You must be signed in to change notification settings - Fork 181
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
we only need to prove things one way #754
Conversation
I tried out this patch with rust-analyzer on the rust-analyzer codebase:
So this patch fixes almost all remaining type mismatches (that's the |
@flodiebold ready to merge, I think |
} yields[SolverChoice::slg_default()] { | ||
expect![["Ambiguous; definite substitution for<?U0,?U0> { [?0 := ^0.0, ?1 := '^0.1] }"]] | ||
} yields[SolverChoice::recursive_default()] { | ||
expect![["Ambiguous; suggested substitution for<?U0,?U0> { [?0 := ^0.0, ?1 := '^0.1] }"]] | ||
expect![[r#"Ambiguous; no inference guidance"#]] | ||
} |
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.
And here?
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.
These are, I believe, equivalent. That substitution is an "identity substitution", so it's not very useful guidance. I looked into why this was coming about -- it's because I removed the (erroneous) "early exit" that was causing us to bail out early. What we now do is bail out because we see ?T: '?a
for some unknown ?T
and we can't make progress (in fact, we could see that it's in the environment, but the code doesn't do that today).
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.
A few points, but I'm okay if we want to merge this.
} yields[SolverChoice::slg_default()] { | ||
expect![["Ambiguous; definite substitution for<?U0,?U0> { [?0 := ^0.0, ?1 := '^0.1] }"]] | ||
} yields[SolverChoice::recursive_default()] { | ||
expect![["Ambiguous; suggested substitution for<?U0,?U0> { [?0 := ^0.0, ?1 := '^0.1] }"]] | ||
expect![[r#"Ambiguous; no inference guidance"#]] | ||
} |
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.
The fact these are still different bothers me. Also, SLG is still given the identity solution as "ambiguous", which is somewhat at odds with what the aggregate hack is saying, right?
@@ -0,0 +1,133 @@ | |||
use super::*; |
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 feel like I'd like to see these tests more properly categorized. But I don't know how strongly I feel about it.
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.
Makes sense-- but I'm not sure where to categorize them!
chalk-engine/src/slg/aggregate.rs
Outdated
@@ -83,9 +91,11 @@ impl<I: Interner> AggregateOps<I> for SlgContextOps<'_, I> { | |||
break Guidance::Unknown; | |||
} | |||
|
|||
// FIXME: This may cause us to miss some "trivially true" answers maybe? Haven't investigated very deeply. |
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 guessing this is the cause of the test I pointed out.
chalk-engine/src/slg/aggregate.rs
Outdated
@@ -46,8 +46,16 @@ impl<I: Interner> AggregateOps<I> for SlgContextOps<'_, I> { | |||
} | |||
}; | |||
|
|||
// If the answer is trivially true and thus subsumes all others, then that's a unique-enough answer for us :) |
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.
Maybe at least a comment that this is hacky would be nice.
This reverts commit 502d989.
I reverted the last commit |
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.
r=me with issue opened to reconcile ambiguous vs unique, and how they different between the two solvers
@bors r+ |
📌 Commit 70b2fdb has been approved by |
Filed #760 |
Would it be possible to trigger an early publish? We want to get our hands on this in RA, and upgrading sooner will let us find any issues before the next release. |
I can kick off a release later today. |
☀️ Test successful - checks-actions |
0.82.0 released |
Strangely, I'm not seeing that large of a difference:
|
Sure, but flodiebold reported a 25% speed-up vs. the 8% I got. Still good, but a bit unexpected. |
Partially addresses #727 (some work is left for future work).