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

ices/96395.sh: fixed with no errors #1243

Merged
merged 1 commit into from
May 11, 2022
Merged

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#96395

#!/bin/sh

rustc -Zmir-opt-level=3 - << EOF


#![crate_type = "lib"]

mod convenience_operators {
    use crate::{Op, Relation};
    use std::ops::AddAssign;
    use std::ops::Mul;

    impl<C: Op> Relation<C> {
        pub fn map<F: Fn(C::D) -> D2 + 'static, D2: 'static>(
            self,
            f: F,
        ) -> Relation<impl Op<D = D2, R = C::R>> {
            self.map_dr(move |x, r| (f(x), r))
        }
    }

    impl<K: 'static, V: 'static, C: Op<D = (K, V)>> Relation<C> {
        pub fn semijoin<C2: Op<D = K, R = R2>, R2, R3: AddAssign<R3>>(
            self,
            other: Relation<C2>,
        ) -> Relation<impl Op<D = C::D, R = R3>>
        where
            C::R: Mul<R2, Output = R3>,
        {
            self.join(other.map(|x| (x, ()))).map(|(k, x, ())| (k, x))
        }
    }
}

mod core {
    mod operator {
        mod join {
            use super::Op;
            use crate::core::Relation;
            use std::ops::{AddAssign, Mul};
            struct Join<LC, RC> {
                _left: LC,
                _right: RC,
            }
            impl<
                    LC: Op<D = (K, LD), R = LR>,
                    RC: Op<D = (K, RD), R = RR>,
                    K: 'static,
                    LD: 'static,
                    LR: AddAssign<LR> + Mul<RR, Output = OR>,
                    RD: 'static,
                    RR: AddAssign<RR>,
                    OR: AddAssign<OR>,
                > Op for Join<LC, RC>
            {
                type D = (K, LD, RD);
                type R = OR;
            }
            impl<K: 'static, D: 'static, C: Op<D = (K, D)>> Relation<C> {
                pub fn join<C2: Op<D = (K, D2)>, D2: 'static, OR: AddAssign<OR>>(
                    self,
                    other: Relation<C2>,
                ) -> Relation<impl Op<D = (K, D, D2), R = OR>>
                where
                    C::R: Mul<C2::R, Output = OR>,
                {
                    Relation {
                        inner: Join {
                            _left: self.inner,
                            _right: other.inner,
                        },
                    }
                }
            }
        }
        mod map {
            use super::Op;
            use crate::core::Relation;
            use std::ops::AddAssign;
            struct Map<C, MF> {
                _inner: C,
                _op: MF,
            }
            impl<
                    D1,
                    R1,
                    D2: 'static,
                    R2: AddAssign<R2>,
                    C: Op<D = D1, R = R1>,
                    MF: Fn(D1, R1) -> (D2, R2),
                > Op for Map<C, MF>
            {
                type D = D2;
                type R = R2;
            }
            impl<C: Op> Relation<C> {
                pub fn map_dr<F: Fn(C::D, C::R) -> (D2, R2), D2: 'static, R2: AddAssign<R2>>(
                    self,
                    f: F,
                ) -> Relation<impl Op<D = D2, R = R2>> {
                    Relation {
                        inner: Map {
                            _inner: self.inner,
                            _op: f,
                        },
                    }
                }
            }
        }
        use std::ops::AddAssign;
        pub trait Op {
            type D: 'static;
            type R: AddAssign<Self::R>;
        }
    }
    pub use self::operator::Op;
    #[derive(Clone)]
    pub struct Relation<C> {
        inner: C,
    }
}

use self::core::Op;
pub use self::core::Relation;


EOF


=== stdout ===
=== stderr ===
==============

=== stdout ===
=== stderr ===
==============
@Alexendoo
Copy link
Member

@matthiaskrgr any idea what's going on here? I cannot make sense of this

nightly-2022-05-01 ICE
nightly-2022-05-02 Ok
nightly-2022-05-03 ICE
nightly-2022-05-04 Ok
nightly-2022-05-05 ICE
nightly-2022-05-06 Ok
nightly-2022-05-07 Ok
nightly-2022-05-08 Ok
nightly-2022-05-09 ICE
nightly-2022-05-10 ICE
nightly-2022-05-11 Ok

@JohnTitor
Copy link
Member

Is it actually fixed? Or does glacier report wrongly?

@Alexendoo
Copy link
Member

On the current nightly it doesn't ICE, so glacier is correctly reporting it I would say. But it's flipping between fixed/not fixed on various nightlies so tomorrow who knows

@Alexendoo
Copy link
Member

The Ok/ICE output was from me testing manually, I don't think it's nondeterministic either as I got the same results twice

@JohnTitor
Copy link
Member

Interesting, it's worth reporting it to upstream and maybe adding a regression test quickly 🤔

@JohnTitor
Copy link
Member

Tested on UI tests on rust-lang/rust and yes, it seems fixed.
I'm not sure why but let's add a regression test for now (also pinged a folk being familiar with MIR).

Copy link
Member

@Alexendoo Alexendoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll merge this since it's flaky

@Alexendoo Alexendoo merged commit ec72193 into master May 11, 2022
@Alexendoo Alexendoo deleted the autofix/ices/96395.sh branch May 11, 2022 18:23
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request May 28, 2022
…rrors,oli-obk

Add regression test for rust-lang#96395

Closes rust-lang#96395
This repeats "fixed" and "ICE", see rust-lang/glacier#1243 (comment)
I think it's good to add a test before regressing again.
r? `@compiler-errors` for quick reviiew

cc `@oli-obk` you might want to check as you're familiar with MIR
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request May 28, 2022
…rrors,oli-obk

Add regression test for rust-lang#96395

Closes rust-lang#96395
This repeats "fixed" and "ICE", see rust-lang/glacier#1243 (comment)
I think it's good to add a test before regressing again.
r? ``@compiler-errors`` for quick reviiew

cc ``@oli-obk`` you might want to check as you're familiar with MIR
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants