2018-08-30 07:18:55 -05:00
|
|
|
// run-pass
|
2015-03-22 15:13:15 -05:00
|
|
|
|
2015-01-19 08:48:05 -06:00
|
|
|
fn main() {
|
|
|
|
let v = vec![1, 2, 3];
|
2019-05-28 13:47:21 -05:00
|
|
|
let boxed: Box<dyn Iterator<Item=i32>> = Box::new(v.into_iter());
|
2015-01-19 08:48:05 -06:00
|
|
|
assert_eq!(boxed.max(), Some(3));
|
|
|
|
|
|
|
|
let v = vec![1, 2, 3];
|
2019-05-28 13:47:21 -05:00
|
|
|
let boxed: &mut dyn Iterator<Item=i32> = &mut v.into_iter();
|
2015-01-19 08:48:05 -06:00
|
|
|
assert_eq!(boxed.max(), Some(3));
|
|
|
|
}
|