Skip to content

Fix incorrect use of await in parser suggestion - #163238

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
chenyukang:yukang-fix-await-macro-suggestion-parens
Sep 24, 2026
Merged

rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
chenyukang:yukang-fix-await-macro-suggestion-parens

Conversation

@chenyukang

Copy link
Copy Markdown
Member

The old suggestion of:

LL -     let _ = await!(bar())?;
LL +     let _ = bar().await)?;

is wrong because of the lefted ) was unremoved, and also here we need to take care of expr precedence.

@rustbot

rustbot commented Sep 24, 2026

Copy link
Copy Markdown
Collaborator

The parser was modified, potentially altering the grammar of (stable) Rust
which would be a breaking change.

cc @fmease

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 24, 2026
@rustbot

rustbot commented Sep 24, 2026

Copy link
Copy Markdown
Collaborator

r? @khyperia

rustbot has assigned @khyperia.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 77 candidates
  • Random selection from 20 candidates

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job test-x86_64-gnu-miri failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
tests/pass-dep/libc/mmap.rs ... ok
tests/pass-dep/tokio/socket.rs ... ok

FAILED TEST: tests/pass-dep/libc/libc-socket-no-blocking-epoll.rs
command: MIRI_ENV_VAR_TEST="0" MIRI_TEMP="/tmp/miri-uitest-4uggLf" RUST_BACKTRACE="1" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/miri" "--error-format=json" "-Dwarnings" "-Dunused" "-Ainternal_features" "-Zui-testing" "--sysroot=/checkout/obj/build/x86_64-unknown-linux-gnu/miri-sysroot" "-O" "-Zmir-opt-level=4" "-Cdebug-assertions=yes" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/tmp/miri_ui/0/tests/pass-dep/libc" "tests/pass-dep/libc/libc-socket-no-blocking-epoll.rs" "-Zmiri-disable-isolation" "--extern" "cross_crate_items=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/cross-crate-items/1c83654c74fd1f60/out/libcross_crate_items-1c83654c74fd1f60.rlib" "--extern" "cross_crate_items=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/cross-crate-items/1c83654c74fd1f60/out/libcross_crate_items-1c83654c74fd1f60.rmeta" "--extern" "getrandom_01=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/getrandom/d9dca7ad9ba2664e/out/libgetrandom-d9dca7ad9ba2664e.rlib" "--extern" "getrandom_01=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/getrandom/d9dca7ad9ba2664e/out/libgetrandom-d9dca7ad9ba2664e.rmeta" "--extern" "getrandom_02=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/getrandom/ad538e6b8fd1adac/out/libgetrandom-ad538e6b8fd1adac.rlib" "--extern" "getrandom_02=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/getrandom/ad538e6b8fd1adac/out/libgetrandom-ad538e6b8fd1adac.rmeta" "--extern" "getrandom_03=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/getrandom/b99eff8e14285543/out/libgetrandom-b99eff8e14285543.rlib" "--extern" "getrandom_03=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/getrandom/b99eff8e14285543/out/libgetrandom-b99eff8e14285543.rmeta" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/libc/e87a1168fda13455/out/liblibc-e87a1168fda13455.rlib" "--extern" "libc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/libc/e87a1168fda13455/out/liblibc-e87a1168fda13455.rmeta" "--extern" "num_cpus=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/num_cpus/b4ce966fb23a1873/out/libnum_cpus-b4ce966fb23a1873.rlib" "--extern" "num_cpus=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/num_cpus/b4ce966fb23a1873/out/libnum_cpus-b4ce966fb23a1873.rmeta" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/futures/12a46a586129fabc/out/libfutures-12a46a586129fabc.rlib" "--extern" "futures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/futures/12a46a586129fabc/out/libfutures-12a46a586129fabc.rmeta" "--extern" "page_size=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/page_size/ec8ed52e216fedd8/out/libpage_size-ec8ed52e216fedd8.rlib" "--extern" "page_size=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/page_size/ec8ed52e216fedd8/out/libpage_size-ec8ed52e216fedd8.rmeta" "--extern" "tempfile=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/tempfile/df7c05f8194316b8/out/libtempfile-df7c05f8194316b8.rlib" "--extern" "tempfile=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/tempfile/df7c05f8194316b8/out/libtempfile-df7c05f8194316b8.rmeta" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/tokio/f23c2df11ff1b95c/out/libtokio-f23c2df11ff1b95c.rlib" "--extern" "tokio=/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/tokio/f23c2df11ff1b95c/out/libtokio-f23c2df11ff1b95c.rmeta" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/once_cell/3cc3bc0f92efc1ef/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/fastrand/c2dee04fae7824af/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/debug/build/futures-macro/9c6f0f0f72ff240f/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/futures-util/6422d1a058ad7370/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/cfg-if/d4788d69620d7a5d/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/linux-raw-sys/9fd60631c6d00432/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/rustix/b443985bb12a5620/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/futures-channel/695e5ea01cc1f606/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/libc/e87a1168fda13455/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/mio/07ea00d0e3a338cd/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/tempfile/df7c05f8194316b8/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/futures-core/637dd59605319072/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/errno/a4c9af9926c027e8/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/futures-sink/4d6ecd7ae75c5192/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/num_cpus/b4ce966fb23a1873/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/debug/build/tokio-macros/88ec6456fe4872d8/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/futures-io/c91c825c50fe8d63/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/futures-task/4a6800607bd79ab2/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/getrandom/ad538e6b8fd1adac/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/getrandom/d9d403492c76a53a/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/signal-hook-registry/4f69e97e24b607ca/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/getrandom/b99eff8e14285543/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/bitflags/f42cfbcbdac32ac2/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/futures/12a46a586129fabc/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/cross-crate-items/1c83654c74fd1f60/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/socket2/804f701c6950523e/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/slab/c0164867961151ea/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/page_size/ec8ed52e216fedd8/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/bytes/ca855d76c3bafedf/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/pin-project-lite/3f49d2c697253f6c/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/tokio/f23c2df11ff1b95c/out" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/debug/build/getrandom/d9dca7ad9ba2664e/out" "--edition" "2021"

error: test got exit status: 101, but expected 0
 = note: the compiler panicked

full stderr:
---

Location:
   /cargo/registry/src/index.crates.io-1949cf8c6b5b557f/ui_test-0.30.7/src/lib.rs:365

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
error: test failed, to rerun pass `--test ui`

Caused by:
  process didn't exit successfully: `/checkout/obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/build/miri/54d3518e03e017c2/out/ui-54d3518e03e017c2 tests/pass tests/panic` (exit status: 1)
Command `/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo test --target x86_64-unknown-linux-gnu -Zbinary-dep-depinfo -j 4 -Zroot-dir=/checkout -Zembed-metadata=no --locked --color=always --profile=release --manifest-path /checkout/src/tools/miri/Cargo.toml -- tests/pass tests/panic [workdir=/checkout]` failed with exit code 1
Created at: src/bootstrap/src/core/build_steps/tool.rs:208:21
Executed at: src/bootstrap/src/core/build_steps/test.rs:790:19

Command has failed. Rerun with -v to see more details.
Bootstrap failed while executing `test --stage 2 miri -- tests/pass tests/panic`
Currently active steps:
test::Miri { target: x86_64-unknown-linux-gnu } at src/bootstrap/src/core/build_steps/test.rs:716
Build completed unsuccessfully in 0:00:49
  local time: Thu Sep 24 02:01:18 UTC 2026

@khyperia

Copy link
Copy Markdown
Member

gosh this was a pleasant PR to review, kept on going "but what about..." and then there was a comment or test diff that answered my question~ ❤️

@bors r+ rollup

@rust-bors

rust-bors Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 3ea2995 has been approved by khyperia

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 24, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 24, 2026
…suggestion-parens, r=khyperia

Fix incorrect use of await in parser suggestion

The old suggestion of:
```diff
LL -     let _ = await!(bar())?;
LL +     let _ = bar().await)?;
```
is wrong because of the lefted `)` was unremoved, and also here we need to take care of expr precedence.
rust-bors Bot pushed a commit that referenced this pull request Sep 24, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #163218 (stdarch subtree update)
 - #159287 (Build a new incr comp session dir from scratch every time)
 - #163222 (Enable EII tests for cg_gcc)
 - #163251 (cg_gcc subtree sync 2026-09-24)
 - #162595 (avoid accessing uninferred closure upvars in diagnostics)
 - #162937 (do generic_const_args Const::Ty hack only on projection consts)
 - #163238 (Fix incorrect use of await in parser suggestion)
@rust-bors
rust-bors Bot merged commit 8b09cf2 into rust-lang:main Sep 24, 2026
17 of 26 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Sep 24, 2026
rust-bors Bot pushed a commit that referenced this pull request Sep 24, 2026
Rollup merge of #163238 - chenyukang:yukang-fix-await-macro-suggestion-parens, r=khyperia

Fix incorrect use of await in parser suggestion

The old suggestion of:
```diff
LL -     let _ = await!(bar())?;
LL +     let _ = bar().await)?;
```
is wrong because of the lefted `)` was unremoved, and also here we need to take care of expr precedence.
pull Bot pushed a commit to xtqqczze/rust-lang-miri that referenced this pull request Sep 25, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#163218 (stdarch subtree update)
 - rust-lang/rust#159287 (Build a new incr comp session dir from scratch every time)
 - rust-lang/rust#163222 (Enable EII tests for cg_gcc)
 - rust-lang/rust#163251 (cg_gcc subtree sync 2026-09-24)
 - rust-lang/rust#162595 (avoid accessing uninferred closure upvars in diagnostics)
 - rust-lang/rust#162937 (do generic_const_args Const::Ty hack only on projection consts)
 - rust-lang/rust#163238 (Fix incorrect use of await in parser suggestion)
bjorn3 pushed a commit to rust-lang/rustc_codegen_cranelift that referenced this pull request Sep 28, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#163218 (stdarch subtree update)
 - rust-lang/rust#159287 (Build a new incr comp session dir from scratch every time)
 - rust-lang/rust#163222 (Enable EII tests for cg_gcc)
 - rust-lang/rust#163251 (cg_gcc subtree sync 2026-09-24)
 - rust-lang/rust#162595 (avoid accessing uninferred closure upvars in diagnostics)
 - rust-lang/rust#162937 (do generic_const_args Const::Ty hack only on projection consts)
 - rust-lang/rust#163238 (Fix incorrect use of await in parser suggestion)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants