summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues/issue-20953.rs
blob: 4ec7e3195ebe05fb1ba39c98fcdbcdb1d8ecf616 (plain)
1
2
3
4
5
6
7
8
9
10
11
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); }
}