]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/lifetimes/issue-77175.rs
1 #[deny(single_use_lifetimes)]
5 // Prior to the fix, the compiler complained that the 'a lifetime was only used
6 // once. This was obviously wrong since the lifetime is used twice: For the s3
7 // parameter and the return type. The issue was caused by the compiler
8 // desugaring the async function into a generator that uses only a single
9 // lifetime, which then the validator complained about becauase of the
10 // single_use_lifetimes constraints.
11 async
fn bar
<'a
>(s1
: String
, s2
: &'_
str, s3
: &'a
str) -> &'a
str {
15 fn foo
<'a
>(s1
: String
, s2
: &'_
str, s3
: &'a
str) -> &'a
str {