Skip to content

Report error on inherent associated types (for now) #20359

Closed
@huonw

Description

@huonw
#![feature(associated_types)]

struct Foo;
impl Foo { type Bar = int; }

fn main() {
    let _: Foo::Bar = 1;
}
<anon>:7:12: 7:20 error: ambiguous associated type; specify the type using the syntax `<Type as Foo>::Bar`
<anon>:7     let _: Foo::Bar = 1;
                    ^~~~~~~~

AFAICT, there's no way to use the <... as ...> syntax with inherent associated items (or any plans for it) so the suggestion is entirely unhelpful.

Metadata

Metadata

Assignees

Labels

A-associated-itemsArea: Associated items (types, constants & functions)

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions