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