Add provider-style API to Context by jkarneges · Pull Request #135051 · rust-lang/rust (original) (raw)

#21 exporting to docker image format
#21 sending tarball 26.1s done
#21 DONE 39.8s
##[endgroup]
Setting extra environment values for docker:  --env ENABLE_GCC_CODEGEN=1 --env GCC_EXEC_PREFIX=/usr/lib/gcc/
[CI_JOB_NAME=x86_64-gnu-llvm-18]
debug: `DISABLE_CI_RUSTC_IF_INCOMPATIBLE` configured.
---
sccache: Starting the server...
##[group]Configure the build
configure: processing command line
configure: 
configure: build.configure-args := ['--build=x86_64-unknown-linux-gnu', '--llvm-root=/usr/lib/llvm-18', '--enable-llvm-link-shared', '--set', 'rust.randomize-layout=true', '--set', 'rust.thin-lto-import-instr-limit=10', '--enable-verbose-configure', '--enable-sccache', '--disable-manage-submodules', '--enable-locked-deps', '--enable-cargo-native-static', '--set', 'rust.codegen-units-std=1', '--set', 'dist.compression-profile=balanced', '--dist-compression-formats=xz', '--set', 'rust.lld=false', '--disable-dist-src', '--release-channel=nightly', '--enable-debug-assertions', '--enable-overflow-checks', '--enable-llvm-assertions', '--set', 'rust.verify-llvm-ir', '--set', 'rust.codegen-backends=llvm,cranelift,gcc', '--set', 'llvm.static-libstdcpp', '--enable-new-symbol-mangling']
configure: target.x86_64-unknown-linux-gnu.llvm-config := /usr/lib/llvm-18/bin/llvm-config
configure: llvm.link-shared     := True
configure: rust.randomize-layout := True
configure: rust.thin-lto-import-instr-limit := 10
---
diff of stderr:

14    | |______^ `&mut Context<'_>` may not be safely transferred across an unwind boundary
15    |
16    = help: within `{async block@$DIR/async-is-unwindsafe.rs:12:19: 12:24}`, the trait `UnwindSafe` is not implemented for `&mut Context<'_>`
-    = note: `UnwindSafe` is implemented for `&Context<'_>`, but not for `&mut Context<'_>`
18 note: future does not implement `UnwindSafe` as this value is used across an await
20    |

29 LL | fn is_unwindsafe(_: impl std::panic::UnwindSafe) {}
30    |                          ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_unwindsafe`
30    |                          ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_unwindsafe`
31 
- error: aborting due to 1 previous error
+ error[E0277]: the type `&mut (dyn Provider + 'static)` may not be safely transferred across an unwind boundary
+   --> $DIR/async-is-unwindsafe.rs:12:5
+    |
+ LL |       is_unwindsafe(async {
+    |       ^             ----- within this `{async block@$DIR/async-is-unwindsafe.rs:12:19: 12:24}`
+    | |
+ LL | |
+ LL | |         use std::ptr::null;
+ LL | |         use std::ptr::null;
+ LL | |         use std::task::{Context, RawWaker, RawWakerVTable, Waker};
+ ...  |
+ LL | |         drop(cx_ref);
+ LL | |     });
+    | |______^ `&mut (dyn Provider + 'static)` may not be safely transferred across an unwind boundary
+    |
+    = help: within `{async block@$DIR/async-is-unwindsafe.rs:12:19: 12:24}`, the trait `UnwindSafe` is not implemented for `&mut (dyn Provider + 'static)`
+ note: future does not implement `UnwindSafe` as this value is used across an await
+    |
+    |
+ LL |         let mut cx = Context::from_waker(&waker);
+    |             ------ has type `Context<'_>` which does not implement `UnwindSafe`
+ ...
+ LL |         async {}.await; // this needs an inner await point
+    |                  ^^^^^ await occurs here, with `mut cx` maybe used later
+ note: required by a bound in `is_unwindsafe`
+    |
+    |
+ LL | fn is_unwindsafe(_: impl std::panic::UnwindSafe) {}
+    |                          ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_unwindsafe`
+ error: aborting due to 2 previous errors
33 
34 For more information about this error, try `rustc --explain E0277`.
35 
35 

Note: some mismatched output was normalized before being compared
-   --> /checkout/tests/ui/async-await/async-is-unwindsafe.rs:12:5
-    |       ^             ----- within this `{async block@/checkout/tests/ui/async-await/async-is-unwindsafe.rs:12:19: 12:24}`
- LL | |         //~^ ERROR the type `&mut Context<'_>` may not be safely transferred across an unwind boundary
-    = help: within `{async block@/checkout/tests/ui/async-await/async-is-unwindsafe.rs:12:19: 12:24}`, the trait `UnwindSafe` is not implemented for `&mut (dyn Provider + 'static)`
-   --> /checkout/tests/ui/async-await/async-is-unwindsafe.rs:3:26
+ error[E0277]: the type `&mut (dyn Provider + 'static)` may not be safely transferred across an unwind boundary
+   --> $DIR/async-is-unwindsafe.rs:12:5
+    |
+    |
+ LL |       is_unwindsafe(async {
+    |       ^             ----- within this `{async block@$DIR/async-is-unwindsafe.rs:12:19: 12:24}`
+    | |
+ LL | |
+ LL | |         use std::ptr::null;
+ LL | |         use std::ptr::null;
+ LL | |         use std::task::{Context, RawWaker, RawWakerVTable, Waker};
+ ...  |
+ LL | |         drop(cx_ref);
+ LL | |     });
+    | |______^ `&mut (dyn Provider + 'static)` may not be safely transferred across an unwind boundary
+    |
+    = help: within `{async block@$DIR/async-is-unwindsafe.rs:12:19: 12:24}`, the trait `UnwindSafe` is not implemented for `&mut (dyn Provider + 'static)`
+ note: future does not implement `UnwindSafe` as this value is used across an await
+    |
+    |
+ LL |         let mut cx = Context::from_waker(&waker);
+    |             ------ has type `Context<'_>` which does not implement `UnwindSafe`
+ ...
+ LL |         async {}.await; // this needs an inner await point
+    |                  ^^^^^ await occurs here, with `mut cx` maybe used later
+ note: required by a bound in `is_unwindsafe`
+    |
+    |
+ LL | fn is_unwindsafe(_: impl std::panic::UnwindSafe) {}
+    |                          ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_unwindsafe`
+ error: aborting due to 2 previous errors


The actual stderr differed from the expected stderr.
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-is-unwindsafe.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/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/async-await/async-is-unwindsafe.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(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/x86_64-unknown-linux-gnu/test/ui/async-await/async-is-unwindsafe" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2018"
--- stderr -------------------------------
error[E0277]: the type `&mut Context<'_>` may not be safely transferred across an unwind boundary
##[error]  --> /checkout/tests/ui/async-await/async-is-unwindsafe.rs:12:5
   |
   |
LL |       is_unwindsafe(async {
   |       ^             ----- within this `{async block@/checkout/tests/ui/async-await/async-is-unwindsafe.rs:12:19: 12:24}`
   | |
LL | |         //~^ ERROR the type `&mut Context<'_>` may not be safely transferred across an unwind boundary
LL | |         use std::ptr::null;
LL | |         use std::ptr::null;
LL | |         use std::task::{Context, RawWaker, RawWakerVTable, Waker};
LL | |         drop(cx_ref);
LL | |     });
   | |______^ `&mut Context<'_>` may not be safely transferred across an unwind boundary
   |
   |
   = help: within `{async block@/checkout/tests/ui/async-await/async-is-unwindsafe.rs:12:19: 12:24}`, the trait `UnwindSafe` is not implemented for `&mut Context<'_>`
note: future does not implement `UnwindSafe` as this value is used across an await
   |
   |
LL |         let cx_ref = &mut cx;
   |             ------ has type `&mut Context<'_>` which does not implement `UnwindSafe`
LL |
LL |         async {}.await; // this needs an inner await point
   |                  ^^^^^ await occurs here, with `cx_ref` maybe used later
note: required by a bound in `is_unwindsafe`
   |
LL | fn is_unwindsafe(_: impl std::panic::UnwindSafe) {}
   |                          ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_unwindsafe`


error[E0277]: the type `&mut (dyn Provider + 'static)` may not be safely transferred across an unwind boundary
##[error]  --> /checkout/tests/ui/async-await/async-is-unwindsafe.rs:12:5
   |
LL |       is_unwindsafe(async {
   |       ^             ----- within this `{async block@/checkout/tests/ui/async-await/async-is-unwindsafe.rs:12:19: 12:24}`
   | |
LL | |         //~^ ERROR the type `&mut Context<'_>` may not be safely transferred across an unwind boundary
LL | |         use std::ptr::null;
LL | |         use std::ptr::null;
LL | |         use std::task::{Context, RawWaker, RawWakerVTable, Waker};
LL | |         drop(cx_ref);
LL | |     });
LL | |     });
   | |______^ `&mut (dyn Provider + 'static)` may not be safely transferred across an unwind boundary
   |
   = help: within `{async block@/checkout/tests/ui/async-await/async-is-unwindsafe.rs:12:19: 12:24}`, the trait `UnwindSafe` is not implemented for `&mut (dyn Provider + 'static)`
note: future does not implement `UnwindSafe` as this value is used across an await
   |
   |
LL |         let mut cx = Context::from_waker(&waker);
   |             ------ has type `Context<'_>` which does not implement `UnwindSafe`
...
LL |         async {}.await; // this needs an inner await point
   |                  ^^^^^ await occurs here, with `mut cx` maybe used later
note: required by a bound in `is_unwindsafe`
   |
LL | fn is_unwindsafe(_: impl std::panic::UnwindSafe) {}
   |                          ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_unwindsafe`

---
---- [ui] tests/ui/async-await/context-is-sorta-unwindsafe.rs stdout ----

error: test compilation failed although it shouldn't!
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/async-await/context-is-sorta-unwindsafe.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/x86_64-unknown-linux-gnu/stage2" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(FALSE)" "-O" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/async-await/context-is-sorta-unwindsafe/a" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers"
--- stderr -------------------------------
error[E0277]: the type `&mut (dyn Provider + 'static)` may not be safely transferred across an unwind boundary
##[error]  --> /checkout/tests/ui/async-await/context-is-sorta-unwindsafe.rs:12:19
   |
   |
LL |     unwind_safe::<Context<'_>>(); // test UnwindSafe
   |                   ^^^^^^^^^^^ `&mut (dyn Provider + 'static)` may not be safely transferred across an unwind boundary
   |
   = help: within `Context<'_>`, the trait `UnwindSafe` is not implemented for `&mut (dyn Provider + 'static)`
note: required because it appears within the type `Option<&mut (dyn Provider + 'static)>`
note: required because it appears within the type `Context<'_>`
  --> /rustc/FAKE_PREFIX/library/core/src/task/wake.rs:370:12
note: required by a bound in `unwind_safe`
  --> /checkout/tests/ui/async-await/context-is-sorta-unwindsafe.rs:9:19
  --> /checkout/tests/ui/async-await/context-is-sorta-unwindsafe.rs:9:19
   |
LL | fn unwind_safe<T: UnwindSafe>() {}


error[E0277]: the type `(dyn Provider + 'static)` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
   |
   |
LL |     unwind_safe::<&Context<'_>>(); // test RefUnwindSafe
   |                   ^^^^^^^^^^^^ `(dyn Provider + 'static)` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary
   |
   = help: within `Context<'_>`, the trait `RefUnwindSafe` is not implemented for `(dyn Provider + 'static)`
   = note: required because it appears within the type `&mut (dyn Provider + 'static)`
note: required because it appears within the type `Option<&mut (dyn Provider + 'static)>`
note: required because it appears within the type `Context<'_>`
  --> /rustc/FAKE_PREFIX/library/core/src/task/wake.rs:370:12
   = note: required for `&Context<'_>` to implement `UnwindSafe`
note: required by a bound in `unwind_safe`
note: required by a bound in `unwind_safe`
  --> /checkout/tests/ui/async-await/context-is-sorta-unwindsafe.rs:9:19
   |
LL | fn unwind_safe<T: UnwindSafe>() {}

error: aborting due to 2 previous errors

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