aboutsummaryrefslogtreecommitdiff
path: root/crates/syntax/test_data/parser/ok/0051_parameter_attrs.rs
blob: de350d8587ac09574cb9f64471cfa503599ce50e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
fn g1(#[attr1] #[attr2] pat: Type) {}
fn g2(#[attr1] x: u8) {}

extern "C" { fn printf(format: *const i8, #[attr] ...) -> i32; }

fn foo<F: FnMut(#[attr] &mut Foo<'a>)>(){}

trait Foo {
    fn bar(#[attr] _: u64, # [attr] mut x: i32);
}

impl S {
     fn f(#[must_use] self) {}
     fn g1(#[attr] self) {}
     fn g2(#[attr] &self) {}
     fn g3<'a>(#[attr] &mut self) {}
     fn g4<'a>(#[attr] &'a self) {}
     fn g5<'a>(#[attr] &'a mut self) {}
     fn c(#[attr] self: Self) {}
     fn d(#[attr] self: Rc<Self>) {}
}