Skip to content

Commit 3c384b4

Browse files
committed
add rustc_macro_edition_2021
1 parent 9d668f3 commit 3c384b4

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Diff for: core/src/pin.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1943,6 +1943,7 @@ unsafe impl<T: ?Sized> PinCoerceUnsized for *mut T {}
19431943
#[stable(feature = "pin_macro", since = "1.68.0")]
19441944
#[rustc_macro_transparency = "semitransparent"]
19451945
#[allow_internal_unstable(unsafe_pin_internals)]
1946+
#[cfg_attr(not(bootstrap), rustc_macro_edition_2021)]
19461947
pub macro pin($value:expr $(,)?) {
19471948
// This is `Pin::new_unchecked(&mut { $value })`, so, for starters, let's
19481949
// review such a hypothetical macro (that any user-code could define):

Diff for: coretests/tests/pin.rs

+13
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,16 @@ mod pin_coerce_unsized {
8181
arg
8282
}
8383
}
84+
85+
#[test]
86+
fn spans_2021() {
87+
// Check that we accept a Rust 2024 $expr.
88+
std::pin::pin!(const { 1 });
89+
90+
// Check that temporary lifetimes work as in Rust 2021.
91+
match std::pin::pin!(foo(&mut 0)) {
92+
_f => {}
93+
}
94+
}
95+
96+
async fn foo(_: &mut usize) {}

0 commit comments

Comments
 (0)