]> git.proxmox.com Git - rustc.git/blame - src/test/ui/issues/issue-20971.rs
New upstream version 1.49.0+dfsg1
[rustc.git] / src / test / ui / issues / issue-20971.rs
CommitLineData
85aaf69f 1// Regression test for Issue #20971.
223e47cc 2
72b1a166 3// run-fail
85aaf69f 4// error-pattern:Hello, world!
72b1a166 5// ignore-emscripten no processes
85aaf69f
SL
6
7pub trait Parser {
8 type Input;
9 fn parse(&mut self, input: <Self as Parser>::Input);
10}
11
12impl Parser for () {
13 type Input = ();
3157f602 14 fn parse(&mut self, input: ()) {}
85aaf69f
SL
15}
16
72b1a166 17pub fn many() -> Box<dyn Parser<Input = <() as Parser>::Input> + 'static> {
85aaf69f
SL
18 panic!("Hello, world!")
19}
223e47cc 20
85aaf69f 21fn main() {
3157f602 22 many().parse(());
223e47cc 23}