Change:
https://crater-
I'll need to re-check later but this seems to bisect to somehow.
The UI test changes from that PR appear to back this up, as confusing as it is.
I'm not sure what's going on in that crate, if it built successfully by mistake, or how that PR interacts with it, so let's cc the PR author and reviewer for validation.
After , no longer implements and , because the context now contains a which doesn't implement those traits. So this is an issue with the standard library and not the crate being built. Repro: label -T-compiler +T-libs +S-has-mcve
WG-prioritization assigning priority (). Noticing this on which says that was meant to be confined on nightly. Unsure about the fallout of this regression but for now marking as critical for tracking purposes. label -I-prioritize +P-critical
Revert up:
Isn't not unwind safe?
That line was by your PR, so while what you say is technically true, talking about what "already happened" when we are traveling back and forth through time via version control may be more confusing than helpful.
That line was already there. I the line below it though. Original PR:
Apologies, I guess I can't count numbers today? Hm, so, the full error of the regression is this: Note that it's trying to make a pointer implement . And for what it's worth, stable does indeed document is . Thus unfortunately that line you pointed to, as opposed to the one I thought you were referring to, is effectively just documenting that all are , and that will include regardless of whether it is is . And confusingly, , unlike .
I have opened as an alternative.

Discussion:
use crate::any::Any; use crate::fmt; use crate::marker::PhantomData; <ins> use crate::panic::AssertUnwindSafe; </ins> use crate::ptr; /// A `RawWaker` allows the implementor of a task executor to create a [`Waker`]

pub struct Context<'a> { waker: &'a Waker, local_waker: &'a LocalWaker, <del> ext: ExtData<'a>, </del> <ins> ext: AssertUnwindSafe<ExtData<'a>>, </ins> // Ensure we future-proof against variance changes by forcing // the lifetime to be invariant (argument-position lifetimes // are contravariant while return-position lifetimes are

#[unstable(feature = "context_ext", issue = "123392")] #[rustc_const_unstable(feature = "const_waker", issue = "102012")] pub const fn ext(&mut self) -> &mut dyn Any { <del> match &mut self.ext { </del> <ins> // FIXME: this field makes Context extra-weird about unwind safety // can we justify AssertUnwindSafe if we stabilize this? do we care? match &mut *self.ext { </ins> ExtData::Some(data) => *data, ExtData::None(unit) => unit, }

#[rustc_const_unstable(feature = "const_waker", issue = "102012")] #[unstable(feature = "context_ext", issue = "123392")] pub const fn from(cx: &'a mut Context<'_>) -> Self { <del> let ext = match &mut cx.ext { </del> <ins> let ext = match &mut *cx.ext { </ins> ExtData::Some(ext) => ExtData::Some(*ext), ExtData::None(()) => ExtData::None(()), };

#[rustc_const_unstable(feature = "const_waker", issue = "102012")] pub const fn build(self) -> Context<'a> { let ContextBuilder { waker, local_waker, ext, _marker, _marker2 } = self; <del> Context { waker, local_waker, ext, _marker, _marker2 } </del> <ins> Context { waker, local_waker, ext: AssertUnwindSafe(ext), _marker, _marker2 } </ins> } }

is_unwindsafe(async { //~^ ERROR the type `&mut Context<'_>` may not be safely transferred across an unwind boundary <del> //~| ERROR the type `&mut (dyn Any + 'static)` may not be safely transferred across an unwind boundary </del> use std::ptr::null; use std::task::{Context, RawWaker, RawWakerVTable, Waker}; let waker = unsafe {

|  |_____| | || LL | || <del> LL | || </del> LL | ||         use std::ptr::null; <ins> LL | ||         use std::task::{Context, RawWaker, RawWakerVTable, Waker}; </ins> ...  || LL | ||         drop(cx_ref); LL | ||     }); | ||_____-^ `&mut Context<'_>` may not be safely transferred across an unwind boundary |  |_____| <del> |        within this `{async block@$DIR/async-is-unwindsafe.rs:12:19: 30:6}` </del> <ins> |        within this `{async block@$DIR/async-is-unwindsafe.rs:12:19: 29:6}` </ins> | <del> = help: within `{async block@$DIR/async-is-unwindsafe.rs:12:19: 30:6}`, the trait `UnwindSafe` is not implemented for `&mut Context<'_>`, which is required by `{async block@$DIR/async-is-unwindsafe.rs:12:19: 30:6}: UnwindSafe` </del> <ins> = help: within `{async block@$DIR/async-is-unwindsafe.rs:12:19: 29:6}`, the trait `UnwindSafe` is not implemented for `&mut Context<'_>`, which is required by `{async block@$DIR/async-is-unwindsafe.rs:12:19: 29:6}: UnwindSafe` = note: `UnwindSafe` is implemented for `&Context<'_>`, but not for `&mut Context<'_>` </ins> note: future does not implement `UnwindSafe` as this value is used across an await <del> --> $DIR/async-is-unwindsafe.rs:26:18 </del> <ins> --> $DIR/async-is-unwindsafe.rs:25:18 </ins> | LL |         let cx_ref = &mut cx; |             ------ has type `&mut Context<'_>` which does not implement `UnwindSafe`

LL | fn is_unwindsafe(_: impl std::panic::UnwindSafe) {} |                          ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_unwindsafe` <del> error[E0277]: the type `&mut (dyn Any + 'static)` may not be safely transferred across an unwind boundary --> $DIR/async-is-unwindsafe.rs:12:5 | LL |        is_unwindsafe(async { |   _____^_____________- |  |_____| | || LL | || LL | || LL | ||         use std::ptr::null; ...  || LL | ||         drop(cx_ref); LL | ||     }); | ||_____-^ `&mut (dyn Any + 'static)` may not be safely transferred across an unwind boundary |  |_____| |        within this `{async block@$DIR/async-is-unwindsafe.rs:12:19: 30:6}` | = help: within `{async block@$DIR/async-is-unwindsafe.rs:12:19: 30:6}`, the trait `UnwindSafe` is not implemented for `&mut (dyn Any + 'static)`, which is required by `{async block@$DIR/async-is-unwindsafe.rs:12:19: 30:6}: UnwindSafe` note: future does not implement `UnwindSafe` as this value is used across an await --> $DIR/async-is-unwindsafe.rs:26:18 | 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` --> $DIR/async-is-unwindsafe.rs:3:26 | LL | fn is_unwindsafe(_: impl std::panic::UnwindSafe) {} |                          ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `is_unwindsafe` error: aborting due to 2 previous errors </del> <ins> error: aborting due to 1 previous error </ins> For more information about this error, try `rustc --explain E0277`.

<ins> //@ run-pass // Tests against a regression surfaced by crater in https://github.com/rust-lang/rust/issues/125193 // Unwind Safety is not a very coherent concept, but we'd prefer no regressions until we kibosh it // and this is an unstable feature anyways sooo... use std::panic::UnwindSafe; use std::task::Context; fn unwind_safe<T: UnwindSafe>() {} fn main() { unwind_safe::<Context<'_>>(); // test UnwindSafe unwind_safe::<&Context<'_>>(); // test RefUnwindSafe } </ins>