about summary refs log tree commit diff
path: root/tests/ui/traits/anon-static-method.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/traits/anon-static-method.rs')
-rw-r--r--tests/ui/traits/anon-static-method.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/traits/anon-static-method.rs b/tests/ui/traits/anon-static-method.rs
new file mode 100644
index 00000000000..ede01afae02
--- /dev/null
+++ b/tests/ui/traits/anon-static-method.rs
@@ -0,0 +1,15 @@
+// run-pass
+struct Foo {
+    x: isize
+}
+
+impl Foo {
+    pub fn new() -> Foo {
+        Foo { x: 3 }
+    }
+}
+
+pub fn main() {
+    let x = Foo::new();
+    println!("{}", x.x);
+}