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

Add 5 ICEs #329

Merged
merged 1 commit into from
Apr 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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(()),
};
}