Tweak await span to not contain dot#110823
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
5a07067 to
410fe91
Compare
This comment has been minimized.
This comment has been minimized.
410fe91 to
6d6c904
Compare
| { | ||
| 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.
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.
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.
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 CallDesugaringKinds 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
awaitspan.