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
23 //~^ HELP as shown: fn check<'r, I: Iterator<Item = usize>, T: Itble<'r, usize, I>>(cont: &'r T)
25 let cont_iter
= cont
.iter();
26 //~^ ERROR cannot infer an appropriate lifetime for autoref due to conflicting requirements
27 let result
= cont_iter
.fold(Some(0), |state
, val
| {
28 state
.map_or(None
, |mask
| {
30 if mask
& bit
== 0 {Some(mask|bit)}
else {None}
38 //~^ ERROR mismatched types
39 //~| HELP run `rustc --explain E0308` to see a detailed explanation