-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICE #84727
Comments
This happens on top of too much code for me to take the time to minimalize this issue, sorry. |
Wait! I made it! @JohnTitor 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!();
}
} This issue revolves around L.31. Comment to see the ice go away. Actually, the real fix is to replace L.31 with: <_ as Over<_, Cell<NewFg, NewBg>>>::over(self, bottom.background) Have fun! |
Issue: rust-lang/rust#84727
Minimized with Icemelter, then a bit by hand: struct Cell<Fg, Bg = Fg> {
foreground: Color<Fg>,
background: Color<Bg>,
}
trait Over<Bottom, Output> {
fn over(self) -> Output;
}
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>>,
{
fn over(self) -> Cell<NewFg> {
self.over();
}
}
impl<'b, TopFg, TopBg, BottomFg, BottomBg> Over<&Cell<BottomFg, BottomBg>, ()>
for Cell<TopFg, TopBg>
where
Cell<TopFg, TopBg>: Over<Cell<BottomFg>, Cell<BottomFg>>,
{
fn over(self) -> Cell<NewBg> {
self.over();
}
} |
fixed by #119989. we previously used |
…bilee did I mention that tests are super cool? Fixes rust-lang#81974 Fixes rust-lang#84727 Fixes rust-lang#92979
…bilee did I mention that tests are super cool? Fixes rust-lang#81974 Fixes rust-lang#84727 Fixes rust-lang#92979
Rollup merge of rust-lang#123051 - matthiaskrgr:casetest, r=workingjubilee did I mention that tests are super cool? Fixes rust-lang#81974 Fixes rust-lang#84727 Fixes rust-lang#92979
did I mention that tests are super cool? Fixes rust-lang/rust#81974 Fixes rust-lang/rust#84727 Fixes rust-lang/rust#92979
Code
Meta
rustc --version --verbose
:Same in 1.52.0-nightly, same in 1.51.0.
Error output
RUST_BACKTRACE=1 cargo build
:Backtrace
Good luck!
<3
The text was updated successfully, but these errors were encountered: