-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Tweak await span to not contain dot #110823
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
Conversation
r? @b-naber (rustbot has picked a reviewer for you, use r? to override) |
Some changes occurred in src/tools/rustfmt cc @rust-lang/rustfmt |
This comment has been minimized.
This comment has been minimized.
f515918
to
e4ca5fc
Compare
Some changes occurred in src/tools/clippy cc @rust-lang/clippy Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
This comment has been minimized.
This comment has been minimized.
e4ca5fc
to
4630916
Compare
This comment has been minimized.
This comment has been minimized.
4630916
to
5a07067
Compare
compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs
Outdated
Show resolved
Hide resolved
5a07067
to
410fe91
Compare
This comment has been minimized.
This comment has been minimized.
410fe91
to
6d6c904
Compare
@@ -129,6 +132,8 @@ pub fn call_kind<'tcx>( | |||
&& fn_call_span.desugaring_kind() == Some(DesugaringKind::TryBlock) | |||
{ | |||
Some((CallDesugaringKind::TryBlockFromOutput, method_substs.type_at(0))) | |||
} else if fn_call_span.is_desugaring(DesugaringKind::Await) { | |||
Some((CallDesugaringKind::Await, method_substs.type_at(0))) |
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.
Seems somewhat unexpected to have this under CallKind::Normal
. The docs say CallKind::Normal
corresponds to method calls. I mean this is consistent with previous usage, but maybe we should introduce something like CallKind::Other
?
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.
Hmm... this just feels like uplifting the desugaring
part of the Normal
variant up to its own variant. I don't see how this makes things much cleaner 😅
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 just meant that this would be more consistent with the docs of CallKind::Normal
. Feel free to ignore since CallKind::Normal
was also used for other CallDesugaringKind
s before for which that variant doesn't really match the docs afaict. The rest of the PR looks good to me, so r=me.
@bors r=b-naber |
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#110823 (Tweak await span to not contain dot) - rust-lang#111015 (Remove wrong assertion in match checking.) - rust-lang#111023 (Test precise capture with a multi-variant enum and exhaustive patterns) - rust-lang#111032 (Migrate `builtin_macros::asm` diagnostics to translatable diagnostics) - rust-lang#111033 (Ping Nadrieril when changing exhaustiveness checking) - rust-lang#111037 (Close parentheses for `offset_of` in AST pretty printing) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Fixes a discrepancy between method calls and await expressions where the latter are desugared to have a span that contains the dot (i.e.
.await
) but method call identifiers don't contain the dot. This leads to weird suggestions suggestions in borrowck -- see linked issue.Fixes #110761
This mostly touches a bunch of tests to tighten their
await
span.