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 --- .../regions-variance-invariant-use-covariant.rs | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 src/test/ui/regions/regions-variance-invariant-use-covariant.rs (limited to 'src/test/ui/regions/regions-variance-invariant-use-covariant.rs') diff --git a/src/test/ui/regions/regions-variance-invariant-use-covariant.rs b/src/test/ui/regions/regions-variance-invariant-use-covariant.rs deleted file mode 100644 index ab6a82ee7..000000000 --- a/src/test/ui/regions/regions-variance-invariant-use-covariant.rs +++ /dev/null @@ -1,21 +0,0 @@ -// Test that a type which is invariant with respect to its region -// parameter used in a covariant way yields an error. -// -// Note: see variance-regions-*.rs for the tests that check that the -// variance inference works in the first place. - -struct Invariant<'a> { - f: &'a mut &'a isize -} - -fn use_<'b>(c: Invariant<'b>) { - - // For this assignment to be legal, Invariant<'b> <: Invariant<'static>. - // Since 'b <= 'static, this would be true if Invariant were covariant - // with respect to its parameter 'a. - - let _: Invariant<'static> = c; - //~^ ERROR lifetime may not live long enough -} - -fn main() { } -- cgit v1.2.3