summaryrefslogtreecommitdiffstats
path: root/tests/ui/feature-gates/feature-gate-lifetime-capture-rules-2024.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/feature-gates/feature-gate-lifetime-capture-rules-2024.stderr')
-rw-r--r--tests/ui/feature-gates/feature-gate-lifetime-capture-rules-2024.stderr18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/feature-gates/feature-gate-lifetime-capture-rules-2024.stderr b/tests/ui/feature-gates/feature-gate-lifetime-capture-rules-2024.stderr
new file mode 100644
index 000000000..173e3dc02
--- /dev/null
+++ b/tests/ui/feature-gates/feature-gate-lifetime-capture-rules-2024.stderr
@@ -0,0 +1,18 @@
+error[E0700]: hidden type for `impl Sized` captures lifetime that does not appear in bounds
+ --> $DIR/feature-gate-lifetime-capture-rules-2024.rs:2:5
+ |
+LL | fn foo(x: &Vec<i32>) -> impl Sized {
+ | --------- ---------- opaque type defined here
+ | |
+ | hidden type `&Vec<i32>` captures the anonymous lifetime defined here
+LL | x
+ | ^
+ |
+help: to declare that `impl Sized` captures `'_`, you can add an explicit `'_` lifetime bound
+ |
+LL | fn foo(x: &Vec<i32>) -> impl Sized + '_ {
+ | ++++
+
+error: aborting due to 1 previous error
+
+For more information about this error, try `rustc --explain E0700`.