rust/tests/ui/issues/issue-20953.rs

13 lines
400 B
Rust
Raw Normal View History

// run-pass
#![allow(unused_mut)]
#![allow(unused_variables)]
fn main() {
2019-05-28 13:47:21 -05:00
let mut shrinker: Box<dyn Iterator<Item=i32>> = Box::new(vec![1].into_iter());
println!("{:?}", shrinker.next());
for v in shrinker { assert!(false); }
2019-05-28 13:47:21 -05:00
let mut shrinker: &mut dyn Iterator<Item=i32> = &mut vec![1].into_iter();
println!("{:?}", shrinker.next());
for v in shrinker { assert!(false); }
}