about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMara Bos <m-ou.se@m-ou.se>2025-03-28 10:16:03 +0100
committerMara Bos <m-ou.se@m-ou.se>2025-03-28 10:18:04 +0100
commitc41476034d49813d574af3877f6995e14b10729d (patch)
tree1951d6eef24faba70485675cbecf26b9c4ce2282
parent3f690c2257b7080cd3a8cce64e082fc972148990 (diff)
downloadrust-c41476034d49813d574af3877f6995e14b10729d.tar.gz
rust-c41476034d49813d574af3877f6995e14b10729d.zip
Put pin!() tests in the right file.
-rw-r--r--library/coretests/tests/pin.rs14
-rw-r--r--library/coretests/tests/pin_macro.rs17
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) {}
+}