diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2025-03-28 10:16:03 +0100 |
|---|---|---|
| committer | Mara Bos <m-ou.se@m-ou.se> | 2025-03-28 10:18:04 +0100 |
| commit | c41476034d49813d574af3877f6995e14b10729d (patch) | |
| tree | 1951d6eef24faba70485675cbecf26b9c4ce2282 | |
| parent | 3f690c2257b7080cd3a8cce64e082fc972148990 (diff) | |
| download | rust-c41476034d49813d574af3877f6995e14b10729d.tar.gz rust-c41476034d49813d574af3877f6995e14b10729d.zip | |
Put pin!() tests in the right file.
| -rw-r--r-- | library/coretests/tests/pin.rs | 14 | ||||
| -rw-r--r-- | library/coretests/tests/pin_macro.rs | 17 |
2 files changed, 17 insertions, 14 deletions
diff --git a/library/coretests/tests/pin.rs b/library/coretests/tests/pin.rs index a866cf12a3b..b3fb06e710d 100644 --- a/library/coretests/tests/pin.rs +++ b/library/coretests/tests/pin.rs @@ -34,9 +34,6 @@ fn pin_const() { } pin_mut_const(); - - // Check that we accept a Rust 2024 $expr. - std::pin::pin!(const { 1 }); } #[allow(unused)] @@ -84,14 +81,3 @@ mod pin_coerce_unsized { arg } } - -#[test] -#[cfg(not(bootstrap))] -fn temp_lifetime() { - // Check that temporary lifetimes work as in Rust 2021. - // Regression test for https://github.com/rust-lang/rust/issues/138596 - match std::pin::pin!(foo(&mut 0)) { - _ => {} - } - async fn foo(_: &mut usize) {} -} diff --git a/library/coretests/tests/pin_macro.rs b/library/coretests/tests/pin_macro.rs index 43542397a61..639eab740c0 100644 --- a/library/coretests/tests/pin_macro.rs +++ b/library/coretests/tests/pin_macro.rs @@ -30,3 +30,20 @@ fn unsize_coercion() { let dyn_obj: Pin<&mut dyn Send> = pin!([PhantomPinned; 2]); stuff(dyn_obj); } + +#[test] +fn rust_2024_expr() { + // Check that we accept a Rust 2024 $expr. + std::pin::pin!(const { 1 }); +} + +#[test] +#[cfg(not(bootstrap))] +fn temp_lifetime() { + // Check that temporary lifetimes work as in Rust 2021. + // Regression test for https://github.com/rust-lang/rust/issues/138596 + match std::pin::pin!(foo(&mut 0)) { + _ => {} + } + async fn foo(_: &mut usize) {} +} |
