-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test invalid tuple field identifiers
- Loading branch information
Showing
2 changed files
with
47 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#![feature(offset_of)] | ||
#![feature(builtin_syntax)] | ||
|
||
fn main() { | ||
core::mem::offset_of!((u8, u8), _0); //~ ERROR no field `_0` | ||
core::mem::offset_of!((u8, u8), +1); //~ ERROR no rules expected | ||
core::mem::offset_of!((u8, u8), -1); //~ ERROR no rules expected | ||
builtin # offset_of((u8, u8), _0); //~ ERROR no field `_0` | ||
builtin # offset_of((u8, u8), +1); //~ ERROR expected identifier | ||
} |
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,37 @@ | ||
error: expected identifier, found `+` | ||
--> $DIR/offset-of-tuple.rs:9:35 | ||
| | ||
LL | builtin # offset_of((u8, u8), +1); | ||
| ^ expected identifier | ||
|
||
error: no rules expected the token `1` | ||
--> $DIR/offset-of-tuple.rs:6:38 | ||
| | ||
LL | core::mem::offset_of!((u8, u8), +1); | ||
| ^ no rules expected this token in macro call | ||
| | ||
= note: while trying to match sequence start | ||
|
||
error: no rules expected the token `1` | ||
--> $DIR/offset-of-tuple.rs:7:38 | ||
| | ||
LL | core::mem::offset_of!((u8, u8), -1); | ||
| ^ no rules expected this token in macro call | ||
| | ||
= note: while trying to match sequence start | ||
|
||
error[E0609]: no field `_0` on type `(u8, u8)` | ||
--> $DIR/offset-of-tuple.rs:5:37 | ||
| | ||
LL | core::mem::offset_of!((u8, u8), _0); | ||
| ^^ | ||
|
||
error[E0609]: no field `_0` on type `(u8, u8)` | ||
--> $DIR/offset-of-tuple.rs:8:35 | ||
| | ||
LL | builtin # offset_of((u8, u8), _0); | ||
| ^^ | ||
|
||
error: aborting due to 5 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0609`. |