Skip to content

Associated type in constant not normalized correctly #26614

Closed
@eefriedman

Description

@eefriedman
trait Mirror { type It; }
impl<T> Mirror for T { type It = Self; }
fn main() {
    let c : <u32 as Mirror>::It = 5;
    const CCCC : <u32 as Mirror>::It = 5;
}
<anon>:5:40: 5:41 error: mismatched types:
 expected `<u32 as Mirror>::It`,
    found `_`
(expected associated type,
    found integral variable) [E0308]
<anon>:5     const CCCC : <u32 as Mirror>::It = 5;
                                                ^
<anon>:5:40: 5:41 help: see the detailed explanation for E0308
error: aborting due to previous error

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-associated-itemsArea: Associated items (types, constants & functions)E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions