diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-20953.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-20953.rs b/src/test/ui/issues/issue-20953.rs new file mode 100644 index 000000000..4ec7e3195 --- /dev/null +++ b/src/test/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); } +} |