Skip to content

Bogus associated type in associated type bound compiles #21259

Closed
@bluss

Description

@bluss

This compiles successfully, but it should error. Self is not Clone, and Noexist doesn't exist.

trait Visitor {
    type Iter: PartialEq<<Self as Clone>::Noexist>;
}

This gives an ICE:

trait Visitor {
    type Iter: PartialEq<Self::Noexist>;
}
thread 'rustc' panicked at 'assertion failed: did.krate != ast::LOCAL_CRATE', /build/rust-git/src/rust/src/librustc/middle/ty.rs:5408

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-associated-itemsArea: Associated items (types, constants & functions)E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.P-mediumMedium priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions