about summary refs log tree commit diff
path: root/src/tools/rustfmt/tests/source/pin_sugar.rs
blob: e5b47339b928d9237982c1e6e014f5cad37db96d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// See #130494

#![feature(pin_ergonomics)]
#![allow(incomplete_features)]

fn f(x: &pin  const i32) {}
fn g<'a>(x: &  'a pin const  i32) {}
fn h<'a>(x: &  'a pin  
mut i32) {}
fn i(x: &pin      mut  i32) {}

struct Foo;

impl Foo {
    fn f(&pin   const self) {}
    fn g<'a>(&   'a pin const    self) {}
    fn h<'a>(&    'a pin
mut self) {}
    fn i(&pin      mut   self) {}
}

fn borrows() {
    let mut foo = 0_i32;
    let x: Pin<&mut _> = & pin 
    mut    foo;

    let x: Pin<&_> = &
    pin                const 
    foo;
}