gcc/testsuite/rust/compile/issue-2039.rs
raw| 1 | // { dg-options "-w" } |
| 2 | pub struct Lexer<'a> { |
| 3 | input: &'a str, |
| 4 | } |
| 5 | |
| 6 | impl<'a> Lexer<'a> { |
| 7 | pub fn new(input: &'a str) -> Lexer<'a> { |
| 8 | Lexer { input: input } |
| 9 | } |
| 10 | } |
| 11 | |
| 12 | struct Parser<'a> { |
| 13 | lexer: &'a mut Lexer<'a>, |
| 14 | } |
| 15 | |
| 16 | impl<'a> Parser<'a> { |
| 17 | pub fn new(lexer: &'a mut Lexer) -> Parser<'a> { |
| 18 | Parser { lexer: lexer } |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | fn main() {} |