summaryrefslogtreecommitdiffstats
path: root/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr')
-rw-r--r--src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr65
1 files changed, 65 insertions, 0 deletions
diff --git a/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr b/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr
new file mode 100644
index 000000000..12c76d198
--- /dev/null
+++ b/src/test/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr
@@ -0,0 +1,65 @@
+note: external requirements
+ --> $DIR/ty-param-closure-approximate-lower-bound.rs:24:24
+ |
+LL | twice(cell, value, |a, b| invoke(a, b));
+ | ^^^^^^
+ |
+ = note: defining type: generic::<T>::{closure#0} with closure substs [
+ i16,
+ for<'r, 's> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) ()>>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) T)),
+ (),
+ ]
+ = note: number of external vids: 2
+ = note: where T: '_#1r
+
+note: no external requirements
+ --> $DIR/ty-param-closure-approximate-lower-bound.rs:22:1
+ |
+LL | / fn generic<T>(value: T) {
+LL | | let cell = Cell::new(&());
+LL | | twice(cell, value, |a, b| invoke(a, b));
+LL | | }
+ | |_^
+ |
+ = note: defining type: generic::<T>
+
+note: external requirements
+ --> $DIR/ty-param-closure-approximate-lower-bound.rs:29:24
+ |
+LL | twice(cell, value, |a, b| invoke(a, b));
+ | ^^^^^^
+ |
+ = note: defining type: generic_fail::<T>::{closure#0} with closure substs [
+ i16,
+ for<'r, 's> extern "rust-call" fn((std::option::Option<std::cell::Cell<&'_#1r &ReLateBound(DebruijnIndex(0), BoundRegion { var: 0, kind: BrNamed('r) }) ()>>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrNamed('s) }) T)),
+ (),
+ ]
+ = note: late-bound region is '_#2r
+ = note: number of external vids: 3
+ = note: where T: '_#1r
+
+note: no external requirements
+ --> $DIR/ty-param-closure-approximate-lower-bound.rs:28:1
+ |
+LL | / fn generic_fail<'a, T>(cell: Cell<&'a ()>, value: T) {
+LL | | twice(cell, value, |a, b| invoke(a, b));
+LL | |
+LL | | }
+ | |_^
+ |
+ = note: defining type: generic_fail::<T>
+
+error[E0309]: the parameter type `T` may not live long enough
+ --> $DIR/ty-param-closure-approximate-lower-bound.rs:29:24
+ |
+LL | twice(cell, value, |a, b| invoke(a, b));
+ | ^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
+ |
+help: consider adding an explicit lifetime bound...
+ |
+LL | fn generic_fail<'a, T: 'a>(cell: Cell<&'a ()>, value: T) {
+ | ++++
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0309`.