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.
11 // ignore-tidy-linelength
13 // Various examples of structs whose fields are not well-formed.
20 impl<'a, T> Dummy<'a> for T
25 type RequireOutlives<'a, T> = <T as Dummy<'a>>::Out;
28 Ref1Variant1(RequireOutlives<'a, T>) //~ ERROR the parameter type `T` may not live long enough
33 Ref2Variant2(isize, RequireOutlives<'a, T>), //~ ERROR the parameter type `T` may not live long enough
36 enum RefOk<'a, T:'a> {
40 // This is now well formed. RFC 2093
41 enum RefIndirect<'a, T> {
42 RefIndirectVariant1(isize, RefOk<'a,T>)
45 enum RefDouble<'a, 'b, T> { //~ ERROR 45:1: 48:2: the parameter type `T` may not live long enough [E0309]
46 RefDoubleVariant1(&'a RequireOutlives<'b, T>)
47 //~^ 46:23: 46:49: the parameter type `T` may not live long enough [E0309]