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
437 B
Rust
Raw Normal View History

// Regression test for Issue #20971.
2020-04-16 06:50:32 +00:00
// run-fail
// error-pattern:Hello, world!
2020-05-07 15:39:02 +00: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-27 02:39:36 +00:00
fn parse(&mut self, input: ()) {}
}
2020-04-16 06:50:32 +00:00
pub fn many() -> Box<dyn Parser<Input = <() as Parser>::Input> + 'static> {
panic!("Hello, world!")
}
fn main() {
2016-05-27 02:39:36 +00:00
many().parse(());
}