summaryrefslogtreecommitdiffstats
path: root/src/test/ui/impl-trait/multiple-lifetimes/error-handling.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/impl-trait/multiple-lifetimes/error-handling.rs
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/impl-trait/multiple-lifetimes/error-handling.rs')
-rw-r--r--src/test/ui/impl-trait/multiple-lifetimes/error-handling.rs26
1 files changed, 0 insertions, 26 deletions
diff --git a/src/test/ui/impl-trait/multiple-lifetimes/error-handling.rs b/src/test/ui/impl-trait/multiple-lifetimes/error-handling.rs
deleted file mode 100644
index 367e7f4e6..000000000
--- a/src/test/ui/impl-trait/multiple-lifetimes/error-handling.rs
+++ /dev/null
@@ -1,26 +0,0 @@
-#![feature(type_alias_impl_trait)]
-
-#[derive(Clone)]
-struct CopyIfEq<T, U>(T, U);
-
-impl<T: Copy> Copy for CopyIfEq<T, T> {}
-
-type E<'a, 'b> = impl Sized;
-
-fn foo<'a, 'b, 'c>(x: &'static i32, mut y: &'a i32) -> E<'b, 'c> {
- let v = CopyIfEq::<*mut _, *mut _>(&mut { x }, &mut y);
-
- // This assignment requires that `x` and `y` have the same type due to the
- // `Copy` impl. The reason why we are using a copy to create a constraint
- // is that only borrow checking (not regionck in type checking) enforces
- // this bound.
- let u = v;
- let _: *mut &'a i32 = u.1;
- unsafe {
- let _: &'b i32 = *u.0;
- //~^ ERROR lifetime may not live long enough
- }
- u.0
-}
-
-fn main() {}