From 64d98f8ee037282c35007b64c2649055c56af1db Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:03 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- ...ty-param-closure-approximate-lower-bound.stderr | 59 ++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 tests/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr (limited to 'tests/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr') diff --git a/tests/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr b/tests/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr new file mode 100644 index 000000000..a442cf12d --- /dev/null +++ b/tests/ui/nll/ty-outlives/ty-param-closure-approximate-lower-bound.stderr @@ -0,0 +1,59 @@ +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::::{closure#0} with closure substs [ + i16, + for extern "rust-call" fn((std::option::Option>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) 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(value: T) { + | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: defining type: generic:: + +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::::{closure#0} with closure substs [ + i16, + for extern "rust-call" fn((std::option::Option>, &ReLateBound(DebruijnIndex(0), BoundRegion { var: 1, kind: BrAnon(1, None) }) 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) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: defining type: generic_fail:: + +error[E0309]: the parameter type `T` may not live long enough + --> $DIR/ty-param-closure-approximate-lower-bound.rs:29:31 + | +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`. -- cgit v1.2.3