diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2021-12-18 10:26:40 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-18 10:26:40 +0100 |
| commit | efbefb673d693263d5105e80ee948bfea819d9ae (patch) | |
| tree | 08e2330fe6bc05c9fd66db8cfca1ae540d9a7827 /library/std/src/thread/tests.rs | |
| parent | e69acdaae479848753a816f6e9b7cab1aa650685 (diff) | |
| parent | b656384d8398ec03ce5c40056252f818d6c44761 (diff) | |
Rollup merge of #92030 - rukai:stdlib2021, r=m-ou-se
Update stdlib to the 2021 edition progress towards https://github.com/rust-lang/rust/issues/88638 I couldnt find a way to run the 2018 style panic tests against 2018 so I just deleted them, maybe theres a way to do it that I missed though?
Diffstat (limited to 'library/std/src/thread/tests.rs')
| -rw-r--r-- | library/std/src/thread/tests.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/library/std/src/thread/tests.rs b/library/std/src/thread/tests.rs index ca0d88135a5..4f2c81731a3 100644 --- a/library/std/src/thread/tests.rs +++ b/library/std/src/thread/tests.rs @@ -1,6 +1,7 @@ use super::Builder; use crate::any::Any; use crate::mem; +use crate::panic::panic_any; use crate::result; use crate::sync::{ mpsc::{channel, Sender}, @@ -183,7 +184,7 @@ fn test_simple_newsched_spawn() { } #[test] -fn test_try_panic_message_static_str() { +fn test_try_panic_message_string_literal() { match thread::spawn(move || { panic!("static string"); }) @@ -199,9 +200,9 @@ fn test_try_panic_message_static_str() { } #[test] -fn test_try_panic_message_owned_str() { +fn test_try_panic_any_message_owned_str() { match thread::spawn(move || { - panic!("owned string".to_string()); + panic_any("owned string".to_string()); }) .join() { @@ -215,9 +216,9 @@ fn test_try_panic_message_owned_str() { } #[test] -fn test_try_panic_message_any() { +fn test_try_panic_any_message_any() { match thread::spawn(move || { - panic!(box 413u16 as Box<dyn Any + Send>); + panic_any(box 413u16 as Box<dyn Any + Send>); }) .join() { @@ -233,10 +234,10 @@ fn test_try_panic_message_any() { } #[test] -fn test_try_panic_message_unit_struct() { +fn test_try_panic_any_message_unit_struct() { struct Juju; - match thread::spawn(move || panic!(Juju)).join() { + match thread::spawn(move || panic_any(Juju)).join() { Err(ref e) if e.is::<Juju>() => {} Err(_) | Ok(()) => panic!(), } |
