Skip to content

eagerly normalizing the param_env triggers impl shadowing in unavoidable ways #219

@lcnr

Description

@lcnr
trait Trait {
    type Assoc<V>;
    fn foo<V>()
    where
        Self::Assoc<V>: Trait;
}

impl<T> Trait for T {
    type Assoc<V> = T;
    fn foo<V>() {}
}

fn main() {}

This triggers #89 if we eagerly normalize ParamEnvs.

In compare_method_predicate_entailment for foo we use the hybrid env [<T as Trait>::Assoc<V>: Trait, V: Sized, T: Sized]. Normalizing <T as Trait>::Assoc<V> then encounters the exact issue from #89.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions