diff options
Diffstat (limited to 'tests/ui/issues/issue-20953.rs')
-rw-r--r-- | tests/ui/issues/issue-20953.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/issues/issue-20953.rs b/tests/ui/issues/issue-20953.rs new file mode 100644 index 000000000..4ec7e3195 --- /dev/null +++ b/tests/ui/issues/issue-20953.rs @@ -0,0 +1,12 @@ +// run-pass +#![allow(unused_mut)] +#![allow(unused_variables)] +fn main() { + let mut shrinker: Box<dyn Iterator<Item=i32>> = Box::new(vec![1].into_iter()); + println!("{:?}", shrinker.next()); + for v in shrinker { assert!(false); } + + let mut shrinker: &mut dyn Iterator<Item=i32> = &mut vec![1].into_iter(); + println!("{:?}", shrinker.next()); + for v in shrinker { assert!(false); } +} |