Skip to content

When the return type of a default trait method returns an associated type (that has a default), there's always a mismatched type error #106968

Closed
@makoConstruct

Description

@makoConstruct

playground

#![feature(
    associated_type_defaults,
)]


pub trait Trait {
    type Res = isize;
    fn f() -> Self::Res {
        2
    }
}

At line of '2': error[E0308]: mismatched types expected associated type, found integer

Metadata

Metadata

Assignees

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler 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