diff options
Diffstat (limited to 'crates/syntax/test_data/parser/ok/0051_parameter_attrs.rs')
-rw-r--r-- | crates/syntax/test_data/parser/ok/0051_parameter_attrs.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/crates/syntax/test_data/parser/ok/0051_parameter_attrs.rs b/crates/syntax/test_data/parser/ok/0051_parameter_attrs.rs new file mode 100644 index 000000000..de350d858 --- /dev/null +++ b/crates/syntax/test_data/parser/ok/0051_parameter_attrs.rs | |||
@@ -0,0 +1,21 @@ | |||
1 | fn g1(#[attr1] #[attr2] pat: Type) {} | ||
2 | fn g2(#[attr1] x: u8) {} | ||
3 | |||
4 | extern "C" { fn printf(format: *const i8, #[attr] ...) -> i32; } | ||
5 | |||
6 | fn foo<F: FnMut(#[attr] &mut Foo<'a>)>(){} | ||
7 | |||
8 | trait Foo { | ||
9 | fn bar(#[attr] _: u64, # [attr] mut x: i32); | ||
10 | } | ||
11 | |||
12 | impl S { | ||
13 | fn f(#[must_use] self) {} | ||
14 | fn g1(#[attr] self) {} | ||
15 | fn g2(#[attr] &self) {} | ||
16 | fn g3<'a>(#[attr] &mut self) {} | ||
17 | fn g4<'a>(#[attr] &'a self) {} | ||
18 | fn g5<'a>(#[attr] &'a mut self) {} | ||
19 | fn c(#[attr] self: Self) {} | ||
20 | fn d(#[attr] self: Rc<Self>) {} | ||
21 | } \ No newline at end of file | ||