]> git.proxmox.com Git - rustc.git/blobdiff - src/test/compile-fail/private-impl-method.rs
Imported Upstream version 1.9.0+dfsg1
[rustc.git] / src / test / compile-fail / private-impl-method.rs
index c6e329aab041a3b2ad0506e23278bbf9b766cf70..e04380f12acafd7b0f6d577b8ad868db8c2a55a7 100644 (file)
@@ -18,7 +18,14 @@ mod a {
     }
 }
 
+fn f() {
+    impl a::Foo {
+        fn bar(&self) {} // This should be visible outside `f`
+    }
+}
+
 fn main() {
     let s = a::Foo { x: 1 };
+    s.bar();
     s.foo();    //~ ERROR method `foo` is private
 }