Skip to content

caw_core regression #178

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

Closed
compiler-errors opened this issue Apr 18, 2025 · 1 comment
Closed

caw_core regression #178

compiler-errors opened this issue Apr 18, 2025 · 1 comment

Comments

@compiler-errors
Copy link
Member

https://crater-reports.s3.amazonaws.com/pr-133502-2/try%23da0a4799770027c4c578bf48cdb390acfde09023/reg/caw_core-0.5.0/log.txt

use std::ops::Add;

pub(crate) trait SigT {
    type Item: Clone;
}
#[derive(Clone)]
pub(crate) struct Sig<S>(S)
where
    S: SigT;

pub(crate) struct OpScalarSig<L, R>
where
    L: Clone,
    R: SigT,
    L: Add<R::Item>,
    <L as Add<R::Item>>::Output: Clone,
{
    l: L,
    r: R,
}

impl<L, R> SigT for OpScalarSig<L, R>
where
    L: Clone,
    R: SigT,
    L: Add<R::Item>,
    <L as Add<R::Item>>::Output: Clone,
{
    type Item = <L as Add<R::Item>>::Output;
}

impl<S> Add<Sig<S>> for f32
where
    S: SigT<Item = f32>,
    f32: Add<S::Item>,
{
    type Output = Sig<OpScalarSig<f32, S>>;

    fn add(self, rhs: Sig<S>) -> Self::Output {
        loop {}
    }
}
@compiler-errors
Copy link
Member Author

Duplicate of #179 actually now that I think of it. f32: Add<S::Item> forces <f32 as Add>::Output to be rigid, so we don't see that <f32 as Add>::Output: Clone holds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant