Skip to content

Commit a1eacbe

Browse files
authored
Unrolled build for rust-lang#139052
Rollup merge of rust-lang#139052 - m-ou-se:pin-macro-tests, r=joboet Put pin!() tests in the right file. In rust-lang#138717, these tests were put in `tests/pin.rs`, but they should go in `tests/pin_macro.rs`. r? `@jdonszelmann`
2 parents 19f42cb + c414760 commit a1eacbe

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

library/coretests/tests/pin.rs

-14
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ fn pin_const() {
3434
}
3535

3636
pin_mut_const();
37-
38-
// Check that we accept a Rust 2024 $expr.
39-
std::pin::pin!(const { 1 });
4037
}
4138

4239
#[allow(unused)]
@@ -84,14 +81,3 @@ mod pin_coerce_unsized {
8481
arg
8582
}
8683
}
87-
88-
#[test]
89-
#[cfg(not(bootstrap))]
90-
fn temp_lifetime() {
91-
// Check that temporary lifetimes work as in Rust 2021.
92-
// Regression test for https://github.com/rust-lang/rust/issues/138596
93-
match std::pin::pin!(foo(&mut 0)) {
94-
_ => {}
95-
}
96-
async fn foo(_: &mut usize) {}
97-
}

library/coretests/tests/pin_macro.rs

+17
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,20 @@ fn unsize_coercion() {
3030
let dyn_obj: Pin<&mut dyn Send> = pin!([PhantomPinned; 2]);
3131
stuff(dyn_obj);
3232
}
33+
34+
#[test]
35+
fn rust_2024_expr() {
36+
// Check that we accept a Rust 2024 $expr.
37+
std::pin::pin!(const { 1 });
38+
}
39+
40+
#[test]
41+
#[cfg(not(bootstrap))]
42+
fn temp_lifetime() {
43+
// Check that temporary lifetimes work as in Rust 2021.
44+
// Regression test for https://github.com/rust-lang/rust/issues/138596
45+
match std::pin::pin!(foo(&mut 0)) {
46+
_ => {}
47+
}
48+
async fn foo(_: &mut usize) {}
49+
}

0 commit comments

Comments
 (0)