summaryrefslogtreecommitdiffstats
path: root/src/test/ui/impl-not-adjacent-to-type.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/impl-not-adjacent-to-type.rs')
-rw-r--r--src/test/ui/impl-not-adjacent-to-type.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/ui/impl-not-adjacent-to-type.rs b/src/test/ui/impl-not-adjacent-to-type.rs
new file mode 100644
index 000000000..97caf9083
--- /dev/null
+++ b/src/test/ui/impl-not-adjacent-to-type.rs
@@ -0,0 +1,16 @@
+// run-pass
+
+mod foo {
+ pub struct Point {
+ pub x: i32,
+ pub y: i32,
+ }
+}
+
+impl foo::Point {
+ fn x(&self) -> i32 { self.x }
+}
+
+fn main() {
+ assert_eq!((foo::Point { x: 1, y: 3}).x(), 1);
+}