Skip to content

'Mismatched type' error doesn't use aliased type names #25694

Closed
@kornelski

Description

@kornelski
Contributor
type mytype = f32;

fn main() {
    let foo: mytype = 1usize;
}

fails with:

expected f32,
found usize

but I'd expect it to say something along the lines:

expected mytype (f32)
found usize

(The problem has been mentioned in comments of #3417)

Activity

ebfull

ebfull commented on Nov 9, 2015

@ebfull
Contributor

Associated types act as type synonyms in the same sense, and it would be nice if error message included those where applicable as well.

added
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
on Mar 9, 2017
Mark-Simulacrum

Mark-Simulacrum commented on May 31, 2017

@Mark-Simulacrum
Member

Closing in favor of #17164.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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

        Participants

        @steveklabnik@kornelski@Aatch@ebfull@Mark-Simulacrum

        Issue actions

          'Mismatched type' error doesn't use aliased type names · Issue #25694 · rust-lang/rust