summaryrefslogtreecommitdiffstats
path: root/src/test/ui/issues/issue-6153.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/issues/issue-6153.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-6153.rs b/src/test/ui/issues/issue-6153.rs
new file mode 100644
index 000000000..25f026f21
--- /dev/null
+++ b/src/test/ui/issues/issue-6153.rs
@@ -0,0 +1,13 @@
+// run-pass
+
+
+fn swap<F>(f: F) -> Vec<isize> where F: FnOnce(Vec<isize>) -> Vec<isize> {
+ let x = vec![1, 2, 3];
+ f(x)
+}
+
+pub fn main() {
+ let v = swap(|mut x| { x.push(4); x });
+ let w = swap(|mut x| { x.push(4); x });
+ assert_eq!(v, w);
+}