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

Add a couple of ICEs #738

Merged
merged 2 commits into from
Apr 30, 2021
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
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!();
}
}