mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
24 lines
440 B
Rust
24 lines
440 B
Rust
// Regression test for Issue #20971.
|
|
|
|
//@ run-fail
|
|
//@ error-pattern:Hello, world!
|
|
//@ ignore-emscripten no processes
|
|
|
|
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(());
|
|
}
|