From 2938d92a35dbb55dfbf444f92a73865a475733f1 Mon Sep 17 00:00:00 2001 From: Chris Hellmuth Date: Sun, 7 Jun 2015 17:29:09 -0600 Subject: [PATCH] Add a regression test for public struct field spans --- .../pub-struct-field-span-26083.rs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/test/compile-fail/pub-struct-field-span-26083.rs diff --git a/src/test/compile-fail/pub-struct-field-span-26083.rs b/src/test/compile-fail/pub-struct-field-span-26083.rs new file mode 100644 index 000000000000..ef0f7a546ebe --- /dev/null +++ b/src/test/compile-fail/pub-struct-field-span-26083.rs @@ -0,0 +1,20 @@ +// Regression test for issue #26083 +// Test that span for public struct fields start at `pub` instead of the identifier + +struct Foo { + pub bar: u8, + + pub + //~^ error: field `bar` is already declared [E0124] + bar: u8, + + pub bar: + //~^ error: field `bar` is already declared [E0124] + u8, + + bar: + //~^ error: field `bar` is already declared [E0124] + u8, +} + +fn main() { }