Skip to content

Associated type bounds can be used to prove themselves with trivial where-clauses #62

Closed
@compiler-errors

Description

@compiler-errors
trait Foo {
    type Assoc: Bar
        where Self: Foo;
}

trait Bar {}

impl Foo for () {
    type Assoc = ()
        where Self: Foo;
}

This side-steps the check that associated type bounds may only be used if we have a param-env predicate that "roots" the associated type. See the doc comment on validate_alias_bound_self_from_param_env.

Turns out this is not a complete solution.

Metadata

Metadata

Assignees

No one assigned

    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