Skip to content

inherent assoc tys resolve with subtyping not equality #109789

Closed
@BoxyUwU

Description

@BoxyUwU

I tried this code:

#![feature(inherent_associated_types)]

struct Foo<T>(T);

impl Foo<fn(&'static ())> {
    type Assoc = u32;
}

trait Other {}
impl Other for u32 {}

fn bar(_: Foo<for<'a> fn(&'a ())>::Assoc) {}

I expected to see this happen: It not to compile as Foo<for<'a> fn(&'a ())> has no inherent impl defined on it

Instead, this happened: it compiled

Meta

playground's nightly:

Build using the Nightly version: 1.70.0-nightly
(2023-03-29 17c11672167827b0dd92)

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.F-inherent_associated_types`#![feature(inherent_associated_types)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-typesRelevant to the types team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions