Skip to content

u is not a type, but is reported as if it were in mismatched types message #13359

Closed
@pnkfelix

Description

@pnkfelix

Here is a bad message I got from some code today:

/tmp/t.rs:4:9: 4:22 error: mismatched types: expected `u32` but found `uint` (expected `u32` but found `u`)
/tmp/t.rs:4     foo(1*(1 as uint));
                    ^~~~~~~~~~~~~
error: aborting due to previous error

Note the strange parenthetical: "(expected u32 but found u)"

Source code to reproduce:

fn foo(_s: u32) { }

fn main() {
    foo(1*(1 as uint));
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions