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

Commit 498cfa2

Browse files
authored
Add a couple of ICEs (#738)
1 parent 090602d commit 498cfa2

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

ices/84659.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#![allow(incomplete_features)]
2+
#![feature(const_generics)]
3+
4+
trait Bar<const N: usize> {}
5+
6+
trait Foo<'a> {
7+
const N: usize;
8+
type Baz: Bar<{ Self::N }>;
9+
}

ices/84727.rs

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
pub struct Color<T>(pub T);
2+
3+
pub struct Cell<Fg, Bg = Fg> {
4+
foreground: Color<Fg>,
5+
background: Color<Bg>,
6+
}
7+
8+
pub trait Over<Bottom, Output> {
9+
fn over(self, bottom: Bottom) -> Output;
10+
}
11+
12+
// Cell: Over<Color, Cell>
13+
impl<C, Fg, Bg, NewFg, NewBg> Over<Color<C>, Cell<NewFg, NewBg>> for Cell<Fg, Bg>
14+
where
15+
Fg: Over<C, NewFg>,
16+
Bg: Over<C, NewBg>,
17+
{
18+
fn over(self, _: Color<C>) -> Cell<NewFg, NewBg> {
19+
todo!();
20+
}
21+
}
22+
23+
// Cell: Over<Cell, Cell>
24+
impl<TopFg, TopBg, BottomFg, BottomBg, NewFg, NewBg>
25+
Over<Cell<BottomFg, BottomBg>, Cell<NewFg, NewBg>> for Cell<TopFg, TopBg>
26+
where
27+
Self: Over<Color<BottomBg>, Cell<NewFg, NewBg>>,
28+
{
29+
fn over(self, bottom: Cell<BottomFg, BottomBg>) -> Cell<NewFg, NewBg> {
30+
self.over(bottom.background);
31+
todo!();
32+
}
33+
}
34+
35+
// Cell: Over<&mut Cell, ()>
36+
impl<'b, TopFg, TopBg, BottomFg, BottomBg> Over<&'b mut Cell<BottomFg, BottomBg>, ()>
37+
for Cell<TopFg, TopBg>
38+
where
39+
Cell<TopFg, TopBg>: Over<Cell<BottomFg, BottomBg>, Cell<BottomFg, BottomBg>>,
40+
{
41+
fn over(self, _: &'b mut Cell<BottomFg, BottomBg>) {
42+
todo!();
43+
}
44+
}
45+
46+
// &Cell: Over<&mut Cell, ()>
47+
impl<'t, 'b, TopFg, TopBg, BottomFg, BottomBg> Over<&'b mut Cell<BottomFg, BottomBg>, ()>
48+
for &'t Cell<TopFg, TopBg>
49+
where
50+
Cell<TopFg, TopBg>: Over<Cell<BottomFg, BottomBg>, Cell<BottomFg, BottomBg>>,
51+
{
52+
fn over(self, _: &'b mut Cell<BottomFg, BottomBg>) {
53+
todo!();
54+
}
55+
}

0 commit comments

Comments
 (0)