Add E0107 tests for multiple lifetime params

This commit is contained in:
Omer Sheikh 2016-08-05 22:56:10 +05:00
parent 3575812e44
commit 2061d656e5

View File

@ -9,6 +9,7 @@
// except according to those terms. // except according to those terms.
struct Foo<'a>(&'a str); struct Foo<'a>(&'a str);
struct Buzz<'a, 'b>(&'a str, &'b str);
enum Bar { enum Bar {
A, A,
@ -16,13 +17,19 @@ enum Bar {
C, C,
} }
struct Baz<'a> { struct Baz<'a, 'b, 'c> {
foo: Foo, foo: Foo,
//~^ ERROR E0107 //~^ ERROR E0107
//~| expected 1 lifetime parameter //~| expected 1 lifetime parameter
buzz: Buzz<'a>,
//~^ ERROR E0107
//~| expected 2 lifetime parameters
bar: Bar<'a>, bar: Bar<'a>,
//~^ ERROR E0107 //~^ ERROR E0107
//~| unexpected lifetime parameter //~| unexpected lifetime parameter
foo2: Foo<'a, 'b, 'c>,
//~^ ERROR E0107
//~| 2 unexpected lifetime parameters
} }
fn main() { fn main() {