summaryrefslogtreecommitdiffstats
path: root/src/test/ui/associated-consts/associated-const-private-impl.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/associated-consts/associated-const-private-impl.rs')
-rw-r--r--src/test/ui/associated-consts/associated-const-private-impl.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/associated-consts/associated-const-private-impl.rs b/src/test/ui/associated-consts/associated-const-private-impl.rs
new file mode 100644
index 000000000..3ee3134ac
--- /dev/null
+++ b/src/test/ui/associated-consts/associated-const-private-impl.rs
@@ -0,0 +1,15 @@
+mod bar1 {
+ pub use self::bar2::Foo;
+ mod bar2 {
+ pub struct Foo;
+
+ impl Foo {
+ const ID: i32 = 1;
+ }
+ }
+}
+
+fn main() {
+ assert_eq!(1, bar1::Foo::ID);
+ //~^ERROR associated constant `ID` is private
+}