diff options
Diffstat (limited to 'tests/ui/numeric/numeric-suffix')
21 files changed, 4163 insertions, 0 deletions
diff --git a/tests/ui/numeric/numeric-suffix/numeric-suffix-i32.fixed b/tests/ui/numeric/numeric-suffix/numeric-suffix-i32.fixed new file mode 100644 index 000000000..6e8c54df4 --- /dev/null +++ b/tests/ui/numeric/numeric-suffix/numeric-suffix-i32.fixed @@ -0,0 +1,73 @@ +// run-rustfix + +fn foo<N>(_x: N) {} +//~^ NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE + +fn main() { + foo::<i32>(42_i32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i32>(42_i32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i32>(42_i32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i32>(42_i32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i32>(42_i32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i32>(42_i32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i32>(42_i32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i32>(42_i32); + foo::<i32>(42_i32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i32>(42_i32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i32>(42i32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i32>(42i32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments +} diff --git a/tests/ui/numeric/numeric-suffix/numeric-suffix-i32.rs b/tests/ui/numeric/numeric-suffix/numeric-suffix-i32.rs new file mode 100644 index 000000000..b47b0ed02 --- /dev/null +++ b/tests/ui/numeric/numeric-suffix/numeric-suffix-i32.rs @@ -0,0 +1,73 @@ +// run-rustfix + +fn foo<N>(_x: N) {} +//~^ NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE + +fn main() { + foo::<i32>(42_usize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i32>(42_u64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i32>(42_u32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i32>(42_u16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i32>(42_u8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i32>(42_isize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i32>(42_i64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i32>(42_i32); + foo::<i32>(42_i16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i32>(42_i8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i32>(42.0_f64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i32>(42.0_f32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments +} diff --git a/tests/ui/numeric/numeric-suffix/numeric-suffix-i32.stderr b/tests/ui/numeric/numeric-suffix/numeric-suffix-i32.stderr new file mode 100644 index 000000000..f4fb14e79 --- /dev/null +++ b/tests/ui/numeric/numeric-suffix/numeric-suffix-i32.stderr @@ -0,0 +1,201 @@ +error[E0308]: mismatched types + --> $DIR/numeric-suffix-i32.rs:28:16 + | +LL | foo::<i32>(42_usize); + | ---------- ^^^^^^^^ expected `i32`, found `usize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-i32.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `usize` to `i32` + | +LL | foo::<i32>(42_i32); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-i32.rs:32:16 + | +LL | foo::<i32>(42_u64); + | ---------- ^^^^^^ expected `i32`, found `u64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-i32.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u64` to `i32` + | +LL | foo::<i32>(42_i32); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-i32.rs:36:16 + | +LL | foo::<i32>(42_u32); + | ---------- ^^^^^^ expected `i32`, found `u32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-i32.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u32` to `i32` + | +LL | foo::<i32>(42_i32); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-i32.rs:40:16 + | +LL | foo::<i32>(42_u16); + | ---------- ^^^^^^ expected `i32`, found `u16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-i32.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u16` to `i32` + | +LL | foo::<i32>(42_i32); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-i32.rs:44:16 + | +LL | foo::<i32>(42_u8); + | ---------- ^^^^^ expected `i32`, found `u8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-i32.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u8` to `i32` + | +LL | foo::<i32>(42_i32); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-i32.rs:48:16 + | +LL | foo::<i32>(42_isize); + | ---------- ^^^^^^^^ expected `i32`, found `isize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-i32.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `isize` to `i32` + | +LL | foo::<i32>(42_i32); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-i32.rs:52:16 + | +LL | foo::<i32>(42_i64); + | ---------- ^^^^^^ expected `i32`, found `i64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-i32.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i64` to `i32` + | +LL | foo::<i32>(42_i32); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-i32.rs:57:16 + | +LL | foo::<i32>(42_i16); + | ---------- ^^^^^^ expected `i32`, found `i16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-i32.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i16` to `i32` + | +LL | foo::<i32>(42_i32); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-i32.rs:61:16 + | +LL | foo::<i32>(42_i8); + | ---------- ^^^^^ expected `i32`, found `i8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-i32.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i8` to `i32` + | +LL | foo::<i32>(42_i32); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-i32.rs:65:16 + | +LL | foo::<i32>(42.0_f64); + | ---------- ^^^^^^^^ expected `i32`, found `f64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-i32.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `f64` to `i32` + | +LL | foo::<i32>(42i32); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-i32.rs:69:16 + | +LL | foo::<i32>(42.0_f32); + | ---------- ^^^^^^^^ expected `i32`, found `f32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-i32.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `f32` to `i32` + | +LL | foo::<i32>(42i32); + | ~~~ + +error: aborting due to 11 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/numeric/numeric-suffix/numeric-suffix-i64.fixed b/tests/ui/numeric/numeric-suffix/numeric-suffix-i64.fixed new file mode 100644 index 000000000..03821cd44 --- /dev/null +++ b/tests/ui/numeric/numeric-suffix/numeric-suffix-i64.fixed @@ -0,0 +1,73 @@ +// run-rustfix + +fn foo<N>(_x: N) {} +//~^ NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE + +fn main() { + foo::<i64>(42_i64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i64>(42_i64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i64>(42_i64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i64>(42_i64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i64>(42_i64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i64>(42_i64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i64>(42_i64); + foo::<i64>(42_i64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i64>(42_i64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i64>(42_i64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i64>(42i64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i64>(42i64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments +} diff --git a/tests/ui/numeric/numeric-suffix/numeric-suffix-i64.rs b/tests/ui/numeric/numeric-suffix/numeric-suffix-i64.rs new file mode 100644 index 000000000..629fe7e74 --- /dev/null +++ b/tests/ui/numeric/numeric-suffix/numeric-suffix-i64.rs @@ -0,0 +1,73 @@ +// run-rustfix + +fn foo<N>(_x: N) {} +//~^ NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE + +fn main() { + foo::<i64>(42_usize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i64>(42_u64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i64>(42_u32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i64>(42_u16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i64>(42_u8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i64>(42_isize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i64>(42_i64); + foo::<i64>(42_i32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i64>(42_i16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i64>(42_i8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i64>(42.0_f64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i64>(42.0_f32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments +} diff --git a/tests/ui/numeric/numeric-suffix/numeric-suffix-i64.stderr b/tests/ui/numeric/numeric-suffix/numeric-suffix-i64.stderr new file mode 100644 index 000000000..47efe9f08 --- /dev/null +++ b/tests/ui/numeric/numeric-suffix/numeric-suffix-i64.stderr @@ -0,0 +1,201 @@ +error[E0308]: mismatched types + --> $DIR/numeric-suffix-i64.rs:28:16 + | +LL | foo::<i64>(42_usize); + | ---------- ^^^^^^^^ expected `i64`, found `usize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-i64.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `usize` to `i64` + | +LL | foo::<i64>(42_i64); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-i64.rs:32:16 + | +LL | foo::<i64>(42_u64); + | ---------- ^^^^^^ expected `i64`, found `u64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-i64.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u64` to `i64` + | +LL | foo::<i64>(42_i64); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-i64.rs:36:16 + | +LL | foo::<i64>(42_u32); + | ---------- ^^^^^^ expected `i64`, found `u32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-i64.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u32` to `i64` + | +LL | foo::<i64>(42_i64); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-i64.rs:40:16 + | +LL | foo::<i64>(42_u16); + | ---------- ^^^^^^ expected `i64`, found `u16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-i64.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u16` to `i64` + | +LL | foo::<i64>(42_i64); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-i64.rs:44:16 + | +LL | foo::<i64>(42_u8); + | ---------- ^^^^^ expected `i64`, found `u8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-i64.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u8` to `i64` + | +LL | foo::<i64>(42_i64); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-i64.rs:48:16 + | +LL | foo::<i64>(42_isize); + | ---------- ^^^^^^^^ expected `i64`, found `isize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-i64.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `isize` to `i64` + | +LL | foo::<i64>(42_i64); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-i64.rs:53:16 + | +LL | foo::<i64>(42_i32); + | ---------- ^^^^^^ expected `i64`, found `i32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-i64.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i32` to `i64` + | +LL | foo::<i64>(42_i64); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-i64.rs:57:16 + | +LL | foo::<i64>(42_i16); + | ---------- ^^^^^^ expected `i64`, found `i16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-i64.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i16` to `i64` + | +LL | foo::<i64>(42_i64); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-i64.rs:61:16 + | +LL | foo::<i64>(42_i8); + | ---------- ^^^^^ expected `i64`, found `i8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-i64.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i8` to `i64` + | +LL | foo::<i64>(42_i64); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-i64.rs:65:16 + | +LL | foo::<i64>(42.0_f64); + | ---------- ^^^^^^^^ expected `i64`, found `f64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-i64.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `f64` to `i64` + | +LL | foo::<i64>(42i64); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-i64.rs:69:16 + | +LL | foo::<i64>(42.0_f32); + | ---------- ^^^^^^^^ expected `i64`, found `f32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-i64.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `f32` to `i64` + | +LL | foo::<i64>(42i64); + | ~~~ + +error: aborting due to 11 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/numeric/numeric-suffix/numeric-suffix-isize.fixed b/tests/ui/numeric/numeric-suffix/numeric-suffix-isize.fixed new file mode 100644 index 000000000..faed65ca4 --- /dev/null +++ b/tests/ui/numeric/numeric-suffix/numeric-suffix-isize.fixed @@ -0,0 +1,73 @@ +// run-rustfix + +fn foo<N>(_x: N) {} +//~^ NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE + +fn main() { + foo::<isize>(42_isize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<isize>(42_isize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<isize>(42_isize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<isize>(42_isize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<isize>(42_isize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<isize>(42_isize); + foo::<isize>(42_isize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<isize>(42_isize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<isize>(42_isize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<isize>(42_isize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<isize>(42isize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<isize>(42isize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments +} diff --git a/tests/ui/numeric/numeric-suffix/numeric-suffix-isize.rs b/tests/ui/numeric/numeric-suffix/numeric-suffix-isize.rs new file mode 100644 index 000000000..df0b4cb62 --- /dev/null +++ b/tests/ui/numeric/numeric-suffix/numeric-suffix-isize.rs @@ -0,0 +1,73 @@ +// run-rustfix + +fn foo<N>(_x: N) {} +//~^ NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE + +fn main() { + foo::<isize>(42_usize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<isize>(42_u64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<isize>(42_u32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<isize>(42_u16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<isize>(42_u8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<isize>(42_isize); + foo::<isize>(42_i64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<isize>(42_i32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<isize>(42_i16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<isize>(42_i8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<isize>(42.0_f64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<isize>(42.0_f32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments +} diff --git a/tests/ui/numeric/numeric-suffix/numeric-suffix-isize.stderr b/tests/ui/numeric/numeric-suffix/numeric-suffix-isize.stderr new file mode 100644 index 000000000..28b79413f --- /dev/null +++ b/tests/ui/numeric/numeric-suffix/numeric-suffix-isize.stderr @@ -0,0 +1,201 @@ +error[E0308]: mismatched types + --> $DIR/numeric-suffix-isize.rs:28:18 + | +LL | foo::<isize>(42_usize); + | ------------ ^^^^^^^^ expected `isize`, found `usize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-isize.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `usize` to `isize` + | +LL | foo::<isize>(42_isize); + | ~~~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-isize.rs:32:18 + | +LL | foo::<isize>(42_u64); + | ------------ ^^^^^^ expected `isize`, found `u64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-isize.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u64` to `isize` + | +LL | foo::<isize>(42_isize); + | ~~~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-isize.rs:36:18 + | +LL | foo::<isize>(42_u32); + | ------------ ^^^^^^ expected `isize`, found `u32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-isize.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u32` to `isize` + | +LL | foo::<isize>(42_isize); + | ~~~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-isize.rs:40:18 + | +LL | foo::<isize>(42_u16); + | ------------ ^^^^^^ expected `isize`, found `u16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-isize.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u16` to `isize` + | +LL | foo::<isize>(42_isize); + | ~~~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-isize.rs:44:18 + | +LL | foo::<isize>(42_u8); + | ------------ ^^^^^ expected `isize`, found `u8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-isize.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u8` to `isize` + | +LL | foo::<isize>(42_isize); + | ~~~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-isize.rs:49:18 + | +LL | foo::<isize>(42_i64); + | ------------ ^^^^^^ expected `isize`, found `i64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-isize.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i64` to `isize` + | +LL | foo::<isize>(42_isize); + | ~~~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-isize.rs:53:18 + | +LL | foo::<isize>(42_i32); + | ------------ ^^^^^^ expected `isize`, found `i32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-isize.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i32` to `isize` + | +LL | foo::<isize>(42_isize); + | ~~~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-isize.rs:57:18 + | +LL | foo::<isize>(42_i16); + | ------------ ^^^^^^ expected `isize`, found `i16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-isize.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i16` to `isize` + | +LL | foo::<isize>(42_isize); + | ~~~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-isize.rs:61:18 + | +LL | foo::<isize>(42_i8); + | ------------ ^^^^^ expected `isize`, found `i8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-isize.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i8` to `isize` + | +LL | foo::<isize>(42_isize); + | ~~~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-isize.rs:65:18 + | +LL | foo::<isize>(42.0_f64); + | ------------ ^^^^^^^^ expected `isize`, found `f64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-isize.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `f64` to `isize` + | +LL | foo::<isize>(42isize); + | ~~~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-isize.rs:69:18 + | +LL | foo::<isize>(42.0_f32); + | ------------ ^^^^^^^^ expected `isize`, found `f32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-isize.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `f32` to `isize` + | +LL | foo::<isize>(42isize); + | ~~~~~ + +error: aborting due to 11 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/numeric/numeric-suffix/numeric-suffix-u32.fixed b/tests/ui/numeric/numeric-suffix/numeric-suffix-u32.fixed new file mode 100644 index 000000000..5955829e7 --- /dev/null +++ b/tests/ui/numeric/numeric-suffix/numeric-suffix-u32.fixed @@ -0,0 +1,73 @@ +// run-rustfix + +fn foo<N>(_x: N) {} +//~^ NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE + +fn main() { + foo::<u32>(42_u32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u32>(42_u32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u32>(42_u32); + foo::<u32>(42_u32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u32>(42_u32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u32>(42_u32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u32>(42_u32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u32>(42_u32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u32>(42_u32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u32>(42_u32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u32>(42u32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u32>(42u32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments +} diff --git a/tests/ui/numeric/numeric-suffix/numeric-suffix-u32.rs b/tests/ui/numeric/numeric-suffix/numeric-suffix-u32.rs new file mode 100644 index 000000000..5c303036a --- /dev/null +++ b/tests/ui/numeric/numeric-suffix/numeric-suffix-u32.rs @@ -0,0 +1,73 @@ +// run-rustfix + +fn foo<N>(_x: N) {} +//~^ NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE + +fn main() { + foo::<u32>(42_usize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u32>(42_u64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u32>(42_u32); + foo::<u32>(42_u16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u32>(42_u8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u32>(42_isize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u32>(42_i64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u32>(42_i32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u32>(42_i16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u32>(42_i8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u32>(42.0_f64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u32>(42.0_f32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments +} diff --git a/tests/ui/numeric/numeric-suffix/numeric-suffix-u32.stderr b/tests/ui/numeric/numeric-suffix/numeric-suffix-u32.stderr new file mode 100644 index 000000000..d966893a8 --- /dev/null +++ b/tests/ui/numeric/numeric-suffix/numeric-suffix-u32.stderr @@ -0,0 +1,201 @@ +error[E0308]: mismatched types + --> $DIR/numeric-suffix-u32.rs:28:16 + | +LL | foo::<u32>(42_usize); + | ---------- ^^^^^^^^ expected `u32`, found `usize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-u32.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `usize` to `u32` + | +LL | foo::<u32>(42_u32); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-u32.rs:32:16 + | +LL | foo::<u32>(42_u64); + | ---------- ^^^^^^ expected `u32`, found `u64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-u32.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u64` to `u32` + | +LL | foo::<u32>(42_u32); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-u32.rs:37:16 + | +LL | foo::<u32>(42_u16); + | ---------- ^^^^^^ expected `u32`, found `u16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-u32.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u16` to `u32` + | +LL | foo::<u32>(42_u32); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-u32.rs:41:16 + | +LL | foo::<u32>(42_u8); + | ---------- ^^^^^ expected `u32`, found `u8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-u32.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u8` to `u32` + | +LL | foo::<u32>(42_u32); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-u32.rs:45:16 + | +LL | foo::<u32>(42_isize); + | ---------- ^^^^^^^^ expected `u32`, found `isize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-u32.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `isize` to `u32` + | +LL | foo::<u32>(42_u32); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-u32.rs:49:16 + | +LL | foo::<u32>(42_i64); + | ---------- ^^^^^^ expected `u32`, found `i64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-u32.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i64` to `u32` + | +LL | foo::<u32>(42_u32); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-u32.rs:53:16 + | +LL | foo::<u32>(42_i32); + | ---------- ^^^^^^ expected `u32`, found `i32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-u32.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i32` to `u32` + | +LL | foo::<u32>(42_u32); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-u32.rs:57:16 + | +LL | foo::<u32>(42_i16); + | ---------- ^^^^^^ expected `u32`, found `i16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-u32.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i16` to `u32` + | +LL | foo::<u32>(42_u32); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-u32.rs:61:16 + | +LL | foo::<u32>(42_i8); + | ---------- ^^^^^ expected `u32`, found `i8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-u32.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i8` to `u32` + | +LL | foo::<u32>(42_u32); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-u32.rs:65:16 + | +LL | foo::<u32>(42.0_f64); + | ---------- ^^^^^^^^ expected `u32`, found `f64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-u32.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `f64` to `u32` + | +LL | foo::<u32>(42u32); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-u32.rs:69:16 + | +LL | foo::<u32>(42.0_f32); + | ---------- ^^^^^^^^ expected `u32`, found `f32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-u32.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `f32` to `u32` + | +LL | foo::<u32>(42u32); + | ~~~ + +error: aborting due to 11 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/numeric/numeric-suffix/numeric-suffix-u64.fixed b/tests/ui/numeric/numeric-suffix/numeric-suffix-u64.fixed new file mode 100644 index 000000000..4623c211c --- /dev/null +++ b/tests/ui/numeric/numeric-suffix/numeric-suffix-u64.fixed @@ -0,0 +1,73 @@ +// run-rustfix + +fn foo<N>(_x: N) {} +//~^ NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE + +fn main() { + foo::<u64>(42_u64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u64>(42_u64); + foo::<u64>(42_u64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u64>(42_u64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u64>(42_u64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u64>(42_u64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u64>(42_u64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u64>(42_u64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u64>(42_u64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u64>(42_u64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u64>(42u64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u64>(42u64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments +} diff --git a/tests/ui/numeric/numeric-suffix/numeric-suffix-u64.rs b/tests/ui/numeric/numeric-suffix/numeric-suffix-u64.rs new file mode 100644 index 000000000..3e9995c74 --- /dev/null +++ b/tests/ui/numeric/numeric-suffix/numeric-suffix-u64.rs @@ -0,0 +1,73 @@ +// run-rustfix + +fn foo<N>(_x: N) {} +//~^ NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE + +fn main() { + foo::<u64>(42_usize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u64>(42_u64); + foo::<u64>(42_u32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u64>(42_u16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u64>(42_u8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u64>(42_isize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u64>(42_i64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u64>(42_i32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u64>(42_i16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u64>(42_i8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u64>(42.0_f64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u64>(42.0_f32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments +} diff --git a/tests/ui/numeric/numeric-suffix/numeric-suffix-u64.stderr b/tests/ui/numeric/numeric-suffix/numeric-suffix-u64.stderr new file mode 100644 index 000000000..ff332fa91 --- /dev/null +++ b/tests/ui/numeric/numeric-suffix/numeric-suffix-u64.stderr @@ -0,0 +1,201 @@ +error[E0308]: mismatched types + --> $DIR/numeric-suffix-u64.rs:28:16 + | +LL | foo::<u64>(42_usize); + | ---------- ^^^^^^^^ expected `u64`, found `usize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-u64.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `usize` to `u64` + | +LL | foo::<u64>(42_u64); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-u64.rs:33:16 + | +LL | foo::<u64>(42_u32); + | ---------- ^^^^^^ expected `u64`, found `u32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-u64.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u32` to `u64` + | +LL | foo::<u64>(42_u64); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-u64.rs:37:16 + | +LL | foo::<u64>(42_u16); + | ---------- ^^^^^^ expected `u64`, found `u16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-u64.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u16` to `u64` + | +LL | foo::<u64>(42_u64); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-u64.rs:41:16 + | +LL | foo::<u64>(42_u8); + | ---------- ^^^^^ expected `u64`, found `u8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-u64.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u8` to `u64` + | +LL | foo::<u64>(42_u64); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-u64.rs:45:16 + | +LL | foo::<u64>(42_isize); + | ---------- ^^^^^^^^ expected `u64`, found `isize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-u64.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `isize` to `u64` + | +LL | foo::<u64>(42_u64); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-u64.rs:49:16 + | +LL | foo::<u64>(42_i64); + | ---------- ^^^^^^ expected `u64`, found `i64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-u64.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i64` to `u64` + | +LL | foo::<u64>(42_u64); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-u64.rs:53:16 + | +LL | foo::<u64>(42_i32); + | ---------- ^^^^^^ expected `u64`, found `i32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-u64.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i32` to `u64` + | +LL | foo::<u64>(42_u64); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-u64.rs:57:16 + | +LL | foo::<u64>(42_i16); + | ---------- ^^^^^^ expected `u64`, found `i16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-u64.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i16` to `u64` + | +LL | foo::<u64>(42_u64); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-u64.rs:61:16 + | +LL | foo::<u64>(42_i8); + | ---------- ^^^^^ expected `u64`, found `i8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-u64.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i8` to `u64` + | +LL | foo::<u64>(42_u64); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-u64.rs:65:16 + | +LL | foo::<u64>(42.0_f64); + | ---------- ^^^^^^^^ expected `u64`, found `f64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-u64.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `f64` to `u64` + | +LL | foo::<u64>(42u64); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-u64.rs:69:16 + | +LL | foo::<u64>(42.0_f32); + | ---------- ^^^^^^^^ expected `u64`, found `f32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-u64.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `f32` to `u64` + | +LL | foo::<u64>(42u64); + | ~~~ + +error: aborting due to 11 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/numeric/numeric-suffix/numeric-suffix-usize.fixed b/tests/ui/numeric/numeric-suffix/numeric-suffix-usize.fixed new file mode 100644 index 000000000..6cb5243ca --- /dev/null +++ b/tests/ui/numeric/numeric-suffix/numeric-suffix-usize.fixed @@ -0,0 +1,73 @@ +// run-rustfix + +fn foo<N>(_x: N) {} +//~^ NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE + +fn main() { + foo::<usize>(42_usize); + foo::<usize>(42_usize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<usize>(42_usize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<usize>(42_usize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<usize>(42_usize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<usize>(42_usize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<usize>(42_usize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<usize>(42_usize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<usize>(42_usize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<usize>(42_usize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<usize>(42usize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<usize>(42usize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments +} diff --git a/tests/ui/numeric/numeric-suffix/numeric-suffix-usize.rs b/tests/ui/numeric/numeric-suffix/numeric-suffix-usize.rs new file mode 100644 index 000000000..a2304ba26 --- /dev/null +++ b/tests/ui/numeric/numeric-suffix/numeric-suffix-usize.rs @@ -0,0 +1,73 @@ +// run-rustfix + +fn foo<N>(_x: N) {} +//~^ NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE + +fn main() { + foo::<usize>(42_usize); + foo::<usize>(42_u64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<usize>(42_u32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<usize>(42_u16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<usize>(42_u8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<usize>(42_isize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<usize>(42_i64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<usize>(42_i32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<usize>(42_i16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<usize>(42_i8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<usize>(42.0_f64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<usize>(42.0_f32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments +} diff --git a/tests/ui/numeric/numeric-suffix/numeric-suffix-usize.stderr b/tests/ui/numeric/numeric-suffix/numeric-suffix-usize.stderr new file mode 100644 index 000000000..4889abee6 --- /dev/null +++ b/tests/ui/numeric/numeric-suffix/numeric-suffix-usize.stderr @@ -0,0 +1,201 @@ +error[E0308]: mismatched types + --> $DIR/numeric-suffix-usize.rs:29:18 + | +LL | foo::<usize>(42_u64); + | ------------ ^^^^^^ expected `usize`, found `u64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-usize.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u64` to `usize` + | +LL | foo::<usize>(42_usize); + | ~~~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-usize.rs:33:18 + | +LL | foo::<usize>(42_u32); + | ------------ ^^^^^^ expected `usize`, found `u32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-usize.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u32` to `usize` + | +LL | foo::<usize>(42_usize); + | ~~~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-usize.rs:37:18 + | +LL | foo::<usize>(42_u16); + | ------------ ^^^^^^ expected `usize`, found `u16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-usize.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u16` to `usize` + | +LL | foo::<usize>(42_usize); + | ~~~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-usize.rs:41:18 + | +LL | foo::<usize>(42_u8); + | ------------ ^^^^^ expected `usize`, found `u8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-usize.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u8` to `usize` + | +LL | foo::<usize>(42_usize); + | ~~~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-usize.rs:45:18 + | +LL | foo::<usize>(42_isize); + | ------------ ^^^^^^^^ expected `usize`, found `isize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-usize.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `isize` to `usize` + | +LL | foo::<usize>(42_usize); + | ~~~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-usize.rs:49:18 + | +LL | foo::<usize>(42_i64); + | ------------ ^^^^^^ expected `usize`, found `i64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-usize.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i64` to `usize` + | +LL | foo::<usize>(42_usize); + | ~~~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-usize.rs:53:18 + | +LL | foo::<usize>(42_i32); + | ------------ ^^^^^^ expected `usize`, found `i32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-usize.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i32` to `usize` + | +LL | foo::<usize>(42_usize); + | ~~~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-usize.rs:57:18 + | +LL | foo::<usize>(42_i16); + | ------------ ^^^^^^ expected `usize`, found `i16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-usize.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i16` to `usize` + | +LL | foo::<usize>(42_usize); + | ~~~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-usize.rs:61:18 + | +LL | foo::<usize>(42_i8); + | ------------ ^^^^^ expected `usize`, found `i8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-usize.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i8` to `usize` + | +LL | foo::<usize>(42_usize); + | ~~~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-usize.rs:65:18 + | +LL | foo::<usize>(42.0_f64); + | ------------ ^^^^^^^^ expected `usize`, found `f64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-usize.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `f64` to `usize` + | +LL | foo::<usize>(42usize); + | ~~~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix-usize.rs:69:18 + | +LL | foo::<usize>(42.0_f32); + | ------------ ^^^^^^^^ expected `usize`, found `f32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix-usize.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `f32` to `usize` + | +LL | foo::<usize>(42usize); + | ~~~~~ + +error: aborting due to 11 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/numeric/numeric-suffix/numeric-suffix.fixed b/tests/ui/numeric/numeric-suffix/numeric-suffix.fixed new file mode 100644 index 000000000..69934db21 --- /dev/null +++ b/tests/ui/numeric/numeric-suffix/numeric-suffix.fixed @@ -0,0 +1,427 @@ +// run-rustfix + +fn foo<N>(_x: N) {} +//~^ NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE + + +fn main() { + foo::<u16>(42_u16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u16>(42_u16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u16>(42_u16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u16>(42_u16); + foo::<u16>(42_u16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u16>(42_u16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u16>(42_u16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u16>(42_u16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u16>(42_u16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u16>(42_u16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u16>(42u16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u16>(42u16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + + foo::<i16>(42_i16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i16>(42_i16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i16>(42_i16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i16>(42_i16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i16>(42_i16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i16>(42_i16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i16>(42_i16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i16>(42_i16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i16>(42_i16); + foo::<i16>(42_i16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i16>(42i16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i16>(42i16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + + foo::<u8>(42_u8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u8>(42_u8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u8>(42_u8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u8>(42_u8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u8>(42_u8); + foo::<u8>(42_u8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u8>(42_u8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u8>(42_u8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u8>(42_u8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u8>(42_u8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u8>(42u8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u8>(42u8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + + foo::<i8>(42_i8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i8>(42_i8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i8>(42_i8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i8>(42_i8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i8>(42_i8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i8>(42_i8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i8>(42_i8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i8>(42_i8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i8>(42_i8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i8>(42_i8); + foo::<i8>(42i8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i8>(42i8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + + foo::<f64>(42_f64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f64>(42_f64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f64>(42_u32.into()); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f64>(42_u16.into()); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f64>(42_u8.into()); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f64>(42_f64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f64>(42_f64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f64>(42_i32.into()); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f64>(42_i16.into()); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f64>(42_i8.into()); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f64>(42.0_f64); + foo::<f64>(42.0_f64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + + foo::<f32>(42_f32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f32>(42_f32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f32>(42_f32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f32>(42_u16.into()); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f32>(42_u8.into()); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f32>(42_f32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f32>(42_f32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f32>(42_f32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f32>(42_i16.into()); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f32>(42_i8.into()); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f32>(42.0_f32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f32>(42.0_f32); + + foo::<u32>((42_u8 as u16).into()); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i32>((-42_i8).into()); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments +} diff --git a/tests/ui/numeric/numeric-suffix/numeric-suffix.rs b/tests/ui/numeric/numeric-suffix/numeric-suffix.rs new file mode 100644 index 000000000..dabf43f82 --- /dev/null +++ b/tests/ui/numeric/numeric-suffix/numeric-suffix.rs @@ -0,0 +1,427 @@ +// run-rustfix + +fn foo<N>(_x: N) {} +//~^ NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE function defined here +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE +//~| NOTE + + +fn main() { + foo::<u16>(42_usize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u16>(42_u64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u16>(42_u32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u16>(42_u16); + foo::<u16>(42_u8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u16>(42_isize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u16>(42_i64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u16>(42_i32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u16>(42_i16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u16>(42_i8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u16>(42.0_f64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u16>(42.0_f32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + + foo::<i16>(42_usize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i16>(42_u64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i16>(42_u32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i16>(42_u16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i16>(42_u8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i16>(42_isize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i16>(42_i64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i16>(42_i32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i16>(42_i16); + foo::<i16>(42_i8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i16>(42.0_f64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i16>(42.0_f32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + + foo::<u8>(42_usize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u8>(42_u64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u8>(42_u32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u8>(42_u16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u8>(42_u8); + foo::<u8>(42_isize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u8>(42_i64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u8>(42_i32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u8>(42_i16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u8>(42_i8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u8>(42.0_f64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<u8>(42.0_f32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + + foo::<i8>(42_usize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i8>(42_u64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i8>(42_u32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i8>(42_u16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i8>(42_u8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i8>(42_isize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i8>(42_i64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i8>(42_i32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i8>(42_i16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i8>(42_i8); + foo::<i8>(42.0_f64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i8>(42.0_f32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + + foo::<f64>(42_usize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f64>(42_u64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f64>(42_u32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f64>(42_u16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f64>(42_u8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f64>(42_isize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f64>(42_i64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f64>(42_i32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f64>(42_i16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f64>(42_i8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f64>(42.0_f64); + foo::<f64>(42.0_f32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + + foo::<f32>(42_usize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f32>(42_u64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f32>(42_u32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f32>(42_u16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f32>(42_u8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f32>(42_isize); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f32>(42_i64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f32>(42_i32); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f32>(42_i16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f32>(42_i8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f32>(42.0_f64); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<f32>(42.0_f32); + + foo::<u32>(42_u8 as u16); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments + foo::<i32>(-42_i8); + //~^ ERROR mismatched types + //~| NOTE expected + //~| NOTE arguments +} diff --git a/tests/ui/numeric/numeric-suffix/numeric-suffix.stderr b/tests/ui/numeric/numeric-suffix/numeric-suffix.stderr new file mode 100644 index 000000000..e05913b9c --- /dev/null +++ b/tests/ui/numeric/numeric-suffix/numeric-suffix.stderr @@ -0,0 +1,1227 @@ +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:143:16 + | +LL | foo::<u16>(42_usize); + | ---------- ^^^^^^^^ expected `u16`, found `usize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `usize` to `u16` + | +LL | foo::<u16>(42_u16); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:147:16 + | +LL | foo::<u16>(42_u64); + | ---------- ^^^^^^ expected `u16`, found `u64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u64` to `u16` + | +LL | foo::<u16>(42_u16); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:151:16 + | +LL | foo::<u16>(42_u32); + | ---------- ^^^^^^ expected `u16`, found `u32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u32` to `u16` + | +LL | foo::<u16>(42_u16); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:156:16 + | +LL | foo::<u16>(42_u8); + | ---------- ^^^^^ expected `u16`, found `u8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u8` to `u16` + | +LL | foo::<u16>(42_u16); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:160:16 + | +LL | foo::<u16>(42_isize); + | ---------- ^^^^^^^^ expected `u16`, found `isize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `isize` to `u16` + | +LL | foo::<u16>(42_u16); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:164:16 + | +LL | foo::<u16>(42_i64); + | ---------- ^^^^^^ expected `u16`, found `i64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i64` to `u16` + | +LL | foo::<u16>(42_u16); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:168:16 + | +LL | foo::<u16>(42_i32); + | ---------- ^^^^^^ expected `u16`, found `i32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i32` to `u16` + | +LL | foo::<u16>(42_u16); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:172:16 + | +LL | foo::<u16>(42_i16); + | ---------- ^^^^^^ expected `u16`, found `i16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i16` to `u16` + | +LL | foo::<u16>(42_u16); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:176:16 + | +LL | foo::<u16>(42_i8); + | ---------- ^^^^^ expected `u16`, found `i8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i8` to `u16` + | +LL | foo::<u16>(42_u16); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:180:16 + | +LL | foo::<u16>(42.0_f64); + | ---------- ^^^^^^^^ expected `u16`, found `f64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `f64` to `u16` + | +LL | foo::<u16>(42u16); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:184:16 + | +LL | foo::<u16>(42.0_f32); + | ---------- ^^^^^^^^ expected `u16`, found `f32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `f32` to `u16` + | +LL | foo::<u16>(42u16); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:189:16 + | +LL | foo::<i16>(42_usize); + | ---------- ^^^^^^^^ expected `i16`, found `usize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `usize` to `i16` + | +LL | foo::<i16>(42_i16); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:193:16 + | +LL | foo::<i16>(42_u64); + | ---------- ^^^^^^ expected `i16`, found `u64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u64` to `i16` + | +LL | foo::<i16>(42_i16); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:197:16 + | +LL | foo::<i16>(42_u32); + | ---------- ^^^^^^ expected `i16`, found `u32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u32` to `i16` + | +LL | foo::<i16>(42_i16); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:201:16 + | +LL | foo::<i16>(42_u16); + | ---------- ^^^^^^ expected `i16`, found `u16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u16` to `i16` + | +LL | foo::<i16>(42_i16); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:205:16 + | +LL | foo::<i16>(42_u8); + | ---------- ^^^^^ expected `i16`, found `u8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u8` to `i16` + | +LL | foo::<i16>(42_i16); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:209:16 + | +LL | foo::<i16>(42_isize); + | ---------- ^^^^^^^^ expected `i16`, found `isize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `isize` to `i16` + | +LL | foo::<i16>(42_i16); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:213:16 + | +LL | foo::<i16>(42_i64); + | ---------- ^^^^^^ expected `i16`, found `i64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i64` to `i16` + | +LL | foo::<i16>(42_i16); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:217:16 + | +LL | foo::<i16>(42_i32); + | ---------- ^^^^^^ expected `i16`, found `i32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i32` to `i16` + | +LL | foo::<i16>(42_i16); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:222:16 + | +LL | foo::<i16>(42_i8); + | ---------- ^^^^^ expected `i16`, found `i8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i8` to `i16` + | +LL | foo::<i16>(42_i16); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:226:16 + | +LL | foo::<i16>(42.0_f64); + | ---------- ^^^^^^^^ expected `i16`, found `f64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `f64` to `i16` + | +LL | foo::<i16>(42i16); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:230:16 + | +LL | foo::<i16>(42.0_f32); + | ---------- ^^^^^^^^ expected `i16`, found `f32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `f32` to `i16` + | +LL | foo::<i16>(42i16); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:235:15 + | +LL | foo::<u8>(42_usize); + | --------- ^^^^^^^^ expected `u8`, found `usize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `usize` to `u8` + | +LL | foo::<u8>(42_u8); + | ~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:239:15 + | +LL | foo::<u8>(42_u64); + | --------- ^^^^^^ expected `u8`, found `u64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u64` to `u8` + | +LL | foo::<u8>(42_u8); + | ~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:243:15 + | +LL | foo::<u8>(42_u32); + | --------- ^^^^^^ expected `u8`, found `u32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u32` to `u8` + | +LL | foo::<u8>(42_u8); + | ~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:247:15 + | +LL | foo::<u8>(42_u16); + | --------- ^^^^^^ expected `u8`, found `u16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u16` to `u8` + | +LL | foo::<u8>(42_u8); + | ~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:252:15 + | +LL | foo::<u8>(42_isize); + | --------- ^^^^^^^^ expected `u8`, found `isize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `isize` to `u8` + | +LL | foo::<u8>(42_u8); + | ~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:256:15 + | +LL | foo::<u8>(42_i64); + | --------- ^^^^^^ expected `u8`, found `i64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i64` to `u8` + | +LL | foo::<u8>(42_u8); + | ~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:260:15 + | +LL | foo::<u8>(42_i32); + | --------- ^^^^^^ expected `u8`, found `i32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i32` to `u8` + | +LL | foo::<u8>(42_u8); + | ~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:264:15 + | +LL | foo::<u8>(42_i16); + | --------- ^^^^^^ expected `u8`, found `i16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i16` to `u8` + | +LL | foo::<u8>(42_u8); + | ~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:268:15 + | +LL | foo::<u8>(42_i8); + | --------- ^^^^^ expected `u8`, found `i8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i8` to `u8` + | +LL | foo::<u8>(42_u8); + | ~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:272:15 + | +LL | foo::<u8>(42.0_f64); + | --------- ^^^^^^^^ expected `u8`, found `f64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `f64` to `u8` + | +LL | foo::<u8>(42u8); + | ~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:276:15 + | +LL | foo::<u8>(42.0_f32); + | --------- ^^^^^^^^ expected `u8`, found `f32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `f32` to `u8` + | +LL | foo::<u8>(42u8); + | ~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:281:15 + | +LL | foo::<i8>(42_usize); + | --------- ^^^^^^^^ expected `i8`, found `usize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `usize` to `i8` + | +LL | foo::<i8>(42_i8); + | ~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:285:15 + | +LL | foo::<i8>(42_u64); + | --------- ^^^^^^ expected `i8`, found `u64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u64` to `i8` + | +LL | foo::<i8>(42_i8); + | ~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:289:15 + | +LL | foo::<i8>(42_u32); + | --------- ^^^^^^ expected `i8`, found `u32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u32` to `i8` + | +LL | foo::<i8>(42_i8); + | ~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:293:15 + | +LL | foo::<i8>(42_u16); + | --------- ^^^^^^ expected `i8`, found `u16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u16` to `i8` + | +LL | foo::<i8>(42_i8); + | ~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:297:15 + | +LL | foo::<i8>(42_u8); + | --------- ^^^^^ expected `i8`, found `u8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u8` to `i8` + | +LL | foo::<i8>(42_i8); + | ~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:301:15 + | +LL | foo::<i8>(42_isize); + | --------- ^^^^^^^^ expected `i8`, found `isize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `isize` to `i8` + | +LL | foo::<i8>(42_i8); + | ~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:305:15 + | +LL | foo::<i8>(42_i64); + | --------- ^^^^^^ expected `i8`, found `i64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i64` to `i8` + | +LL | foo::<i8>(42_i8); + | ~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:309:15 + | +LL | foo::<i8>(42_i32); + | --------- ^^^^^^ expected `i8`, found `i32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i32` to `i8` + | +LL | foo::<i8>(42_i8); + | ~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:313:15 + | +LL | foo::<i8>(42_i16); + | --------- ^^^^^^ expected `i8`, found `i16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i16` to `i8` + | +LL | foo::<i8>(42_i8); + | ~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:318:15 + | +LL | foo::<i8>(42.0_f64); + | --------- ^^^^^^^^ expected `i8`, found `f64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `f64` to `i8` + | +LL | foo::<i8>(42i8); + | ~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:322:15 + | +LL | foo::<i8>(42.0_f32); + | --------- ^^^^^^^^ expected `i8`, found `f32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `f32` to `i8` + | +LL | foo::<i8>(42i8); + | ~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:327:16 + | +LL | foo::<f64>(42_usize); + | ---------- ^^^^^^^^ expected `f64`, found `usize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `usize` to `f64` + | +LL | foo::<f64>(42_f64); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:331:16 + | +LL | foo::<f64>(42_u64); + | ---------- ^^^^^^ expected `f64`, found `u64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u64` to `f64` + | +LL | foo::<f64>(42_f64); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:335:16 + | +LL | foo::<f64>(42_u32); + | ---------- ^^^^^^ expected `f64`, found `u32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: you can convert a `u32` to an `f64`, producing the floating point representation of the integer + | +LL | foo::<f64>(42_u32.into()); + | +++++++ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:339:16 + | +LL | foo::<f64>(42_u16); + | ---------- ^^^^^^ expected `f64`, found `u16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: you can convert a `u16` to an `f64`, producing the floating point representation of the integer + | +LL | foo::<f64>(42_u16.into()); + | +++++++ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:343:16 + | +LL | foo::<f64>(42_u8); + | ---------- ^^^^^ expected `f64`, found `u8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: you can convert a `u8` to an `f64`, producing the floating point representation of the integer + | +LL | foo::<f64>(42_u8.into()); + | +++++++ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:347:16 + | +LL | foo::<f64>(42_isize); + | ---------- ^^^^^^^^ expected `f64`, found `isize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `isize` to `f64` + | +LL | foo::<f64>(42_f64); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:351:16 + | +LL | foo::<f64>(42_i64); + | ---------- ^^^^^^ expected `f64`, found `i64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i64` to `f64` + | +LL | foo::<f64>(42_f64); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:355:16 + | +LL | foo::<f64>(42_i32); + | ---------- ^^^^^^ expected `f64`, found `i32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: you can convert an `i32` to an `f64`, producing the floating point representation of the integer + | +LL | foo::<f64>(42_i32.into()); + | +++++++ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:359:16 + | +LL | foo::<f64>(42_i16); + | ---------- ^^^^^^ expected `f64`, found `i16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: you can convert an `i16` to an `f64`, producing the floating point representation of the integer + | +LL | foo::<f64>(42_i16.into()); + | +++++++ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:363:16 + | +LL | foo::<f64>(42_i8); + | ---------- ^^^^^ expected `f64`, found `i8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: you can convert an `i8` to an `f64`, producing the floating point representation of the integer + | +LL | foo::<f64>(42_i8.into()); + | +++++++ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:368:16 + | +LL | foo::<f64>(42.0_f32); + | ---------- ^^^^^^^^ expected `f64`, found `f32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `f32` to `f64` + | +LL | foo::<f64>(42.0_f64); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:373:16 + | +LL | foo::<f32>(42_usize); + | ---------- ^^^^^^^^ expected `f32`, found `usize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `usize` to `f32` + | +LL | foo::<f32>(42_f32); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:377:16 + | +LL | foo::<f32>(42_u64); + | ---------- ^^^^^^ expected `f32`, found `u64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u64` to `f32` + | +LL | foo::<f32>(42_f32); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:381:16 + | +LL | foo::<f32>(42_u32); + | ---------- ^^^^^^ expected `f32`, found `u32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `u32` to `f32` + | +LL | foo::<f32>(42_f32); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:385:16 + | +LL | foo::<f32>(42_u16); + | ---------- ^^^^^^ expected `f32`, found `u16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: you can convert a `u16` to an `f32`, producing the floating point representation of the integer + | +LL | foo::<f32>(42_u16.into()); + | +++++++ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:389:16 + | +LL | foo::<f32>(42_u8); + | ---------- ^^^^^ expected `f32`, found `u8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: you can convert a `u8` to an `f32`, producing the floating point representation of the integer + | +LL | foo::<f32>(42_u8.into()); + | +++++++ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:393:16 + | +LL | foo::<f32>(42_isize); + | ---------- ^^^^^^^^ expected `f32`, found `isize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `isize` to `f32` + | +LL | foo::<f32>(42_f32); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:397:16 + | +LL | foo::<f32>(42_i64); + | ---------- ^^^^^^ expected `f32`, found `i64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i64` to `f32` + | +LL | foo::<f32>(42_f32); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:401:16 + | +LL | foo::<f32>(42_i32); + | ---------- ^^^^^^ expected `f32`, found `i32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `i32` to `f32` + | +LL | foo::<f32>(42_f32); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:405:16 + | +LL | foo::<f32>(42_i16); + | ---------- ^^^^^^ expected `f32`, found `i16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: you can convert an `i16` to an `f32`, producing the floating point representation of the integer + | +LL | foo::<f32>(42_i16.into()); + | +++++++ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:409:16 + | +LL | foo::<f32>(42_i8); + | ---------- ^^^^^ expected `f32`, found `i8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: you can convert an `i8` to an `f32`, producing the floating point representation of the integer + | +LL | foo::<f32>(42_i8.into()); + | +++++++ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:413:16 + | +LL | foo::<f32>(42.0_f64); + | ---------- ^^^^^^^^ expected `f32`, found `f64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: change the type of the numeric literal from `f64` to `f32` + | +LL | foo::<f32>(42.0_f32); + | ~~~ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:419:16 + | +LL | foo::<u32>(42_u8 as u16); + | ---------- ^^^^^^^^^^^^ expected `u32`, found `u16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: you can convert a `u16` to a `u32` + | +LL | foo::<u32>((42_u8 as u16).into()); + | + ++++++++ + +error[E0308]: mismatched types + --> $DIR/numeric-suffix.rs:423:16 + | +LL | foo::<i32>(-42_i8); + | ---------- ^^^^^^ expected `i32`, found `i8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-suffix.rs:3:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- +help: you can convert an `i8` to an `i32` + | +LL | foo::<i32>((-42_i8).into()); + | + ++++++++ + +error: aborting due to 68 previous errors + +For more information about this error, try `rustc --explain E0308`. |