From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- ...param-closure-outlives-from-where-clause.stderr | 151 +++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr (limited to 'src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr') diff --git a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr new file mode 100644 index 000000000..0261bc39e --- /dev/null +++ b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-where-clause.stderr @@ -0,0 +1,151 @@ +note: external requirements + --> $DIR/ty-param-closure-outlives-from-where-clause.rs:27:26 + | +LL | with_signature(a, b, |x, y| { + | ^^^^^^ + | + = note: defining type: no_region::::{closure#0} with closure substs [ + i32, + extern "rust-call" fn((std::cell::Cell<&'_#1r ()>, 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-outlives-from-where-clause.rs:26:1 + | +LL | / fn no_region<'a, T>(a: Cell<&'a ()>, b: T) { +LL | | with_signature(a, b, |x, y| { +LL | | +LL | | // +... | +LL | | }) +LL | | } + | |_^ + | + = note: defining type: no_region:: + +error[E0309]: the parameter type `T` may not live long enough + --> $DIR/ty-param-closure-outlives-from-where-clause.rs:27:26 + | +LL | with_signature(a, b, |x, y| { + | __________________________^ +LL | | +LL | | // +LL | | // See `correct_region`, which explains the point of this +... | +LL | | require(&x, &y) +LL | | }) + | |_____^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | fn no_region<'a, T: 'a>(a: Cell<&'a ()>, b: T) { + | ++++ + +note: external requirements + --> $DIR/ty-param-closure-outlives-from-where-clause.rs:43:26 + | +LL | with_signature(a, b, |x, y| { + | ^^^^^^ + | + = note: defining type: correct_region::<'_#1r, T>::{closure#0} with closure substs [ + i32, + extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), + (), + ] + = note: number of external vids: 3 + = note: where T: '_#2r + +note: no external requirements + --> $DIR/ty-param-closure-outlives-from-where-clause.rs:39:1 + | +LL | / fn correct_region<'a, T>(a: Cell<&'a ()>, b: T) +LL | | where +LL | | T: 'a, +LL | | { +... | +LL | | }) +LL | | } + | |_^ + | + = note: defining type: correct_region::<'_#1r, T> + +note: external requirements + --> $DIR/ty-param-closure-outlives-from-where-clause.rs:64:26 + | +LL | with_signature(a, b, |x, y| { + | ^^^^^^ + | + = note: defining type: wrong_region::<'_#1r, T>::{closure#0} with closure substs [ + i32, + extern "rust-call" fn((std::cell::Cell<&'_#2r ()>, T)), + (), + ] + = note: late-bound region is '_#3r + = note: number of external vids: 4 + = note: where T: '_#2r + +note: no external requirements + --> $DIR/ty-param-closure-outlives-from-where-clause.rs:60:1 + | +LL | / fn wrong_region<'a, 'b, T>(a: Cell<&'a ()>, b: T) +LL | | where +LL | | T: 'b, +LL | | { +... | +LL | | }) +LL | | } + | |_^ + | + = note: defining type: wrong_region::<'_#1r, T> + +error[E0309]: the parameter type `T` may not live long enough + --> $DIR/ty-param-closure-outlives-from-where-clause.rs:64:26 + | +LL | with_signature(a, b, |x, y| { + | __________________________^ +LL | | +LL | | // See `correct_region` +LL | | require(&x, &y) +LL | | }) + | |_____^ ...so that the type `T` will meet its required lifetime bounds + | +help: consider adding an explicit lifetime bound... + | +LL | T: 'b + 'a, + | ++++ + +note: external requirements + --> $DIR/ty-param-closure-outlives-from-where-clause.rs:77:26 + | +LL | with_signature(a, b, |x, y| { + | ^^^^^^ + | + = note: defining type: outlives_region::<'_#1r, '_#2r, T>::{closure#0} with closure substs [ + i32, + extern "rust-call" fn((std::cell::Cell<&'_#3r ()>, T)), + (), + ] + = note: number of external vids: 4 + = note: where T: '_#3r + +note: no external requirements + --> $DIR/ty-param-closure-outlives-from-where-clause.rs:72:1 + | +LL | / fn outlives_region<'a, 'b, T>(a: Cell<&'a ()>, b: T) +LL | | where +LL | | T: 'b, +LL | | 'b: 'a, +... | +LL | | }) +LL | | } + | |_^ + | + = note: defining type: outlives_region::<'_#1r, '_#2r, T> + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0309`. -- cgit v1.2.3