summaryrefslogtreecommitdiffstats
path: root/tests/ui/privacy/private-method.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/privacy/private-method.rs')
-rw-r--r--tests/ui/privacy/private-method.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/ui/privacy/private-method.rs b/tests/ui/privacy/private-method.rs
new file mode 100644
index 000000000..76a642cde
--- /dev/null
+++ b/tests/ui/privacy/private-method.rs
@@ -0,0 +1,23 @@
+mod kitties {
+ pub struct Cat {
+ meows : usize,
+
+ how_hungry : isize,
+ }
+
+ impl Cat {
+ fn nap(&self) {}
+ }
+
+ pub fn cat(in_x : usize, in_y : isize) -> Cat {
+ Cat {
+ meows: in_x,
+ how_hungry: in_y
+ }
+ }
+}
+
+fn main() {
+ let nyan : kitties::Cat = kitties::cat(52, 99);
+ nyan.nap(); //~ ERROR associated function `nap` is private
+}