Skip to content
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

Fix points at nonexisting .await #113263

Closed

Conversation

Alef-gabriel
Copy link

fixes: #113203

@rustbot
Copy link
Collaborator

rustbot commented Jul 2, 2023

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @WaffleLapkin (or someone else) soon.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@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 Jul 2, 2023
Copy link
Member

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a test committed for it, placed somewhere in tests/ui/parser probably, or maybe tests/ui/async-await.

Also, I'm not sure that this is the right fix? Why did you need to remove the maybe_recover_from_bad_qpath here? I think the only thing you need to fix is the span you pass in (lo.to(sp)).

Nevermind, seems like the right fix is to just return an expression with the ExprKind::Err kind always, not just on try expressions.

@compiler-errors
Copy link
Member

Marking this as waiting on author, see the comment from rustbot above to switch it back to the "waiting on review" state.

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 3, 2023
@compiler-errors
Copy link
Member

@Alef-gabriel: This PR is missing a fix, did you drop a commit by accident?

Keep in mind that the original issue requires debug assertions to be enabled.

@Alef-gabriel
Copy link
Author

Alef-gabriel commented Jul 11, 2023

@compiler-errors: sorry, I don't checked my commits,I misplaced the commit with this modification, but I redid it.

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-14 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
##[group]Run git config --global core.autocrlf false
git config --global core.autocrlf false
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 155887621e4aa47f096ca75167349835e509454d
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
---
  lfs: false
  submodules: false
  set-safe-directory: true
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 155887621e4aa47f096ca75167349835e509454d
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
---
##[group]Run src/ci/scripts/setup-environment.sh
src/ci/scripts/setup-environment.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 155887621e4aa47f096ca75167349835e509454d
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
---
##[group]Run src/ci/scripts/should-skip-this.sh
src/ci/scripts/should-skip-this.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 155887621e4aa47f096ca75167349835e509454d
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
---
##[group]Run src/ci/scripts/verify-channel.sh
src/ci/scripts/verify-channel.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 155887621e4aa47f096ca75167349835e509454d
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  CACHE_DOMAIN: ci-caches.rust-lang.org
  IMAGE: x86_64-gnu-llvm-14
##[endgroup]
##[group]Run src/ci/scripts/collect-cpu-stats.sh
src/ci/scripts/collect-cpu-stats.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 155887621e4aa47f096ca75167349835e509454d
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
---
##[group]Run src/ci/scripts/install-sccache.sh
src/ci/scripts/install-sccache.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 155887621e4aa47f096ca75167349835e509454d
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  CACHE_DOMAIN: ci-caches.rust-lang.org
  IMAGE: x86_64-gnu-llvm-14
##[endgroup]
##[group]Run src/ci/scripts/select-xcode.sh
src/ci/scripts/select-xcode.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 155887621e4aa47f096ca75167349835e509454d
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  CACHE_DOMAIN: ci-caches.rust-lang.org
  IMAGE: x86_64-gnu-llvm-14
##[endgroup]
##[group]Run src/ci/scripts/install-clang.sh
src/ci/scripts/install-clang.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 155887621e4aa47f096ca75167349835e509454d
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  CACHE_DOMAIN: ci-caches.rust-lang.org
  IMAGE: x86_64-gnu-llvm-14
##[endgroup]
##[group]Run src/ci/scripts/install-wix.sh
src/ci/scripts/install-wix.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 155887621e4aa47f096ca75167349835e509454d
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  CACHE_DOMAIN: ci-caches.rust-lang.org
  IMAGE: x86_64-gnu-llvm-14
##[endgroup]
##[group]Run src/ci/scripts/disable-git-crlf-conversion.sh
src/ci/scripts/disable-git-crlf-conversion.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 155887621e4aa47f096ca75167349835e509454d
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
---
##[group]Run src/ci/scripts/install-msys2.sh
src/ci/scripts/install-msys2.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 155887621e4aa47f096ca75167349835e509454d
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  CACHE_DOMAIN: ci-caches.rust-lang.org
  IMAGE: x86_64-gnu-llvm-14
##[endgroup]
##[group]Run src/ci/scripts/install-mingw.sh
src/ci/scripts/install-mingw.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 155887621e4aa47f096ca75167349835e509454d
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  CACHE_DOMAIN: ci-caches.rust-lang.org
  IMAGE: x86_64-gnu-llvm-14
##[endgroup]
##[group]Run src/ci/scripts/install-ninja.sh
src/ci/scripts/install-ninja.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 155887621e4aa47f096ca75167349835e509454d
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  CACHE_DOMAIN: ci-caches.rust-lang.org
  IMAGE: x86_64-gnu-llvm-14
##[endgroup]
##[group]Run src/ci/scripts/enable-docker-ipv6.sh
src/ci/scripts/enable-docker-ipv6.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 155887621e4aa47f096ca75167349835e509454d
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
---
##[group]Run src/ci/scripts/disable-git-crlf-conversion.sh
src/ci/scripts/disable-git-crlf-conversion.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 155887621e4aa47f096ca75167349835e509454d
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  CACHE_DOMAIN: ci-caches.rust-lang.org
  IMAGE: x86_64-gnu-llvm-14
##[endgroup]
##[group]Run src/ci/scripts/verify-line-endings.sh
src/ci/scripts/verify-line-endings.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 155887621e4aa47f096ca75167349835e509454d
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
  CACHE_DOMAIN: ci-caches.rust-lang.org
  IMAGE: x86_64-gnu-llvm-14
##[endgroup]
##[group]Run src/ci/scripts/verify-backported-commits.sh
src/ci/scripts/verify-backported-commits.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 155887621e4aa47f096ca75167349835e509454d
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
---
##[group]Run src/ci/scripts/verify-stable-version-number.sh
src/ci/scripts/verify-stable-version-number.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 155887621e4aa47f096ca75167349835e509454d
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
---
##[group]Run src/ci/scripts/run-build-from-ci.sh
src/ci/scripts/run-build-from-ci.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
  PR_CI_JOB: 1
  CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
  HEAD_SHA: 155887621e4aa47f096ca75167349835e509454d
  SCCACHE_BUCKET: rust-lang-ci-sccache2
  TOOLSTATE_REPO: https://github.com/rust-lang-nursery/rust-toolstate
---
diff of stderr:

138    | ^ unexpected token
139 
140 error[E0728]: `await` is only allowed inside `async` functions and blocks
-   --> $DIR/incorrect-syntax-suggestions.rs:52:13
- LL | fn foo9() -> Result<(), ()> {
-    |    ---- this is not `async`
- LL |     let _ = await bar();
- LL |     let _ = await bar();
-    |             ^^^^^ only allowed inside `async` functions and blocks
- 
- error[E0728]: `await` is only allowed inside `async` functions and blocks
-   --> $DIR/incorrect-syntax-suggestions.rs:57:13
- LL | fn foo10() -> Result<(), ()> {
-    |    ----- this is not `async`
-    |    ----- this is not `async`
- LL |     let _ = await? bar();
-    |             ^^^^^ only allowed inside `async` functions and blocks
- 
- error[E0728]: `await` is only allowed inside `async` functions and blocks
-   --> $DIR/incorrect-syntax-suggestions.rs:66:14
- LL | fn foo12() -> Result<(), ()> {
-    |    ----- this is not `async`
-    |    ----- this is not `async`
- LL |     let _ = (await bar())?;
-    |              ^^^^^ only allowed inside `async` functions and blocks
- 
- error[E0728]: `await` is only allowed inside `async` functions and blocks
166    |
167 LL | fn foo13() -> Result<(), ()> {


209 LL |         let _ = bar().await?;
210    |                       ^^^^^ only allowed inside `async` functions and blocks
211 
- error[E0728]: `await` is only allowed inside `async` functions and blocks
-   --> $DIR/incorrect-syntax-suggestions.rs:113:17
- LL |     fn foo() -> Result<(), ()> {
-    |        --- this is not `async`
-    |        --- this is not `async`
- LL |         let _ = await!(bar())?;
-    |                 ^^^^^ only allowed inside `async` functions and blocks
- 
- error[E0728]: `await` is only allowed inside `async` functions and blocks
-   --> $DIR/incorrect-syntax-suggestions.rs:121:17
- LL |     let foo = || {
-    |               -- this is not `async`
-    |               -- this is not `async`
- LL |         let _ = await!(bar())?;
-    |                 ^^^^^ only allowed inside `async` functions and blocks
- error: aborting due to 33 previous errors
+ error: aborting due to 28 previous errors
229 
230 For more information about this error, try `rustc --explain E0728`.
---
To only update this specific test, also pass `--test-args async-await/await-keyword/incorrect-syntax-suggestions.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/async-await/await-keyword/incorrect-syntax-suggestions.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "--sysroot" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "--remap-path-prefix=/checkout/tests/ui=fake-test-src-base" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/async-await/await-keyword/incorrect-syntax-suggestions" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/async-await/await-keyword/incorrect-syntax-suggestions/auxiliary" "--edition=2018"
stdout: none
error: incorrect use of `await`
##[error]  --> fake-test-src-base/async-await/await-keyword/incorrect-syntax-suggestions.rs:8:13
   |
   |
LL |     let _ = await bar(); //~ ERROR incorrect use of `await`
   |             ^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
error: incorrect use of `await`
##[error]  --> fake-test-src-base/async-await/await-keyword/incorrect-syntax-suggestions.rs:12:13
   |
   |
LL |     let _ = await? bar(); //~ ERROR incorrect use of `await`
   |             ^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await?`
error: incorrect use of `await`
##[error]  --> fake-test-src-base/async-await/await-keyword/incorrect-syntax-suggestions.rs:16:13
   |
   |
LL |     let _ = await bar()?; //~ ERROR incorrect use of `await`
   |             ^^^^^^^^^^^^ help: `await` is a postfix operation: `bar()?.await`
error: incorrect use of `await`
##[error]  --> fake-test-src-base/async-await/await-keyword/incorrect-syntax-suggestions.rs:20:13
   |
   |
LL |     let _ = await { bar() }; //~ ERROR incorrect use of `await`
   |             ^^^^^^^^^^^^^^^ help: `await` is a postfix operation: `{ bar() }.await`
error: incorrect use of `await`
##[error]  --> fake-test-src-base/async-await/await-keyword/incorrect-syntax-suggestions.rs:24:13
   |
   |
LL |     let _ = await(bar()); //~ ERROR incorrect use of `await`
   |             ^^^^^^^^^^^^ help: `await` is a postfix operation: `(bar()).await`
error: incorrect use of `await`
##[error]  --> fake-test-src-base/async-await/await-keyword/incorrect-syntax-suggestions.rs:28:13
   |
   |
LL |     let _ = await { bar() }?; //~ ERROR incorrect use of `await`
   |             ^^^^^^^^^^^^^^^ help: `await` is a postfix operation: `{ bar() }.await`
error: incorrect use of `await`
##[error]  --> fake-test-src-base/async-await/await-keyword/incorrect-syntax-suggestions.rs:32:14
Build completed unsuccessfully in 0:11:01
   |
   |
LL |     let _ = (await bar())?; //~ ERROR incorrect use of `await`
   |              ^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
error: incorrect use of `await`
##[error]  --> fake-test-src-base/async-await/await-keyword/incorrect-syntax-suggestions.rs:36:24
   |
   |
LL |     let _ = bar().await(); //~ ERROR incorrect use of `await`
   |                        ^^ help: `await` is not a method call, remove the parentheses
error: incorrect use of `await`
##[error]  --> fake-test-src-base/async-await/await-keyword/incorrect-syntax-suggestions.rs:40:24
   |
   |
LL |     let _ = bar().await()?; //~ ERROR incorrect use of `await`
   |                        ^^ help: `await` is not a method call, remove the parentheses
error: incorrect use of `await`
##[error]  --> fake-test-src-base/async-await/await-keyword/incorrect-syntax-suggestions.rs:52:13
   |
   |
LL |     let _ = await bar(); //~ ERROR `await` is only allowed inside `async` functions and blocks
   |             ^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
error: incorrect use of `await`
##[error]  --> fake-test-src-base/async-await/await-keyword/incorrect-syntax-suggestions.rs:57:13
   |
   |
LL |     let _ = await? bar(); //~ ERROR `await` is only allowed inside `async` functions and blocks
   |             ^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await?`
error: incorrect use of `await`
##[error]  --> fake-test-src-base/async-await/await-keyword/incorrect-syntax-suggestions.rs:62:13
   |
   |
LL |     let _ = await bar()?; //~ ERROR incorrect use of `await`
   |             ^^^^^^^^^^^^ help: `await` is a postfix operation: `bar()?.await`
error: incorrect use of `await`
##[error]  --> fake-test-src-base/async-await/await-keyword/incorrect-syntax-suggestions.rs:66:14
   |
   |
LL |     let _ = (await bar())?; //~ ERROR `await` is only allowed inside `async` functions and blocks
   |              ^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
error: incorrect use of `await`
##[error]  --> fake-test-src-base/async-await/await-keyword/incorrect-syntax-suggestions.rs:71:24
   |
   |
LL |     let _ = bar().await(); //~ ERROR `await` is only allowed inside `async` functions and blocks
   |                        ^^ help: `await` is not a method call, remove the parentheses
error: incorrect use of `await`
##[error]  --> fake-test-src-base/async-await/await-keyword/incorrect-syntax-suggestions.rs:76:24
   |
   |
LL |     let _ = bar().await()?; //~ ERROR `await` is only allowed inside `async` functions and blocks
   |                        ^^ help: `await` is not a method call, remove the parentheses
error: incorrect use of `await`
##[error]  --> fake-test-src-base/async-await/await-keyword/incorrect-syntax-suggestions.rs:104:13
   |
   |
LL |     let _ = await!(bar()); //~ ERROR incorrect use of `await`
   |             ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
error: incorrect use of `await`
##[error]  --> fake-test-src-base/async-await/await-keyword/incorrect-syntax-suggestions.rs:108:13
   |
   |
LL |     let _ = await!(bar())?; //~ ERROR incorrect use of `await`
   |             ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
error: incorrect use of `await`
##[error]  --> fake-test-src-base/async-await/await-keyword/incorrect-syntax-suggestions.rs:113:17
   |
   |
LL |         let _ = await!(bar())?; //~ ERROR incorrect use of `await`
   |                 ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
error: incorrect use of `await`
##[error]  --> fake-test-src-base/async-await/await-keyword/incorrect-syntax-suggestions.rs:121:17
   |
   |
LL |         let _ = await!(bar())?; //~ ERROR incorrect use of `await`
   |                 ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
error: expected expression, found `=>`
##[error]  --> fake-test-src-base/async-await/await-keyword/incorrect-syntax-suggestions.rs:129:25
   |
   |
LL |     match await { await => () }
   |                   ----- ^^ expected expression
   |                   while parsing this incorrect await expression

error: incorrect use of `await`
##[error]  --> fake-test-src-base/async-await/await-keyword/incorrect-syntax-suggestions.rs:129:11
##[error]  --> fake-test-src-base/async-await/await-keyword/incorrect-syntax-suggestions.rs:129:11
   |
LL |     match await { await => () }
   |           ^^^^^^^^^^^^^^^^^^^^^ help: `await` is a postfix operation: `{ await => () }.await`

error: expected one of `.`, `?`, `{`, or an operator, found `}`
##[error]  --> fake-test-src-base/async-await/await-keyword/incorrect-syntax-suggestions.rs:132:1
   |
LL |     match await { await => () }
   |     -----                      - expected one of `.`, `?`, `{`, or an operator
   |     while parsing this `match` expression
...
...
LL | } //~ ERROR expected one of `.`, `?`, `{`, or an operator, found `}`


error[E0728]: `await` is only allowed inside `async` functions and blocks
##[error]  --> fake-test-src-base/async-await/await-keyword/incorrect-syntax-suggestions.rs:71:19
LL | fn foo13() -> Result<(), ()> {
   |    ----- this is not `async`
   |    ----- this is not `async`
LL |     let _ = bar().await(); //~ ERROR `await` is only allowed inside `async` functions and blocks
   |                   ^^^^^ only allowed inside `async` functions and blocks

error[E0728]: `await` is only allowed inside `async` functions and blocks
##[error]  --> fake-test-src-base/async-await/await-keyword/incorrect-syntax-suggestions.rs:76:19
LL | fn foo14() -> Result<(), ()> {
   |    ----- this is not `async`
   |    ----- this is not `async`
LL |     let _ = bar().await()?; //~ ERROR `await` is only allowed inside `async` functions and blocks
   |                   ^^^^^ only allowed inside `async` functions and blocks

error[E0728]: `await` is only allowed inside `async` functions and blocks
##[error]  --> fake-test-src-base/async-await/await-keyword/incorrect-syntax-suggestions.rs:81:19
LL | fn foo15() -> Result<(), ()> {
   |    ----- this is not `async`
   |    ----- this is not `async`
LL |     let _ = bar().await; //~ ERROR `await` is only allowed inside `async` functions and blocks
   |                   ^^^^^ only allowed inside `async` functions and blocks

error[E0728]: `await` is only allowed inside `async` functions and blocks
##[error]  --> fake-test-src-base/async-await/await-keyword/incorrect-syntax-suggestions.rs:85:19
LL | fn foo16() -> Result<(), ()> {
   |    ----- this is not `async`
   |    ----- this is not `async`
LL |     let _ = bar().await?; //~ ERROR `await` is only allowed inside `async` functions and blocks
   |                   ^^^^^ only allowed inside `async` functions and blocks

error[E0728]: `await` is only allowed inside `async` functions and blocks
##[error]  --> fake-test-src-base/async-await/await-keyword/incorrect-syntax-suggestions.rs:90:23
LL |     fn foo() -> Result<(), ()> {
   |        --- this is not `async`
   |        --- this is not `async`
LL |         let _ = bar().await?; //~ ERROR `await` is only allowed inside `async` functions and blocks
   |                       ^^^^^ only allowed inside `async` functions and blocks

error[E0728]: `await` is only allowed inside `async` functions and blocks
##[error]  --> fake-test-src-base/async-await/await-keyword/incorrect-syntax-suggestions.rs:97:23
LL |     let foo = || {
   |               -- this is not `async`
   |               -- this is not `async`
LL |         let _ = bar().await?; //~ ERROR `await` is only allowed inside `async` functions and blocks
   |                       ^^^^^ only allowed inside `async` functions and blocks
error: aborting due to 28 previous errors

For more information about this error, try `rustc --explain E0728`.
------------------------------------------

@bors
Copy link
Contributor

bors commented Aug 12, 2023

☔ The latest upstream changes (presumably #114756) made this pull request unmergeable. Please resolve the merge conflicts.

@Dylan-DPC
Copy link
Member

@Alef-gabriel any updates on this? if you can resolve the conflicts we can push this forward for a review

@Dylan-DPC
Copy link
Member

Dylan-DPC commented Feb 11, 2024

Closing this as inactive. Feel free to reöpen this pr or create a new pr if you get the time to work on this. Thanks

(The issue also seems to be resolved)

@Dylan-DPC Dylan-DPC closed this Feb 11, 2024
@Dylan-DPC Dylan-DPC added S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. labels Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

ice: E0277 points at nonexisting .await
7 participants