-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Functions Returning Unresolved Types Wrapped In A Tuple Wrapped In impl Try
Causes Strange Errors When ?
ing & Destructuring
#16801
Comments
I thought we ignore these errors now? |
Those types have different constructors so we don't silence them. We only silence mismatches where the types differ in |
Silencing mismatches between unresolved projections and anything else also makes sense though |
I believe this issue is the same as #16800, which has been addressed. So, we can close this issue now. |
I read #16800 as " |
Yes, the cause of this issue was #16800, but the issue here is more about doing
We can probably repurpose the rust-analyzer/crates/hir-ty/src/infer.rs Lines 698 to 708 in fc0d51a
|
Oh, my apologies, I misunderstood what this issue was about🙊 Following the discussion above, I want to make sure my interpretation is accurate: when one side of I've implemented this, and it seems addressed the problem described in the issue. If my understanding is correct, I will proceed to submit a PR. |
If you mean with unknown type unresolved projections (aka |
I've read some materials on chalk and noted that it presents two methods for expressing projection: Should we take both |
This bug requires a very specific condition to occur. First, you must have a function that returns an
Option
that contains a tuple that contains a type that is not resolved. Once you have that, you must use the function, apply the?
operator on to it's result, and destructure the tuple. After doing that, Rust Analyzer will throw a bogus error on the let statement stating that "non-exhaustive pattern:_
not covered".This title is quite the mouth full, but this is a rather obscure bug. I'm looking to implement a fix for this issue, so let me know if the team wants this issue fixed; there's a chance this doesn't need to be fixed as this bug inherently requires another bug to trigger.
Minimum Reproducible Code
Here is the minimum reproducible code.
Here's the output from
cargo check
on the code.Here's what happens when you hover over the
let
statement.Version Information
rust-analyzer version: 1.76.0 (07dca48 2024-02-04)
rustc version: 1.76.0 (07dca489a 2024-02-04)
The text was updated successfully, but these errors were encountered: