summaryrefslogtreecommitdiffstats
path: root/src/test/ui/regions/type-param-outlives-reempty-issue-74429-2.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/regions/type-param-outlives-reempty-issue-74429-2.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/regions/type-param-outlives-reempty-issue-74429-2.rs')
-rw-r--r--src/test/ui/regions/type-param-outlives-reempty-issue-74429-2.rs66
1 files changed, 0 insertions, 66 deletions
diff --git a/src/test/ui/regions/type-param-outlives-reempty-issue-74429-2.rs b/src/test/ui/regions/type-param-outlives-reempty-issue-74429-2.rs
deleted file mode 100644
index a65c17e0e..000000000
--- a/src/test/ui/regions/type-param-outlives-reempty-issue-74429-2.rs
+++ /dev/null
@@ -1,66 +0,0 @@
-// Regression test for #74429, where we didn't think that a type parameter
-// outlived `ReEmpty`.
-
-// check-pass
-
-use std::marker::PhantomData;
-use std::ptr::NonNull;
-
-pub unsafe trait RawData {
- type Elem;
-}
-
-unsafe impl<A> RawData for OwnedRepr<A> {
- type Elem = A;
-}
-
-unsafe impl<'a, A> RawData for ViewRepr<&'a A> {
- type Elem = A;
-}
-
-pub struct OwnedRepr<A> {
- ptr: PhantomData<A>,
-}
-
-// these Copy impls are not necessary for the repro, but allow the code to compile without error
-// on 1.44.1
-#[derive(Copy, Clone)]
-pub struct ViewRepr<A> {
- life: PhantomData<A>,
-}
-
-#[derive(Copy, Clone)]
-pub struct ArrayBase<S>
-where
- S: RawData,
-{
- ptr: NonNull<S::Elem>,
-}
-
-pub type Array<A> = ArrayBase<OwnedRepr<A>>;
-
-pub type ArrayView<'a, A> = ArrayBase<ViewRepr<&'a A>>;
-
-impl<A, S> ArrayBase<S>
-where
- S: RawData<Elem = A>,
-{
- pub fn index_axis(&self) -> ArrayView<'_, A> {
- unimplemented!()
- }
-
- pub fn axis_iter<'a>(&'a self) -> std::iter::Empty<&'a A> {
- unimplemented!()
- }
-}
-
-pub fn x<T: Copy>(a: Array<T>) {
- // drop just avoids a must_use warning
- drop((0..1).filter(|_| true));
- let y = a.index_axis();
- a.axis_iter().for_each(|_| {
- drop(y);
- });
-}
-
-fn main() {}