]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-52057.rs
Auto merge of #54720 - davidtwco:issue-51191, r=nikomatsakis
[rust.git] / src / test / ui / issues / issue-52057.rs
1 // Copyright 2016 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.
4 //
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.
10
11 // Regression test for #52057. There is an implied bound
12 // that `I: 'a` where `'a` is the lifetime of `self` in `parse_first`;
13 // but to observe that, one must normalize first.
14 //
15 // run-pass
16
17 #![feature(nll)]
18
19 pub trait Parser {
20     type Input;
21
22     #[inline(always)]
23     fn parse_first(input: &mut Self::Input);
24 }
25
26 impl<'a, I, P: ?Sized> Parser for &'a mut P
27 where
28     P: Parser<Input = I>,
29 {
30     type Input = I;
31
32     fn parse_first(_: &mut Self::Input) {}
33 }
34
35 fn main() {}