update failing E0621 tests

This commit is contained in:
Cengiz Can 2017-11-08 13:35:05 +00:00 committed by Cengiz Can
parent 501c558ffe
commit 090669d9cd
6 changed files with 6 additions and 6 deletions

View File

@ -22,7 +22,7 @@ impl<'r> Itble<'r, usize, Range<usize>> for (usize, usize) {
fn check<'r, I: Iterator<Item=usize>, T: Itble<'r, usize, I>>(cont: &T) -> bool
{
let cont_iter = cont.iter();
//~^ ERROR cannot infer an appropriate lifetime for autoref due to conflicting requirements
//~^ ERROR 24:26: 24:30: explicit lifetime required in the type of `cont` [E0621]
let result = cont_iter.fold(Some(0), |state, val| {
state.map_or(None, |mask| {
let bit = 1 << val;

View File

@ -19,7 +19,7 @@ impl Foo for A {}
struct B<'a>(&'a (Foo+'a));
fn foo<'a>(a: &Foo) -> B<'a> {
B(a) //~ ERROR cannot infer an appropriate lifetime
B(a) //~ ERROR 22:5: 22:9: explicit lifetime required in the type of `a` [E0621]
}
fn main() {

View File

@ -25,7 +25,7 @@ struct Parser<'a> {
impl<'a> Parser<'a> {
pub fn new(lexer: &'a mut Lexer) -> Parser<'a> {
Parser { lexer: lexer }
//~^ ERROR cannot infer an appropriate lifetime
//~^ ERROR 27:25: 27:30: explicit lifetime required in the type of `lexer` [E0621]
}
}

View File

@ -13,7 +13,7 @@ struct thing<'a, Q:'a> {
}
fn thing<'a,Q>(x: &Q) -> thing<'a,Q> {
thing{ x: x } //~ ERROR cannot infer
thing{ x: x } //~ ERROR 16:5: 16:18: explicit lifetime required in the type of `x` [E0621]
}
fn main() {

View File

@ -22,7 +22,7 @@ mod argparse {
impl<'a> Flag<'a> {
pub fn set_desc(self, s: &str) -> Flag<'a> {
Flag { //~ ERROR cannot infer
Flag { //~ ERROR 25:13: 30:14: explicit lifetime required in the type of `s` [E0621]
name: self.name,
desc: s,
max_count: self.max_count,

View File

@ -31,7 +31,7 @@ fn get<'a, G>(get: &G) -> i32
// This fails to type-check because, without variance, we can't
// use `G : Get<&'a i32>` as evidence that `G : Get<&'b i32>`,
// even if `'a : 'b`.
pick(get, &22) //~ ERROR cannot infer
pick(get, &22) //~ ERROR 34:5: 34:9: explicit lifetime required in the type of `get` [E0621]
}
fn pick<'b, G>(get: &'b G, if_odd: &'b i32) -> i32