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