-
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
Suppress follow-up errors in type checking #6975
Comments
Just curious, how are we resolving |
No, that is something rust-analyzer does. Chalk only handles trait solving, not method resolution. |
So does this happen for inherent methods too, or only for trait methods? It seems like something is saying "we don't know the type of |
During method resolution, we ask Chalk 'does this unknown type implement that trait?' and Chalk says 'maybe', so we select the method. One easy step that would fix most of the issues already would be to check in the argument count diagnostic whether the receiver is unknown. |
Would it make sense to take "maybe" as "no"? I'm not sure how often that happens, but in the long run I'd assume that's what the compiler will do. |
No, at that point we need to accept 'maybe'; the compiler does the same. When the method is selected, an obligation is registered to make sure it later becomes a 'yes'. |
Did that: #7125 |
I'm not sure this is the same but I get let r = rows.next(); // rusqlite::Rows
match r {
Some(r) => match r {
Ok(r) => {
println!( "{:20} {:<10} {:>20}→{:>20} {:15} {:15}⇒{:15} {:15} {:20} (c{})",
r.get::<usize,String>(5), r.get::<usize,String>(1), … while it compiles fine. |
I assume you get the error on the |
The bold parts are complained at: r is a |
That's weird. Can you make a new issue, ideally with a small reproduction? |
Is this still relevant? The initial snippet no longer triggers a diagnostic for me |
I think the general topic is still relevant. |
Since the recent update I'm getting:
errors. Shouldn't we silence such errors when the type involves |
Can we close this after #16583 and the previous changes? |
I'd say yes, there are probaly more occasions we should look at but those will pop up when we find them |
In this situation:
we currently emit a
mismatched-arg-count
diagnostic because we resolve themax
call toIterator::max
. We should avoid emitting diagnostics in such a situation, becausex
was already of an unknown type.Doing this isn't easy though and requires some refactoring, so this issue is unactionable for now.
The text was updated successfully, but these errors were encountered: