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 --- .../variance/variance-use-contravariant-struct-1.stderr | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/ui/variance/variance-use-contravariant-struct-1.stderr (limited to 'tests/ui/variance/variance-use-contravariant-struct-1.stderr') diff --git a/tests/ui/variance/variance-use-contravariant-struct-1.stderr b/tests/ui/variance/variance-use-contravariant-struct-1.stderr new file mode 100644 index 000000000..50de7c90f --- /dev/null +++ b/tests/ui/variance/variance-use-contravariant-struct-1.stderr @@ -0,0 +1,15 @@ +error: lifetime may not live long enough + --> $DIR/variance-use-contravariant-struct-1.rs:10:5 + | +LL | fn foo<'min,'max>(v: SomeStruct<&'max ()>) + | ---- ---- lifetime `'max` defined here + | | + | lifetime `'min` defined here +... +LL | v + | ^ function was supposed to return data with lifetime `'max` but it is returning data with lifetime `'min` + | + = help: consider adding the following bound: `'min: 'max` + +error: aborting due to previous error + -- cgit v1.2.3