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.
12 fn list_name() -> &'a str;
15 trait Collection { fn len(&self) -> usize; }
17 // is now well formed. RFC 2093
18 struct List<'a, T: ListItem<'a>> {
22 impl<'a, T: ListItem<'a>> Collection for List<'a, T> {
23 fn len(&self) -> usize {
30 //~^ ERROR may not live long enough
34 fn foo<'a, L: X<&'a Nested<K>>>();
35 //~^ ERROR may not live long enough
37 // check that we give a sane error for `Self`
38 fn bar<'a, L: X<&'a Nested<Self>>>();
39 //~^ ERROR may not live long enough
41 // check that we give a sane error for nested generics
42 fn baz<'a, L, M: X<&'a Nested<L>>>() {
43 //~^ ERROR may not live long enough
51 fn generic_in_parent<'a, L: X<&'a Nested<K>>>() {
52 //~^ ERROR may not live long enough
54 fn generic_in_child<'a, 'b, L: X<&'a Nested<M>>, M: 'b>() {
55 //~^ ERROR may not live long enough