Updating tests to remove all "undeclared lifetime" errors (since those should no longer occur)

This commit is contained in:
Sunjay Varma 2017-12-13 18:27:53 -05:00
parent 8cfaf1bab2
commit 4f90eacbfe
6 changed files with 12 additions and 33 deletions

View File

@ -10,7 +10,8 @@
#![feature(generic_associated_types)] #![feature(generic_associated_types)]
//FIXME(#44265): "undeclared lifetime" errors will be addressed in a follow-up PR //FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a
//follow-up PR
trait Foo { trait Foo {
type Bar<'a, 'b>; type Bar<'a, 'b>;
@ -22,8 +23,7 @@ trait Baz {
impl<T> Baz for T where T: Foo { impl<T> Baz for T where T: Foo {
type Quux<'a> = <T as Foo>::Bar<'a, 'static>; type Quux<'a> = <T as Foo>::Bar<'a, 'static>;
//~^ ERROR undeclared lifetime //~^ ERROR lifetime parameters are not allowed on this type [E0110]
//~| ERROR lifetime parameters are not allowed on this type [E0110]
} }
fn main() {} fn main() {}

View File

@ -1,14 +1,8 @@
error[E0261]: use of undeclared lifetime name `'a`
--> $DIR/construct_with_other_type.rs:24:37
|
24 | type Quux<'a> = <T as Foo>::Bar<'a, 'static>;
| ^^ undeclared lifetime
error[E0110]: lifetime parameters are not allowed on this type error[E0110]: lifetime parameters are not allowed on this type
--> $DIR/construct_with_other_type.rs:24:37 --> $DIR/construct_with_other_type.rs:25:37
| |
24 | type Quux<'a> = <T as Foo>::Bar<'a, 'static>; 25 | type Quux<'a> = <T as Foo>::Bar<'a, 'static>;
| ^^ lifetime parameter not allowed on this type | ^^ lifetime parameter not allowed on this type
error: aborting due to 2 previous errors error: aborting due to previous error

View File

@ -13,8 +13,6 @@
// Checking the interaction with this other feature // Checking the interaction with this other feature
#![feature(associated_type_defaults)] #![feature(associated_type_defaults)]
//FIXME(#44265): "undeclared lifetime" errors will be addressed in a follow-up PR
use std::fmt::{Display, Debug}; use std::fmt::{Display, Debug};
trait Foo { trait Foo {
@ -32,7 +30,6 @@ impl Foo for Bar {
type Assoc2<T> = Vec<T>; type Assoc2<T> = Vec<T>;
type Assoc3<T> where T: Iterator = Vec<T>; type Assoc3<T> where T: Iterator = Vec<T>;
type WithDefault<'a, T> = &'a Iterator<T>; type WithDefault<'a, T> = &'a Iterator<T>;
//~^ ERROR undeclared lifetime
type NoGenerics = ::std::cell::Cell<i32>; type NoGenerics = ::std::cell::Cell<i32>;
} }

View File

@ -1,8 +1,2 @@
error[E0261]: use of undeclared lifetime name `'a`
--> $DIR/generic-associated-types-where.rs:34:32
|
34 | type WithDefault<'a, T> = &'a Iterator<T>;
| ^^ undeclared lifetime
error: cannot continue compilation due to previous error error: cannot continue compilation due to previous error

View File

@ -10,13 +10,13 @@
#![feature(generic_associated_types)] #![feature(generic_associated_types)]
//FIXME(#44265): "undeclared lifetime" errors will be addressed in a follow-up PR //FIXME(#44265): "lifetime parameters are not allowed on this type" errors will be addressed in a
//follow-up PR
trait Iterable { trait Iterable {
type Item<'a>; type Item<'a>;
type Iter<'a>: Iterator<Item = Self::Item<'a>>; type Iter<'a>: Iterator<Item = Self::Item<'a>>;
//~^ ERROR undeclared lifetime //~^ ERROR lifetime parameters are not allowed on this type [E0110]
//~| ERROR lifetime parameters are not allowed on this type [E0110]
fn iter<'a>(&'a self) -> Self::Iter<'a>; fn iter<'a>(&'a self) -> Self::Iter<'a>;
//~^ ERROR lifetime parameters are not allowed on this type [E0110] //~^ ERROR lifetime parameters are not allowed on this type [E0110]

View File

@ -1,13 +1,7 @@
error[E0261]: use of undeclared lifetime name `'a`
--> $DIR/iterable.rs:17:47
|
17 | type Iter<'a>: Iterator<Item = Self::Item<'a>>;
| ^^ undeclared lifetime
error[E0110]: lifetime parameters are not allowed on this type error[E0110]: lifetime parameters are not allowed on this type
--> $DIR/iterable.rs:17:47 --> $DIR/iterable.rs:18:47
| |
17 | type Iter<'a>: Iterator<Item = Self::Item<'a>>; 18 | type Iter<'a>: Iterator<Item = Self::Item<'a>>;
| ^^ lifetime parameter not allowed on this type | ^^ lifetime parameter not allowed on this type
error[E0110]: lifetime parameters are not allowed on this type error[E0110]: lifetime parameters are not allowed on this type
@ -16,5 +10,5 @@ error[E0110]: lifetime parameters are not allowed on this type
21 | fn iter<'a>(&'a self) -> Self::Iter<'a>; 21 | fn iter<'a>(&'a self) -> Self::Iter<'a>;
| ^^ lifetime parameter not allowed on this type | ^^ lifetime parameter not allowed on this type
error: aborting due to 3 previous errors error: aborting due to 2 previous errors