forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#54581 - petrochenkov:cfgattr, r=alexcrichton
Accept trailing comma in `cfg_attr` Fixes rust-lang#54463 (stable-to-beta regression)
- Loading branch information
Showing
3 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// compile-flags: --cfg TRUE | ||
|
||
#[cfg_attr(TRUE, inline,)] // OK | ||
fn f() {} | ||
|
||
#[cfg_attr(FALSE, inline,)] // OK | ||
fn g() {} | ||
|
||
#[cfg_attr(TRUE, inline,,)] //~ ERROR expected `)`, found `,` | ||
fn h() {} | ||
|
||
#[cfg_attr(FALSE, inline,,)] //~ ERROR expected `)`, found `,` | ||
fn i() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
error: expected `)`, found `,` | ||
--> $DIR/cfg-attr-trailing-comma.rs:9:25 | ||
| | ||
LL | #[cfg_attr(TRUE, inline,,)] //~ ERROR expected `)`, found `,` | ||
| ^ expected `)` | ||
|
||
error: expected `)`, found `,` | ||
--> $DIR/cfg-attr-trailing-comma.rs:12:26 | ||
| | ||
LL | #[cfg_attr(FALSE, inline,,)] //~ ERROR expected `)`, found `,` | ||
| ^ expected `)` | ||
|
||
error: aborting due to 2 previous errors | ||
|