summaryrefslogtreecommitdiff
path: root/tests/ui/offset-of/offset-of-arg-count.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/offset-of/offset-of-arg-count.rs')
-rw-r--r--tests/ui/offset-of/offset-of-arg-count.rs14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/ui/offset-of/offset-of-arg-count.rs b/tests/ui/offset-of/offset-of-arg-count.rs
index 163b07454ec..5e66e33f8a2 100644
--- a/tests/ui/offset-of/offset-of-arg-count.rs
+++ b/tests/ui/offset-of/offset-of-arg-count.rs
@@ -3,7 +3,15 @@
use std::mem::offset_of;
fn main() {
- offset_of!(NotEnoughArguments); //~ ERROR expected one of
- offset_of!(NotEnoughArgumentsWithAComma, ); //~ ERROR expected 2 arguments
- offset_of!(Container, field, too many arguments); //~ ERROR expected 2 arguments
+ offset_of!(NotEnoughArguments); //~ ERROR unexpected end of macro invocation
+ offset_of!(NotEnoughArgumentsWithAComma, ); //~ ERROR unexpected end of macro invocation
+ offset_of!(Container, field, too many arguments); //~ ERROR no rules expected the token `too`
+ offset_of!(S, f); // compiles fine
+ offset_of!(S, f,); // also compiles fine
+ offset_of!(S, f.); //~ ERROR unexpected end of macro invocation
+ offset_of!(S, f.,); //~ ERROR expected identifier
+ offset_of!(S, f..); //~ ERROR no rules expected the token
+ offset_of!(S, f..,); //~ ERROR no rules expected the token
}
+
+struct S { f: u8, }