rust/tests/ui/issues/issue-20971.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
440 B
Rust
Raw Normal View History

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