From 5219092ef9e4611b02cbe10cd6af167d947d2eac Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Thu, 16 Apr 2020 06:17:54 +0900 Subject: [PATCH] Add 5 ICEs --- ices/71036.rs | 30 ++++++++++++++++++++++++++++++ ices/71042.rs | 9 +++++++++ ices/71113.rs | 14 ++++++++++++++ ices/71169.rs | 9 +++++++++ ices/71176.rs | 20 ++++++++++++++++++++ 5 files changed, 82 insertions(+) create mode 100644 ices/71036.rs create mode 100644 ices/71042.rs create mode 100644 ices/71113.rs create mode 100644 ices/71169.rs create mode 100644 ices/71176.rs diff --git a/ices/71036.rs b/ices/71036.rs new file mode 100644 index 00000000..8059730e --- /dev/null +++ b/ices/71036.rs @@ -0,0 +1,30 @@ +#![feature(unsize, dispatch_from_dyn)] + +use std::marker::Unsize; +use std::ops::DispatchFromDyn; + +struct Inner<'a, T: ?Sized> { + value: &'a T, +} + +impl<'a, T: ?Sized + Unsize, U: ?Sized> DispatchFromDyn> for Inner<'a, T> {} + +impl<'a, T: ?Sized> Inner<'a, T> { + fn new(value: &'a T) -> Inner<'a, T> { + Inner { value } + } +} + +pub struct Local<'a, T: ?Sized> { + inner: &'a Inner<'a, T>, +} + +impl<'a, T: ?Sized + Unsize, U: ?Sized> DispatchFromDyn> for Local<'a, T> {} + +impl<'a, T: ?Sized> Local<'a, T> { + fn new(inner: &'a Inner<'a, T>) -> Local<'a, T> { + Local { inner } + } +} + +fn main() {} diff --git a/ices/71042.rs b/ices/71042.rs new file mode 100644 index 00000000..6aef5291 --- /dev/null +++ b/ices/71042.rs @@ -0,0 +1,9 @@ +#![feature(impl_trait_in_bindings)] +#![allow(incomplete_features)] + +fn main() { + const C: impl Copy = 0; + match C { + C | _ => {} + } +} diff --git a/ices/71113.rs b/ices/71113.rs new file mode 100644 index 00000000..cf4e5168 --- /dev/null +++ b/ices/71113.rs @@ -0,0 +1,14 @@ +use std::borrow::Cow; + +pub enum Recursive<'a> +where + Recursive<'a>: ToOwned>>, +{ + Variant(MyCow<'a, Recursive<'a>>), +} + +pub struct Wrapper(T); + +pub struct MyCow<'a, T: ToOwned> + 'a>(Wrapper>); + +fn main() {} diff --git a/ices/71169.rs b/ices/71169.rs new file mode 100644 index 00000000..fa346ee8 --- /dev/null +++ b/ices/71169.rs @@ -0,0 +1,9 @@ +#![feature(const_generics)] +#![allow(incomplete_features)] + +fn foo() {} + +fn main() { + const DATA: [u8; 4] = *b"ABCD"; + foo::<4, DATA>(); +} diff --git a/ices/71176.rs b/ices/71176.rs new file mode 100644 index 00000000..b78eff8c --- /dev/null +++ b/ices/71176.rs @@ -0,0 +1,20 @@ +#![allow(dead_code, incomplete_features)] +#![feature(generic_associated_types)] + +trait Provider { + type A<'a>; +} + +impl Provider for () { + type A<'a> = (); +} + +struct Holder { + inner: Box>, +} + +fn main() { + Holder { + inner: Box::new(()), + }; +}