Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.

Commit 5de8b76

Browse files
authored
Merge pull request #329 from JohnTitor/add-ices
Add 5 ICEs
2 parents a59983c + 5219092 commit 5de8b76

File tree

5 files changed

+82
-0
lines changed

5 files changed

+82
-0
lines changed

ices/71036.rs

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#![feature(unsize, dispatch_from_dyn)]
2+
3+
use std::marker::Unsize;
4+
use std::ops::DispatchFromDyn;
5+
6+
struct Inner<'a, T: ?Sized> {
7+
value: &'a T,
8+
}
9+
10+
impl<'a, T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Inner<'a, U>> for Inner<'a, T> {}
11+
12+
impl<'a, T: ?Sized> Inner<'a, T> {
13+
fn new(value: &'a T) -> Inner<'a, T> {
14+
Inner { value }
15+
}
16+
}
17+
18+
pub struct Local<'a, T: ?Sized> {
19+
inner: &'a Inner<'a, T>,
20+
}
21+
22+
impl<'a, T: ?Sized + Unsize<U>, U: ?Sized> DispatchFromDyn<Local<'a, U>> for Local<'a, T> {}
23+
24+
impl<'a, T: ?Sized> Local<'a, T> {
25+
fn new(inner: &'a Inner<'a, T>) -> Local<'a, T> {
26+
Local { inner }
27+
}
28+
}
29+
30+
fn main() {}

ices/71042.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#![feature(impl_trait_in_bindings)]
2+
#![allow(incomplete_features)]
3+
4+
fn main() {
5+
const C: impl Copy = 0;
6+
match C {
7+
C | _ => {}
8+
}
9+
}

ices/71113.rs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
use std::borrow::Cow;
2+
3+
pub enum Recursive<'a>
4+
where
5+
Recursive<'a>: ToOwned<Owned = Box<Recursive<'a>>>,
6+
{
7+
Variant(MyCow<'a, Recursive<'a>>),
8+
}
9+
10+
pub struct Wrapper<T>(T);
11+
12+
pub struct MyCow<'a, T: ToOwned<Owned = Box<T>> + 'a>(Wrapper<Cow<'a, T>>);
13+
14+
fn main() {}

ices/71169.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#![feature(const_generics)]
2+
#![allow(incomplete_features)]
3+
4+
fn foo<const LEN: usize, const DATA: [u8; LEN]>() {}
5+
6+
fn main() {
7+
const DATA: [u8; 4] = *b"ABCD";
8+
foo::<4, DATA>();
9+
}

ices/71176.rs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#![allow(dead_code, incomplete_features)]
2+
#![feature(generic_associated_types)]
3+
4+
trait Provider {
5+
type A<'a>;
6+
}
7+
8+
impl Provider for () {
9+
type A<'a> = ();
10+
}
11+
12+
struct Holder<B> {
13+
inner: Box<dyn Provider<A = B>>,
14+
}
15+
16+
fn main() {
17+
Holder {
18+
inner: Box::new(()),
19+
};
20+
}

0 commit comments

Comments
 (0)