2015-01-16 14:27:26 -06:00
|
|
|
// Regression test for Issue #20971.
|
|
|
|
|
2020-04-16 01:50:32 -05:00
|
|
|
//@ run-fail
|
2015-01-21 13:35:41 -06:00
|
|
|
//@ error-pattern:Hello, world!
|
2020-05-07 10:39:02 -05:00
|
|
|
//@ ignore-emscripten no processes
|
2015-01-21 13:35:41 -06:00
|
|
|
|
2015-01-16 14:27:26 -06:00
|
|
|
pub trait Parser {
|
|
|
|
type Input;
|
|
|
|
fn parse(&mut self, input: <Self as Parser>::Input);
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Parser for () {
|
|
|
|
type Input = ();
|
2016-05-26 21:39:36 -05:00
|
|
|
fn parse(&mut self, input: ()) {}
|
2015-01-16 14:27:26 -06:00
|
|
|
}
|
|
|
|
|
2020-04-16 01:50:32 -05:00
|
|
|
pub fn many() -> Box<dyn Parser<Input = <() as Parser>::Input> + 'static> {
|
2015-01-21 13:35:41 -06:00
|
|
|
panic!("Hello, world!")
|
2015-01-16 14:27:26 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2016-05-26 21:39:36 -05:00
|
|
|
many().parse(());
|
2015-01-16 14:27:26 -06:00
|
|
|
}
|