File tree 2 files changed +14
-0
lines changed
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1943,6 +1943,7 @@ unsafe impl<T: ?Sized> PinCoerceUnsized for *mut T {}
1943
1943
#[ stable( feature = "pin_macro" , since = "1.68.0" ) ]
1944
1944
#[ rustc_macro_transparency = "semitransparent" ]
1945
1945
#[ allow_internal_unstable( unsafe_pin_internals) ]
1946
+ #[ cfg_attr( not( bootstrap) , rustc_macro_edition_2021) ]
1946
1947
pub macro pin ( $value: expr $( , ) ?) {
1947
1948
// This is `Pin::new_unchecked(&mut { $value })`, so, for starters, let's
1948
1949
// review such a hypothetical macro (that any user-code could define):
Original file line number Diff line number Diff line change @@ -81,3 +81,16 @@ mod pin_coerce_unsized {
81
81
arg
82
82
}
83
83
}
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 ) { }
You can’t perform that action at this time.
0 commit comments