@@ -315,8 +315,8 @@ fn foo(#[inline] bar: u32) { .. }
315315Let ` OuterAttr ` denote the production for an attribute ` #[...] ` .
316316
317317On the formal parameters of an ` fn ` item, including on method receivers,
318- and irrespective of whether the ` fn ` has a body or not, ` OuterAttr+ ` is allowed.
319- For example, all the following are valid:
318+ and irrespective of whether the ` fn ` has a body or not, ` OuterAttr+ ` is allowed
319+ but not required. For example, all the following are valid:
320320
321321``` rust
322322fn g1 (#[attr1 ] #[attr2 ] pat : Type ) { .. }
@@ -334,11 +334,17 @@ fn g6<'a>(#[attr] &'a self) { .. }
334334fn g7 <'a >(#[attr ] & 'a mut self ) { .. }
335335
336336fn g8 (#[attr ] self : Self ) { .. }
337+
338+ fn g9 (#[attr ] self : Rc <Self >) { .. }
337339```
338340
339341The attributes here apply to the parameter * as a whole* ,
340342e.g. in ` g2 ` , ` #[attr] ` applies to ` pat: Type ` as opposed to ` pat ` .
341343
344+ More generally, an ` fn ` item contains a list of formal parameters separated or
345+ terminated by ` , ` and delimited by ` ( ` and ` ) ` . Each parameter in that list may
346+ optionally be prefixed by ` OuterAttr+ ` .
347+
342348### Variadics
343349
344350Attributes may also be attached to ` ... ` on variadic functions, e.g.
@@ -349,6 +355,8 @@ extern "C" {
349355}
350356```
351357
358+ That is, for the purposes of this RFC, ` ... ` is considered as a parameter.
359+
352360### Anonymous parameters in Rust 2015
353361
354362In Rust 2015 edition, as ` fn ` s may have anonymous parameters, e.g.
0 commit comments