rust/src/test/run-fail/issue-20971.rs

22 lines
387 B
Rust
Raw Normal View History

// 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 = ();
2016-05-27 02:39:36 +00:00
fn parse(&mut self, input: ()) {}
}
2016-05-27 02:39:36 +00:00
pub fn many() -> Box<Parser<Input = <() as Parser>::Input> + 'static> {
panic!("Hello, world!")
}
fn main() {
2016-05-27 02:39:36 +00:00
many().parse(());
}