summaryrefslogtreecommitdiffstats
path: root/src/test/ui/regions/regions-addr-of-ret.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/regions/regions-addr-of-ret.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/ui/regions/regions-addr-of-ret.rs b/src/test/ui/regions/regions-addr-of-ret.rs
new file mode 100644
index 000000000..e5dcd6db0
--- /dev/null
+++ b/src/test/ui/regions/regions-addr-of-ret.rs
@@ -0,0 +1,9 @@
+// run-pass
+fn f(x: &isize) -> &isize {
+ return &*x;
+}
+
+pub fn main() {
+ let three = &3;
+ println!("{}", *f(three));
+}