Skip to content

uncertain: local projection cache strenghens inference #215

Open
@lcnr

Description

@lcnr

https://crater-reports.s3.amazonaws.com/pr-133502-13/try%233cddd79d4be3c8f1e937d09ca618d192abc69373/reg/uncertain-0.3.1/log.txt

trait Trait {
    type Assoc;
}

struct W<T>(T);
impl<T: Trait> Trait for W<T> {
    type Assoc = T::Assoc;
}

impl Trait for () {
    type Assoc = f32;
}


fn foo<T: Trait>(arg: T, x: T::Assoc) -> T::Assoc {
    x
}

fn main() {
    let w = W(Default::default());
    foo(w, 1f32).abs();
    let _: W<()> = w;
}

we store <W<_> as Trait>::Assoc => ?unconstrained in the projection cache and reuse ?unconstrained for both the input and output. We only do so as normalizing <W<_> as Trait>::Assoc actually made some progress

Metadata

Metadata

Assignees

No one assigned

    Labels

    from-craterA regression found via a crater run, not part of our test suiteminor-breakageknown-breakage with minor fallout

    Type

    No type

    Projects

    Status

    potentially irrelevant

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions