1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
13 trait Itble
<'r
, T
, I
: Iterator
<Item
=T
>> { fn iter(&'r self) -> I; }
15 impl<'r
> Itble
<'r
, usize, Range
<usize>> for (usize, usize) {
16 fn iter(&'r
self) -> Range
<usize> {
17 let &(min
, max
) = self;
22 fn check
<'r
, I
: Iterator
<Item
=usize>, T
: Itble
<'r
, usize, I
>>(cont
: &T
) -> bool
24 let cont_iter
= cont
.iter();
25 //~^ ERROR 24:26: 24:30: explicit lifetime required in the type of `cont` [E0621]
26 let result
= cont_iter
.fold(Some(0), |state
, val
| {
27 state
.map_or(None
, |mask
| {
29 if mask
& bit
== 0 {Some(mask|bit)}
else {None}