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

Commit

Permalink
Add a couple of ICEs (#738)
Browse files Browse the repository at this point in the history
  • Loading branch information
fanninpm authored Apr 30, 2021
1 parent 090602d commit 498cfa2
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ices/84659.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#![allow(incomplete_features)]
#![feature(const_generics)]

trait Bar<const N: usize> {}

trait Foo<'a> {
const N: usize;
type Baz: Bar<{ Self::N }>;
}
55 changes: 55 additions & 0 deletions ices/84727.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
pub struct Color<T>(pub T);

pub struct Cell<Fg, Bg = Fg> {
foreground: Color<Fg>,
background: Color<Bg>,
}

pub trait Over<Bottom, Output> {
fn over(self, bottom: Bottom) -> Output;
}

// Cell: Over<Color, Cell>
impl<C, Fg, Bg, NewFg, NewBg> Over<Color<C>, Cell<NewFg, NewBg>> for Cell<Fg, Bg>
where
Fg: Over<C, NewFg>,
Bg: Over<C, NewBg>,
{
fn over(self, _: Color<C>) -> Cell<NewFg, NewBg> {
todo!();
}
}

// Cell: Over<Cell, Cell>
impl<TopFg, TopBg, BottomFg, BottomBg, NewFg, NewBg>
Over<Cell<BottomFg, BottomBg>, Cell<NewFg, NewBg>> for Cell<TopFg, TopBg>
where
Self: Over<Color<BottomBg>, Cell<NewFg, NewBg>>,
{
fn over(self, bottom: Cell<BottomFg, BottomBg>) -> Cell<NewFg, NewBg> {
self.over(bottom.background);
todo!();
}
}

// Cell: Over<&mut Cell, ()>
impl<'b, TopFg, TopBg, BottomFg, BottomBg> Over<&'b mut Cell<BottomFg, BottomBg>, ()>
for Cell<TopFg, TopBg>
where
Cell<TopFg, TopBg>: Over<Cell<BottomFg, BottomBg>, Cell<BottomFg, BottomBg>>,
{
fn over(self, _: &'b mut Cell<BottomFg, BottomBg>) {
todo!();
}
}

// &Cell: Over<&mut Cell, ()>
impl<'t, 'b, TopFg, TopBg, BottomFg, BottomBg> Over<&'b mut Cell<BottomFg, BottomBg>, ()>
for &'t Cell<TopFg, TopBg>
where
Cell<TopFg, TopBg>: Over<Cell<BottomFg, BottomBg>, Cell<BottomFg, BottomBg>>,
{
fn over(self, _: &'b mut Cell<BottomFg, BottomBg>) {
todo!();
}
}

0 comments on commit 498cfa2

Please sign in to comment.