]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-20971.rs
point at private fields in struct literal
[rust.git] / src / test / ui / issues / issue-20971.rs
1 // Regression test for Issue #20971.
2
3 // run-fail
4 // error-pattern:Hello, world!
5 // ignore-emscripten no processes
6
7 pub trait Parser {
8     type Input;
9     fn parse(&mut self, input: <Self as Parser>::Input);
10 }
11
12 impl Parser for () {
13     type Input = ();
14     fn parse(&mut self, input: ()) {}
15 }
16
17 pub fn many() -> Box<dyn Parser<Input = <() as Parser>::Input> + 'static> {
18     panic!("Hello, world!")
19 }
20
21 fn main() {
22     many().parse(());
23 }