Skip to content

Inherent associated type projection does not respect where clauses #104251

Closed
@compiler-errors

Description

@compiler-errors

I tried this code:

#![feature(inherent_associated_types)]

struct Foo<T: ?Sized>(T);

impl<T> Foo<T> {
    type Bar = i32;
}

fn main() {
    let x: Foo<[u8]>::Bar = 1;
}

I expected to see it fail, since while Foo<[u8]> is WF, it does not satisfy the where-clauses of the impl that it's selecting the associated type Bar from.

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.F-inherent_associated_types`#![feature(inherent_associated_types)]`requires-nightlyThis issue requires a nightly compiler in some way.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions