From 64d98f8ee037282c35007b64c2649055c56af1db Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:03 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/issues/issue-20971.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/ui/issues/issue-20971.rs (limited to 'tests/ui/issues/issue-20971.rs') diff --git a/tests/ui/issues/issue-20971.rs b/tests/ui/issues/issue-20971.rs new file mode 100644 index 000000000..2e1041817 --- /dev/null +++ b/tests/ui/issues/issue-20971.rs @@ -0,0 +1,23 @@ +// 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: ::Input); +} + +impl Parser for () { + type Input = (); + fn parse(&mut self, input: ()) {} +} + +pub fn many() -> Box::Input> + 'static> { + panic!("Hello, world!") +} + +fn main() { + many().parse(()); +} -- cgit v1.2.3