-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #125392 - workingjubilee:unwind-a-problem-in-context,…
… r=Amanieu Wrap Context.ext in AssertUnwindSafe Fixes #125193 Alternative to #125377 Relevant to #123392 I believe this approach is justifiable due to the fact that this function is unstable API and we have been considering trying to dispose of the notion of "unwind safety". Making a more long-term decision should be considered carefully as part of stabilizing `fn ext`, if ever. r? `@Amanieu`
- Loading branch information
Showing
4 changed files
with
27 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//@ 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 | ||
} |