summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/alias-liveness/rpit-hidden-erased-unsoundness.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/impl-trait/alias-liveness/rpit-hidden-erased-unsoundness.stderr')
-rw-r--r--tests/ui/impl-trait/alias-liveness/rpit-hidden-erased-unsoundness.stderr18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/alias-liveness/rpit-hidden-erased-unsoundness.stderr b/tests/ui/impl-trait/alias-liveness/rpit-hidden-erased-unsoundness.stderr
new file mode 100644
index 000000000..168a5aa18
--- /dev/null
+++ b/tests/ui/impl-trait/alias-liveness/rpit-hidden-erased-unsoundness.stderr
@@ -0,0 +1,18 @@
+error[E0700]: hidden type for `impl Sized + 'a` captures lifetime that does not appear in bounds
+ --> $DIR/rpit-hidden-erased-unsoundness.rs:16:5
+ |
+LL | fn step2<'a, 'b: 'a>() -> impl Sized + 'a {
+ | -- --------------- opaque type defined here
+ | |
+ | hidden type `impl Captures<'b> + 'a` captures the lifetime `'b` as defined here
+LL | step1::<'a, 'b>()
+ | ^^^^^^^^^^^^^^^^^
+ |
+help: to declare that `impl Sized + 'a` captures `'b`, you can add an explicit `'b` lifetime bound
+ |
+LL | fn step2<'a, 'b: 'a>() -> impl Sized + 'a + 'b {
+ | ++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0700`.