rust/src/test/run-fail/issue-20971.rs
2018-12-25 21:08:33 -07:00

21 lines
387 B
Rust

// Regression test for Issue #20971.
// error-pattern:Hello, world!
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<Parser<Input = <() as Parser>::Input> + 'static> {
panic!("Hello, world!")
}
fn main() {
many().parse(());
}