From a4b7ed7a42c716ab9f05e351f003d589124fd55d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:18:58 +0200 Subject: Adding upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/suggestions/impl-trait-missing-lifetime.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tests/ui/suggestions/impl-trait-missing-lifetime.rs (limited to 'tests/ui/suggestions/impl-trait-missing-lifetime.rs') diff --git a/tests/ui/suggestions/impl-trait-missing-lifetime.rs b/tests/ui/suggestions/impl-trait-missing-lifetime.rs new file mode 100644 index 000000000..6f7c912d7 --- /dev/null +++ b/tests/ui/suggestions/impl-trait-missing-lifetime.rs @@ -0,0 +1,20 @@ +// edition:2021 + +#![feature(anonymous_lifetime_in_impl_trait)] + +// This is understood as `fn foo<'_1>(_: impl Iterator) {}`. +fn f(_: impl Iterator) {} + +// But that lifetime does not participate in resolution. +fn g(mut x: impl Iterator) -> Option<&'_ ()> { x.next() } +//~^ ERROR missing lifetime specifier + +// This is understood as `fn foo<'_1>(_: impl Iterator) {}`. +async fn h(_: impl Iterator) {} + +// But that lifetime does not participate in resolution. +async fn i(mut x: impl Iterator) -> Option<&'_ ()> { x.next() } +//~^ ERROR missing lifetime specifier +//~| ERROR lifetime may not live long enough + +fn main() {} -- cgit v1.2.3