-
Notifications
You must be signed in to change notification settings - Fork 1.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
fix: #12247 fully qualified call required to determine trait method type #13754
Conversation
r? @flodiebold |
Maybe I'm misunderstanding the change, but I'm a bit confused. The test code doesn't actually work under rustc. Also, we would actually need to call (or simulate calling) |
the case is like that the chalk doesn’t have enough knowledge to decide which impl to use. so add error type information.
|
e9e0910
to
605b616
Compare
Sorry I don't know what the detail difference between |
☔ The latest upstream changes (presumably #14036) made this pull request unmergeable. Please resolve the merge conflicts. |
let residual = self.resolve_ops_try_err(); | ||
let expect_err = self.resolve_associated_type(self.return_ty.clone(), residual); | ||
let actual_err = self.resolve_associated_type(actual_ret, residual); | ||
self.table.unify(&actual_err, &expect_err); |
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 would cause a false positive type mismatch in this code:
fn x() -> Result<(), E2> {
let a: Result<i32, _> = Ok(2);
let b = a?;
let c: Result<i32, E1> = a;
Ok(())
}
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.
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.
With the from impl, it works (playground).
☔ The latest upstream changes (presumably #14368) made this pull request unmergeable. Please resolve the merge conflicts. |
What is the status of this PR? I am still not sure what this is trying to fix. |
I think this is now in an unrecoverable / irrelevant state, as we now desugar |
under standard core
![截屏2022-12-10 15 26 53](https://user-images.githubusercontent.com/7943146/206839503-0c68e2c4-aecd-4bb6-ac05-ac1e4aa16ca5.png)