summaryrefslogtreecommitdiffstats
path: root/tests/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.stderr
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.stderr')
-rw-r--r--tests/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.stderr87
1 files changed, 87 insertions, 0 deletions
diff --git a/tests/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.stderr b/tests/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.stderr
new file mode 100644
index 000000000..86e0f5745
--- /dev/null
+++ b/tests/ui/generic-associated-types/issue-78113-lifetime-mismatch-dyn-trait-box.stderr
@@ -0,0 +1,87 @@
+error: incompatible lifetime on type
+ --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:15:18
+ |
+LL | type T<'a> = Box<dyn A + 'a>;
+ | ^^^^^^^^^^^^^^^
+ |
+note: because this has an unmet lifetime requirement
+ --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:10:17
+ |
+LL | type T<'a>: A;
+ | ^ introduces a `'static` lifetime requirement
+note: the lifetime `'a` as defined here...
+ --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:15:12
+ |
+LL | type T<'a> = Box<dyn A + 'a>;
+ | ^^
+ = note: ...does not necessarily outlive the static lifetime introduced by the compatible `impl`
+note: this has an implicit `'static` lifetime requirement
+ --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:7:20
+ |
+LL | impl A for Box<dyn A> {}
+ | ^
+help: consider relaxing the implicit `'static` requirement
+ |
+LL | impl A for Box<dyn A + '_> {}
+ | ++++
+
+error: incompatible lifetime on type
+ --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:25:18
+ |
+LL | type T<'a> = Box<dyn A + 'a>;
+ | ^^^^^^^^^^^^^^^
+ |
+note: because this has an unmet lifetime requirement
+ --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:21:17
+ |
+LL | type T<'a>: C;
+ | ^ introduces a `'static` lifetime requirement
+note: the lifetime `'a` as defined here...
+ --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:25:12
+ |
+LL | type T<'a> = Box<dyn A + 'a>;
+ | ^^
+note: ...does not necessarily outlive the static lifetime introduced by the compatible `impl`
+ --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:19:1
+ |
+LL | impl C for Box<dyn A + 'static> {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: incompatible lifetime on type
+ --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:35:18
+ |
+LL | type T<'a> = (Box<dyn A + 'a>, Box<dyn A + 'a>);
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+note: because this has an unmet lifetime requirement
+ --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:31:17
+ |
+LL | type T<'a>: E;
+ | ^ introduces a `'static` lifetime requirement
+note: the lifetime `'a` as defined here...
+ --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:35:12
+ |
+LL | type T<'a> = (Box<dyn A + 'a>, Box<dyn A + 'a>);
+ | ^^
+ = note: ...does not necessarily outlive the static lifetime introduced by the compatible `impl`
+note: this has an implicit `'static` lifetime requirement
+ --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:29:21
+ |
+LL | impl E for (Box<dyn A>, Box<dyn A>) {}
+ | ^
+note: this has an implicit `'static` lifetime requirement
+ --> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:29:33
+ |
+LL | impl E for (Box<dyn A>, Box<dyn A>) {}
+ | ^
+help: consider relaxing the implicit `'static` requirement
+ |
+LL | impl E for (Box<dyn A + '_>, Box<dyn A>) {}
+ | ++++
+help: consider relaxing the implicit `'static` requirement
+ |
+LL | impl E for (Box<dyn A>, Box<dyn A + '_>) {}
+ | ++++
+
+error: aborting due to 3 previous errors
+