Skip to content

uncertain: local projection cache strenghens inference #215

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

Open
lcnr opened this issue May 21, 2025 · 1 comment
Open

uncertain: local projection cache strenghens inference #215

lcnr opened this issue May 21, 2025 · 1 comment
Labels
from-crater A regression found via a crater run, not part of our test suite minor-breakage known-breakage with minor fallout

Comments

@lcnr
Copy link
Contributor

lcnr commented May 21, 2025

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

@lcnr lcnr added the from-crater A regression found via a crater run, not part of our test suite label May 21, 2025
@lcnr lcnr moved this from unknown to potentially irrelevant in -Znext-solver=globally May 21, 2025
@compiler-errors
Copy link
Member

compiler-errors commented May 21, 2025

probably unsound according to lcnr (edit: lcnr) as the evaluation cache can rely on this, e.g. a candidate W<<W<_> as Trait>::Assoc>: Bound<?unconstrained> can differ from W<<W<_> as Trait>::Assoc>: Bound<?unrelated> without this getting tracked by the cache

@compiler-errors compiler-errors added the minor-breakage known-breakage with minor fallout label May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
from-crater A regression found via a crater run, not part of our test suite minor-breakage known-breakage with minor fallout
Projects
Status: potentially irrelevant
Development

No branches or pull requests

2 participants