diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:13 +0000 |
commit | 218caa410aa38c29984be31a5229b9fa717560ee (patch) | |
tree | c54bd55eeb6e4c508940a30e94c0032fbd45d677 /src/test/ui/type-alias-impl-trait/issue-65918.rs | |
parent | Releasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-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/type-alias-impl-trait/issue-65918.rs')
-rw-r--r-- | src/test/ui/type-alias-impl-trait/issue-65918.rs | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/src/test/ui/type-alias-impl-trait/issue-65918.rs b/src/test/ui/type-alias-impl-trait/issue-65918.rs deleted file mode 100644 index af6d50109..000000000 --- a/src/test/ui/type-alias-impl-trait/issue-65918.rs +++ /dev/null @@ -1,51 +0,0 @@ -// ignore-test: This now ICEs again. - -// build-pass - -#![feature(type_alias_impl_trait)] - -use std::marker::PhantomData; - -/* copied Index and TryFrom for convenience (and simplicity) */ -trait MyIndex<T> { - type O; - fn my_index(self) -> Self::O; -} -trait MyFrom<T>: Sized { - type Error; - fn my_from(value: T) -> Result<Self, Self::Error>; -} - -/* MCVE starts here */ -trait F {} -impl F for () {} -type DummyT<T> = impl F; -fn _dummy_t<T>() -> DummyT<T> {} - -struct Phantom1<T>(PhantomData<T>); -struct Phantom2<T>(PhantomData<T>); -struct Scope<T>(Phantom2<DummyT<T>>); - -impl<T> Scope<T> { - fn new() -> Self { - unimplemented!() - } -} - -impl<T> MyFrom<Phantom2<T>> for Phantom1<T> { - type Error = (); - fn my_from(_: Phantom2<T>) -> Result<Self, Self::Error> { - unimplemented!() - } -} - -impl<T: MyFrom<Phantom2<DummyT<U>>>, U> MyIndex<Phantom1<T>> for Scope<U> { - type O = T; - fn my_index(self) -> Self::O { - MyFrom::my_from(self.0).ok().unwrap() - } -} - -fn main() { - let _pos: Phantom1<DummyT<()>> = Scope::new().my_index(); -} |