about summary refs log tree commit diff
path: root/tests/ui/issues/issue-20971.rs
blob: 31dd9101919357e7cdc6db07d6fb74ab1b1c061b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Regression test for Issue #20971.

//@ run-fail
//@ error-pattern:Hello, world!
//@ needs-subprocess

pub trait Parser {
    type Input;
    fn parse(&mut self, input: <Self as Parser>::Input);
}

impl Parser for () {
    type Input = ();
    fn parse(&mut self, input: ()) {}
}

pub fn many() -> Box<dyn Parser<Input = <() as Parser>::Input> + 'static> {
    panic!("Hello, world!")
}

fn main() {
    many().parse(());
}