File tree 3 files changed +26
-1
lines changed
3 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -829,7 +829,6 @@ impl Rewrite for ast::Ty {
829
829
}
830
830
ast:: TyKind :: Ref ( ref lifetime, ref mt)
831
831
| ast:: TyKind :: PinnedRef ( ref lifetime, ref mt) => {
832
- // FIXME(pin_ergonomics): correctly format pinned reference syntax
833
832
let mut_str = format_mutability ( mt. mutbl ) ;
834
833
let mut_len = mut_str. len ( ) ;
835
834
let mut result = String :: with_capacity ( 128 ) ;
@@ -863,6 +862,13 @@ impl Rewrite for ast::Ty {
863
862
cmnt_lo = lifetime. ident . span . hi ( ) ;
864
863
}
865
864
865
+ if let ast:: TyKind :: PinnedRef ( ..) = self . kind {
866
+ result. push_str ( "pin " ) ;
867
+ if ast:: Mutability :: Not == mt. mutbl {
868
+ result. push_str ( "const " ) ;
869
+ }
870
+ }
871
+
866
872
if ast:: Mutability :: Mut == mt. mutbl {
867
873
let mut_hi = context. snippet_provider . span_after ( self . span ( ) , "mut" ) ;
868
874
let before_mut_span = mk_sp ( cmnt_lo, mut_hi - BytePos :: from_usize ( 3 ) ) ;
Original file line number Diff line number Diff line change
1
+ // See #130494
2
+
3
+ #![ feature( pin_ergonomics) ]
4
+ #![ allow( incomplete_features) ]
5
+
6
+ fn f ( x : & pin const i32 ) { }
7
+ fn g < ' a > ( x : & ' a pin const i32 ) { }
8
+ fn h < ' a > ( x : & ' a pin
9
+ mut i32 ) { }
10
+ fn i ( x : & pin mut i32 ) { }
Original file line number Diff line number Diff line change
1
+ // See #130494
2
+
3
+ #![ feature( pin_ergonomics) ]
4
+ #![ allow( incomplete_features) ]
5
+
6
+ fn f ( x : & pin const i32 ) { }
7
+ fn g < ' a > ( x : & ' a pin const i32 ) { }
8
+ fn h < ' a > ( x : & ' a pin mut i32 ) { }
9
+ fn i ( x : & pin mut i32 ) { }
You can’t perform that action at this time.
0 commit comments