-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Invalid 'compatible variant' suggestion on mismatched types in .await
expression
#93074
Comments
I'm not entirely sure if this means that |
.await
expression.await
expression
hmm.. is If wonder if the expr should have the bigger span by default, and then async-specific code could grab the tighter span for diagnostics that need to point at the |
Some of the |
I thought I might have accidentally introduced this bug in #90575, but right after that PR was merged, the output was correct:
So something changed in the last two months in what spans are used for await desugarings, it seems. |
@compiler-errors this was introduced in the PR linked earlier to try and improve other errors. It is tricky because reducing the span to only |
Tweak `expr.await` desugaring `Span` Fix rust-lang#93074
Tweak `expr.await` desugaring `Span` Fix rust-lang#93074
This code:
produces:
Which is invalid.
Looks like the span of the desugaring of
.await
uses only the.await
part, instead of the span of the entire expression. This results in invalid suggestions when used by thesuggest_compatible_variants
code incompiler/rustc_typeck/src/check/demand.rs
.The text was updated successfully, but these errors were encountered: