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

Commit

Permalink
Merge pull request #329 from JohnTitor/add-ices
Browse files Browse the repository at this point in the history
Add 5 ICEs
  • Loading branch information
Alexendoo authored Apr 16, 2020
2 parents a59983c + 5219092 commit 5de8b76
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 0 deletions.
30 changes: 30 additions & 0 deletions ices/71036.rs
Original file line number Diff line number Diff line change
@@ -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>, U: ?Sized> DispatchFromDyn<Inner<'a, U>> 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>, U: ?Sized> DispatchFromDyn<Local<'a, U>> 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() {}
9 changes: 9 additions & 0 deletions ices/71042.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#![feature(impl_trait_in_bindings)]
#![allow(incomplete_features)]

fn main() {
const C: impl Copy = 0;
match C {
C | _ => {}
}
}
14 changes: 14 additions & 0 deletions ices/71113.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
use std::borrow::Cow;

pub enum Recursive<'a>
where
Recursive<'a>: ToOwned<Owned = Box<Recursive<'a>>>,
{
Variant(MyCow<'a, Recursive<'a>>),
}

pub struct Wrapper<T>(T);

pub struct MyCow<'a, T: ToOwned<Owned = Box<T>> + 'a>(Wrapper<Cow<'a, T>>);

fn main() {}
9 changes: 9 additions & 0 deletions ices/71169.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#![feature(const_generics)]
#![allow(incomplete_features)]

fn foo<const LEN: usize, const DATA: [u8; LEN]>() {}

fn main() {
const DATA: [u8; 4] = *b"ABCD";
foo::<4, DATA>();
}
20 changes: 20 additions & 0 deletions ices/71176.rs
Original file line number Diff line number Diff line change
@@ -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<B> {
inner: Box<dyn Provider<A = B>>,
}

fn main() {
Holder {
inner: Box::new(()),
};
}

0 comments on commit 5de8b76

Please sign in to comment.