about summary refs log tree commit diff
path: root/src/test/compile-fail/struct-variant-no-pub.rs
diff options
context:
space:
mode:
authorSteven Fackler <sfackler@gmail.com>2014-11-15 17:57:54 -0800
committerSteven Fackler <sfackler@gmail.com>2014-11-15 18:15:27 -0800
commit579c65da1babbcfa5f3fd1cb5a1062acbe5b61eb (patch)
tree16a6ebca56dbed85cfe040b99642ae1b3a7a72d6 /src/test/compile-fail/struct-variant-no-pub.rs
parent7e43f419cb98c9035d30e5cf0e0be7944dbc0371 (diff)
downloadrust-579c65da1babbcfa5f3fd1cb5a1062acbe5b61eb.tar.gz
rust-579c65da1babbcfa5f3fd1cb5a1062acbe5b61eb.zip
Un-feature gate struct variants
Struct variant field visibility is now inherited. Remove `pub` keywords
from declarations.

Closes #18641

[breaking-change]
Diffstat (limited to 'src/test/compile-fail/struct-variant-no-pub.rs')
-rw-r--r--src/test/compile-fail/struct-variant-no-pub.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/compile-fail/struct-variant-no-pub.rs b/src/test/compile-fail/struct-variant-no-pub.rs
new file mode 100644
index 00000000000..15ed69083e0
--- /dev/null
+++ b/src/test/compile-fail/struct-variant-no-pub.rs
@@ -0,0 +1,17 @@
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+enum Foo {
+    Bar {
+        pub a: int //~ ERROR: `pub` is not allowed here
+    }
+}
+
+fn main() {}