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