Skip to content

our folding strategy in check_type_bound is insufficient #116

Open
@compiler-errors

Description

@compiler-errors

rust-lang/rust#125786 folds associated type bounds to replace associated types w/ their concrete types. However, it only does it for identity-substituted associated types, and only for the associated type that we're checking.

This is known to be insufficient, see rust-lang/rust#135246. Fixing this likely relies on proving item-bounds during normalization and also affects the old solver. We will probably only fix this issue after stabilization.


edit: old description

This seems to be sufficient, but I'm somewhat suspicious about things like:

type Assoc<T>: Bound<Self::Assoc<u32>>;
type Assoc: Bound<Self::Other>;
type Other: ...;

We should revisit this strategy and convince ourselves it's sound before stabilization, or else make it more general (which doesn't seem too difficult).

Previous unsoundnesses:

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