1 // Parse `cfg_attr` with varying numbers of attributes and trailing commas
3 #![feature(cfg_attr_multi)]
5 // Completely empty `cfg_attr` input
6 #[cfg_attr()] //~ error: expected identifier, found `)`
7 struct NoConfigurationPredicate;
9 // Zero attributes, zero trailing comma (comma manatory here)
10 #[cfg_attr(all())] //~ error: expected `,`, found `)`
13 // Zero attributes, one trailing comma
14 #[cfg_attr(all(),)] // Ok
17 // Zero attributes, two trailing commas
18 #[cfg_attr(all(),,)] //~ ERROR expected identifier
21 // One attribute, no trailing comma
22 #[cfg_attr(all(), must_use)] // Ok
25 // One attribute, one trailing comma
26 #[cfg_attr(all(), must_use,)] // Ok
29 // One attribute, two trailing commas
30 #[cfg_attr(all(), must_use,,)] //~ ERROR expected identifier
33 // Two attributes, no trailing comma
34 #[cfg_attr(all(), must_use, deprecated)] // Ok
37 // Two attributes, one trailing comma
38 #[cfg_attr(all(), must_use, deprecated,)] // Ok
41 // Two attributes, two trailing commas
42 #[cfg_attr(all(), must_use, deprecated,,)] //~ ERROR expected identifier