1 // Test that free regions ordering only goes one way. That is,
2 // we have `&'a Node<'b, T>`, which implies that `'a <= 'b`,
3 // but not `'b <= 'a`. Hence, returning `&self.val` (which has lifetime
4 // `'a`) where `'b` is expected yields an error.
6 // This test began its life as a test for issue #4325.
8 struct Node<'b, T: 'b> {
10 next: Option<&'b Node<'b, T>>
13 impl<'b, T> Node<'b, T> {
14 fn get<'a>(&'a self) -> &'b T {
15 match self.next { //~ ERROR lifetime may not live long enough
16 Some(ref next) => next.get(),