File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 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 {}
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) ]
19461947pub 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):
Original file line number Diff line number Diff 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 ) { }
You can’t perform that action at this time.
0 commit comments