Skip to content

old solver keeps goals stalled even if their infer vars change #158441

Description

@lcnr
struct Inv<T>(Option<*mut T>);

trait Trait<T, U, V> {}

impl Trait<u32, u32, u32> for () {}
impl Trait<u32, i32, i32> for () {}
fn is_trait<T, U, V>(x: Inv<T>, y: Inv<U>) -> V
where
    (): Trait<T, U, V>,
{
    todo!()
}

fn main() {
    let x = Inv(None);
    let mut y = Inv(None);
    let res = is_trait(x, y);
    y = x;
    res.bit_width();
}

https://rust.godbolt.org/z/r811s4Wra

equating ?t and ?u should get us to reprove (): Trait<?t, ?u, ?v> at which point the second impl is no longer applicable

cc @jdonszelmann

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions