We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 82f1f50 commit 0696c28Copy full SHA for 0696c28
src/test/ui/lifetimes/issue-77175.rs
@@ -0,0 +1,19 @@
1
+#[deny(single_use_lifetimes)]
2
+// edition:2018
3
+// check-pass
4
+
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 {
12
+ s3
13
+}
14
15
+fn foo<'a>(s1: String, s2: &'_ str, s3: &'a str) -> &'a str {
16
17
18
19
+fn main() {}
0 commit comments