summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues/issue-21361.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/issues/issue-21361.rs')
-rw-r--r--tests/ui/issues/issue-21361.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/issues/issue-21361.rs b/tests/ui/issues/issue-21361.rs
new file mode 100644
index 000000000..c970e77ab
--- /dev/null
+++ b/tests/ui/issues/issue-21361.rs
@@ -0,0 +1,11 @@
+// run-pass
+
+fn main() {
+ let v = vec![1, 2, 3];
+ let boxed: Box<dyn Iterator<Item=i32>> = Box::new(v.into_iter());
+ assert_eq!(boxed.max(), Some(3));
+
+ let v = vec![1, 2, 3];
+ let boxed: &mut dyn Iterator<Item=i32> = &mut v.into_iter();
+ assert_eq!(boxed.max(), Some(3));
+}