[EXPERIMENT] Replace ResumeTy with an unsafe binder ty. by cjgillot · Pull Request #146562 · rust-lang/rust (original) (raw)
diff of stderr:
5 | -- the expected `async` closure body
6 LL |
7 LL | let () = x();
- | ^^ --- this expression has type `{static main::{closure#0}::{closure#0}<?15t> upvar_tys=?14t resume_ty=unsafe<Region(BrNamed(DefId(2:15634 ~ core[1112]::future::ResumeTy::'a))), Region(BrNamed(DefId(2:15635 ~ core[1112]::future::ResumeTy::'b)))> &'^0.Named(DefId(2:15634 ~ core[1112]::future::ResumeTy::'a)) mut Context<'^1.Named(DefId(2:15635 ~ core[1112]::future::ResumeTy::'b))> yield_ty=() return_ty=()}`
+ | ^^ --- this expression has type `{static main::{closure#0}::{closure#0}<?15t> upvar_tys=?14t resume_ty=unsafe<Region(BrNamed(DefId(2:15675 ~ core[7629]::future::ResumeTy::'a))), Region(BrNamed(DefId(2:15676 ~ core[7629]::future::ResumeTy::'b)))> &'^0.Named(DefId(2:15675 ~ core[7629]::future::ResumeTy::'a)) mut Context<'^1.Named(DefId(2:15676 ~ core[7629]::future::ResumeTy::'b))> yield_ty=() return_ty=()}`
9 | |
10 | expected `async` closure body, found `()`
11 |
- = note: expected `async` closure body `{static main::{closure#0}::{closure#0}<?15t> upvar_tys=?14t resume_ty=unsafe<Region(BrNamed(DefId(2:15634 ~ core[1112]::future::ResumeTy::'a))), Region(BrNamed(DefId(2:15635 ~ core[1112]::future::ResumeTy::'b)))> &'^0.Named(DefId(2:15634 ~ core[1112]::future::ResumeTy::'a)) mut Context<'^1.Named(DefId(2:15635 ~ core[1112]::future::ResumeTy::'b))> yield_ty=() return_ty=()}`
+ = note: expected `async` closure body `{static main::{closure#0}::{closure#0}<?15t> upvar_tys=?14t resume_ty=unsafe<Region(BrNamed(DefId(2:15675 ~ core[7629]::future::ResumeTy::'a))), Region(BrNamed(DefId(2:15676 ~ core[7629]::future::ResumeTy::'b)))> &'^0.Named(DefId(2:15675 ~ core[7629]::future::ResumeTy::'a)) mut Context<'^1.Named(DefId(2:15676 ~ core[7629]::future::ResumeTy::'b))> yield_ty=() return_ty=()}`
13 found unit type `()`
14
15 error: aborting due to 1 previous error
The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args async-await/async-closures/def-path.rs`
error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/async-await/async-closures/def-path.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/async-await/async-closures/def-path" "-A" "unused" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2021" "-Zverbose-internals"
stdout: none
--- stderr -------------------------------
error[E0308]: mismatched types
##[error] --> /checkout/tests/ui/async-await/async-closures/def-path.rs:7:9
|
LL | let x = async || {};
| -- the expected `async` closure body
LL | //~^ NOTE the expected `async` closure body
LL | let () = x();
| ^^ --- this expression has type `{static main::{closure#0}::{closure#0}<?15t> upvar_tys=?14t resume_ty=unsafe<Region(BrNamed(DefId(2:15675 ~ core[7629]::future::ResumeTy::'a))), Region(BrNamed(DefId(2:15676 ~ core[7629]::future::ResumeTy::'b)))> &'^0.Named(DefId(2:15675 ~ core[7629]::future::ResumeTy::'a)) mut Context<'^1.Named(DefId(2:15676 ~ core[7629]::future::ResumeTy::'b))> yield_ty=() return_ty=()}`
| |
| expected `async` closure body, found `()`
|
= note: expected `async` closure body `{static main::{closure#0}::{closure#0}<?15t> upvar_tys=?14t resume_ty=unsafe<Region(BrNamed(DefId(2:15675 ~ core[7629]::future::ResumeTy::'a))), Region(BrNamed(DefId(2:15676 ~ core[7629]::future::ResumeTy::'b)))> &'^0.Named(DefId(2:15675 ~ core[7629]::future::ResumeTy::'a)) mut Context<'^1.Named(DefId(2:15676 ~ core[7629]::future::ResumeTy::'b))> yield_ty=() return_ty=()}`
found unit type `()`
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0308`.