diff options
Diffstat (limited to 'src/test/ui/numeric')
28 files changed, 5680 insertions, 2260 deletions
diff --git a/src/test/ui/numeric/integer-literal-suffix-inference.stderr b/src/test/ui/numeric/integer-literal-suffix-inference.stderr index 4c29c4a1cb0..5045f584c89 100644 --- a/src/test/ui/numeric/integer-literal-suffix-inference.stderr +++ b/src/test/ui/numeric/integer-literal-suffix-inference.stderr @@ -2,8 +2,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:38:11 | LL | id_i8(a16); - | ^^^ expected `i8`, found `i16` + | ----- ^^^ expected `i8`, found `i16` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:15:8 + | +LL | fn id_i8(n: i8) -> i8 { n } + | ^^^^^ ----- help: you can convert an `i16` to an `i8` and panic if the converted value doesn't fit | LL | id_i8(a16.try_into().unwrap()); @@ -13,8 +20,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:41:11 | LL | id_i8(a32); - | ^^^ expected `i8`, found `i32` + | ----- ^^^ expected `i8`, found `i32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:15:8 | +LL | fn id_i8(n: i8) -> i8 { n } + | ^^^^^ ----- help: you can convert an `i32` to an `i8` and panic if the converted value doesn't fit | LL | id_i8(a32.try_into().unwrap()); @@ -24,8 +38,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:44:11 | LL | id_i8(a64); - | ^^^ expected `i8`, found `i64` + | ----- ^^^ expected `i8`, found `i64` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:15:8 + | +LL | fn id_i8(n: i8) -> i8 { n } + | ^^^^^ ----- help: you can convert an `i64` to an `i8` and panic if the converted value doesn't fit | LL | id_i8(a64.try_into().unwrap()); @@ -35,8 +56,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:47:11 | LL | id_i8(asize); - | ^^^^^ expected `i8`, found `isize` + | ----- ^^^^^ expected `i8`, found `isize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:15:8 | +LL | fn id_i8(n: i8) -> i8 { n } + | ^^^^^ ----- help: you can convert an `isize` to an `i8` and panic if the converted value doesn't fit | LL | id_i8(asize.try_into().unwrap()); @@ -46,8 +74,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:51:12 | LL | id_i16(a8); - | ^^ expected `i16`, found `i8` + | ------ ^^ expected `i16`, found `i8` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:16:8 + | +LL | fn id_i16(n: i16) -> i16 { n } + | ^^^^^^ ------ help: you can convert an `i8` to an `i16` | LL | id_i16(a8.into()); @@ -57,8 +92,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:55:12 | LL | id_i16(a32); - | ^^^ expected `i16`, found `i32` + | ------ ^^^ expected `i16`, found `i32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:16:8 | +LL | fn id_i16(n: i16) -> i16 { n } + | ^^^^^^ ------ help: you can convert an `i32` to an `i16` and panic if the converted value doesn't fit | LL | id_i16(a32.try_into().unwrap()); @@ -68,8 +110,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:58:12 | LL | id_i16(a64); - | ^^^ expected `i16`, found `i64` + | ------ ^^^ expected `i16`, found `i64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:16:8 | +LL | fn id_i16(n: i16) -> i16 { n } + | ^^^^^^ ------ help: you can convert an `i64` to an `i16` and panic if the converted value doesn't fit | LL | id_i16(a64.try_into().unwrap()); @@ -79,8 +128,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:61:12 | LL | id_i16(asize); - | ^^^^^ expected `i16`, found `isize` + | ------ ^^^^^ expected `i16`, found `isize` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:16:8 + | +LL | fn id_i16(n: i16) -> i16 { n } + | ^^^^^^ ------ help: you can convert an `isize` to an `i16` and panic if the converted value doesn't fit | LL | id_i16(asize.try_into().unwrap()); @@ -90,8 +146,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:65:12 | LL | id_i32(a8); - | ^^ expected `i32`, found `i8` + | ------ ^^ expected `i32`, found `i8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:17:8 | +LL | fn id_i32(n: i32) -> i32 { n } + | ^^^^^^ ------ help: you can convert an `i8` to an `i32` | LL | id_i32(a8.into()); @@ -101,8 +164,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:68:12 | LL | id_i32(a16); - | ^^^ expected `i32`, found `i16` + | ------ ^^^ expected `i32`, found `i16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:17:8 | +LL | fn id_i32(n: i32) -> i32 { n } + | ^^^^^^ ------ help: you can convert an `i16` to an `i32` | LL | id_i32(a16.into()); @@ -112,8 +182,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:72:12 | LL | id_i32(a64); - | ^^^ expected `i32`, found `i64` + | ------ ^^^ expected `i32`, found `i64` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:17:8 + | +LL | fn id_i32(n: i32) -> i32 { n } + | ^^^^^^ ------ help: you can convert an `i64` to an `i32` and panic if the converted value doesn't fit | LL | id_i32(a64.try_into().unwrap()); @@ -123,8 +200,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:75:12 | LL | id_i32(asize); - | ^^^^^ expected `i32`, found `isize` + | ------ ^^^^^ expected `i32`, found `isize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:17:8 | +LL | fn id_i32(n: i32) -> i32 { n } + | ^^^^^^ ------ help: you can convert an `isize` to an `i32` and panic if the converted value doesn't fit | LL | id_i32(asize.try_into().unwrap()); @@ -134,8 +218,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:79:12 | LL | id_i64(a8); - | ^^ expected `i64`, found `i8` + | ------ ^^ expected `i64`, found `i8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:18:8 | +LL | fn id_i64(n: i64) -> i64 { n } + | ^^^^^^ ------ help: you can convert an `i8` to an `i64` | LL | id_i64(a8.into()); @@ -145,8 +236,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:82:12 | LL | id_i64(a16); - | ^^^ expected `i64`, found `i16` + | ------ ^^^ expected `i64`, found `i16` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:18:8 + | +LL | fn id_i64(n: i64) -> i64 { n } + | ^^^^^^ ------ help: you can convert an `i16` to an `i64` | LL | id_i64(a16.into()); @@ -156,8 +254,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:85:12 | LL | id_i64(a32); - | ^^^ expected `i64`, found `i32` + | ------ ^^^ expected `i64`, found `i32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:18:8 | +LL | fn id_i64(n: i64) -> i64 { n } + | ^^^^^^ ------ help: you can convert an `i32` to an `i64` | LL | id_i64(a32.into()); @@ -167,8 +272,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:89:12 | LL | id_i64(asize); - | ^^^^^ expected `i64`, found `isize` + | ------ ^^^^^ expected `i64`, found `isize` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:18:8 + | +LL | fn id_i64(n: i64) -> i64 { n } + | ^^^^^^ ------ help: you can convert an `isize` to an `i64` and panic if the converted value doesn't fit | LL | id_i64(asize.try_into().unwrap()); @@ -178,8 +290,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:93:14 | LL | id_isize(a8); - | ^^ expected `isize`, found `i8` + | -------- ^^ expected `isize`, found `i8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:19:8 | +LL | fn id_isize(n: isize) -> isize { n } + | ^^^^^^^^ -------- help: you can convert an `i8` to an `isize` | LL | id_isize(a8.into()); @@ -189,8 +308,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:96:14 | LL | id_isize(a16); - | ^^^ expected `isize`, found `i16` + | -------- ^^^ expected `isize`, found `i16` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:19:8 + | +LL | fn id_isize(n: isize) -> isize { n } + | ^^^^^^^^ -------- help: you can convert an `i16` to an `isize` | LL | id_isize(a16.into()); @@ -200,8 +326,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:99:14 | LL | id_isize(a32); - | ^^^ expected `isize`, found `i32` + | -------- ^^^ expected `isize`, found `i32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:19:8 | +LL | fn id_isize(n: isize) -> isize { n } + | ^^^^^^^^ -------- help: you can convert an `i32` to an `isize` and panic if the converted value doesn't fit | LL | id_isize(a32.try_into().unwrap()); @@ -211,8 +344,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:102:14 | LL | id_isize(a64); - | ^^^ expected `isize`, found `i64` + | -------- ^^^ expected `isize`, found `i64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:19:8 | +LL | fn id_isize(n: isize) -> isize { n } + | ^^^^^^^^ -------- help: you can convert an `i64` to an `isize` and panic if the converted value doesn't fit | LL | id_isize(a64.try_into().unwrap()); @@ -222,8 +362,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:108:11 | LL | id_i8(c16); - | ^^^ expected `i8`, found `i16` + | ----- ^^^ expected `i8`, found `i16` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:15:8 + | +LL | fn id_i8(n: i8) -> i8 { n } + | ^^^^^ ----- help: you can convert an `i16` to an `i8` and panic if the converted value doesn't fit | LL | id_i8(c16.try_into().unwrap()); @@ -233,8 +380,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:111:11 | LL | id_i8(c32); - | ^^^ expected `i8`, found `i32` + | ----- ^^^ expected `i8`, found `i32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:15:8 | +LL | fn id_i8(n: i8) -> i8 { n } + | ^^^^^ ----- help: you can convert an `i32` to an `i8` and panic if the converted value doesn't fit | LL | id_i8(c32.try_into().unwrap()); @@ -244,8 +398,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:114:11 | LL | id_i8(c64); - | ^^^ expected `i8`, found `i64` + | ----- ^^^ expected `i8`, found `i64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:15:8 | +LL | fn id_i8(n: i8) -> i8 { n } + | ^^^^^ ----- help: you can convert an `i64` to an `i8` and panic if the converted value doesn't fit | LL | id_i8(c64.try_into().unwrap()); @@ -255,8 +416,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:118:12 | LL | id_i16(c8); - | ^^ expected `i16`, found `i8` + | ------ ^^ expected `i16`, found `i8` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:16:8 + | +LL | fn id_i16(n: i16) -> i16 { n } + | ^^^^^^ ------ help: you can convert an `i8` to an `i16` | LL | id_i16(c8.into()); @@ -266,8 +434,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:122:12 | LL | id_i16(c32); - | ^^^ expected `i16`, found `i32` + | ------ ^^^ expected `i16`, found `i32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:16:8 | +LL | fn id_i16(n: i16) -> i16 { n } + | ^^^^^^ ------ help: you can convert an `i32` to an `i16` and panic if the converted value doesn't fit | LL | id_i16(c32.try_into().unwrap()); @@ -277,8 +452,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:125:12 | LL | id_i16(c64); - | ^^^ expected `i16`, found `i64` + | ------ ^^^ expected `i16`, found `i64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:16:8 | +LL | fn id_i16(n: i16) -> i16 { n } + | ^^^^^^ ------ help: you can convert an `i64` to an `i16` and panic if the converted value doesn't fit | LL | id_i16(c64.try_into().unwrap()); @@ -288,8 +470,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:129:12 | LL | id_i32(c8); - | ^^ expected `i32`, found `i8` + | ------ ^^ expected `i32`, found `i8` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:17:8 + | +LL | fn id_i32(n: i32) -> i32 { n } + | ^^^^^^ ------ help: you can convert an `i8` to an `i32` | LL | id_i32(c8.into()); @@ -299,8 +488,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:132:12 | LL | id_i32(c16); - | ^^^ expected `i32`, found `i16` + | ------ ^^^ expected `i32`, found `i16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:17:8 | +LL | fn id_i32(n: i32) -> i32 { n } + | ^^^^^^ ------ help: you can convert an `i16` to an `i32` | LL | id_i32(c16.into()); @@ -310,8 +506,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:136:12 | LL | id_i32(c64); - | ^^^ expected `i32`, found `i64` + | ------ ^^^ expected `i32`, found `i64` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:17:8 + | +LL | fn id_i32(n: i32) -> i32 { n } + | ^^^^^^ ------ help: you can convert an `i64` to an `i32` and panic if the converted value doesn't fit | LL | id_i32(c64.try_into().unwrap()); @@ -321,8 +524,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:140:12 | LL | id_i64(a8); - | ^^ expected `i64`, found `i8` + | ------ ^^ expected `i64`, found `i8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:18:8 | +LL | fn id_i64(n: i64) -> i64 { n } + | ^^^^^^ ------ help: you can convert an `i8` to an `i64` | LL | id_i64(a8.into()); @@ -332,8 +542,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:143:12 | LL | id_i64(a16); - | ^^^ expected `i64`, found `i16` + | ------ ^^^ expected `i64`, found `i16` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:18:8 + | +LL | fn id_i64(n: i64) -> i64 { n } + | ^^^^^^ ------ help: you can convert an `i16` to an `i64` | LL | id_i64(a16.into()); @@ -343,8 +560,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:146:12 | LL | id_i64(a32); - | ^^^ expected `i64`, found `i32` + | ------ ^^^ expected `i64`, found `i32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:18:8 | +LL | fn id_i64(n: i64) -> i64 { n } + | ^^^^^^ ------ help: you can convert an `i32` to an `i64` | LL | id_i64(a32.into()); @@ -354,8 +578,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:152:11 | LL | id_u8(b16); - | ^^^ expected `u8`, found `u16` + | ----- ^^^ expected `u8`, found `u16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:27:8 | +LL | fn id_u8(n: u8) -> u8 { n } + | ^^^^^ ----- help: you can convert a `u16` to a `u8` and panic if the converted value doesn't fit | LL | id_u8(b16.try_into().unwrap()); @@ -365,8 +596,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:155:11 | LL | id_u8(b32); - | ^^^ expected `u8`, found `u32` + | ----- ^^^ expected `u8`, found `u32` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:27:8 + | +LL | fn id_u8(n: u8) -> u8 { n } + | ^^^^^ ----- help: you can convert a `u32` to a `u8` and panic if the converted value doesn't fit | LL | id_u8(b32.try_into().unwrap()); @@ -376,8 +614,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:158:11 | LL | id_u8(b64); - | ^^^ expected `u8`, found `u64` + | ----- ^^^ expected `u8`, found `u64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:27:8 | +LL | fn id_u8(n: u8) -> u8 { n } + | ^^^^^ ----- help: you can convert a `u64` to a `u8` and panic if the converted value doesn't fit | LL | id_u8(b64.try_into().unwrap()); @@ -387,8 +632,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:161:11 | LL | id_u8(bsize); - | ^^^^^ expected `u8`, found `usize` + | ----- ^^^^^ expected `u8`, found `usize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:27:8 | +LL | fn id_u8(n: u8) -> u8 { n } + | ^^^^^ ----- help: you can convert a `usize` to a `u8` and panic if the converted value doesn't fit | LL | id_u8(bsize.try_into().unwrap()); @@ -398,8 +650,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:165:12 | LL | id_u16(b8); - | ^^ expected `u16`, found `u8` + | ------ ^^ expected `u16`, found `u8` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:28:8 + | +LL | fn id_u16(n: u16) -> u16 { n } + | ^^^^^^ ------ help: you can convert a `u8` to a `u16` | LL | id_u16(b8.into()); @@ -409,8 +668,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:169:12 | LL | id_u16(b32); - | ^^^ expected `u16`, found `u32` + | ------ ^^^ expected `u16`, found `u32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:28:8 | +LL | fn id_u16(n: u16) -> u16 { n } + | ^^^^^^ ------ help: you can convert a `u32` to a `u16` and panic if the converted value doesn't fit | LL | id_u16(b32.try_into().unwrap()); @@ -420,8 +686,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:172:12 | LL | id_u16(b64); - | ^^^ expected `u16`, found `u64` + | ------ ^^^ expected `u16`, found `u64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:28:8 | +LL | fn id_u16(n: u16) -> u16 { n } + | ^^^^^^ ------ help: you can convert a `u64` to a `u16` and panic if the converted value doesn't fit | LL | id_u16(b64.try_into().unwrap()); @@ -431,8 +704,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:175:12 | LL | id_u16(bsize); - | ^^^^^ expected `u16`, found `usize` + | ------ ^^^^^ expected `u16`, found `usize` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:28:8 + | +LL | fn id_u16(n: u16) -> u16 { n } + | ^^^^^^ ------ help: you can convert a `usize` to a `u16` and panic if the converted value doesn't fit | LL | id_u16(bsize.try_into().unwrap()); @@ -442,8 +722,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:179:12 | LL | id_u32(b8); - | ^^ expected `u32`, found `u8` + | ------ ^^ expected `u32`, found `u8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:29:8 | +LL | fn id_u32(n: u32) -> u32 { n } + | ^^^^^^ ------ help: you can convert a `u8` to a `u32` | LL | id_u32(b8.into()); @@ -453,8 +740,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:182:12 | LL | id_u32(b16); - | ^^^ expected `u32`, found `u16` + | ------ ^^^ expected `u32`, found `u16` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:29:8 + | +LL | fn id_u32(n: u32) -> u32 { n } + | ^^^^^^ ------ help: you can convert a `u16` to a `u32` | LL | id_u32(b16.into()); @@ -464,8 +758,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:186:12 | LL | id_u32(b64); - | ^^^ expected `u32`, found `u64` + | ------ ^^^ expected `u32`, found `u64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:29:8 | +LL | fn id_u32(n: u32) -> u32 { n } + | ^^^^^^ ------ help: you can convert a `u64` to a `u32` and panic if the converted value doesn't fit | LL | id_u32(b64.try_into().unwrap()); @@ -475,8 +776,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:189:12 | LL | id_u32(bsize); - | ^^^^^ expected `u32`, found `usize` + | ------ ^^^^^ expected `u32`, found `usize` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:29:8 + | +LL | fn id_u32(n: u32) -> u32 { n } + | ^^^^^^ ------ help: you can convert a `usize` to a `u32` and panic if the converted value doesn't fit | LL | id_u32(bsize.try_into().unwrap()); @@ -486,8 +794,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:193:12 | LL | id_u64(b8); - | ^^ expected `u64`, found `u8` + | ------ ^^ expected `u64`, found `u8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:30:8 | +LL | fn id_u64(n: u64) -> u64 { n } + | ^^^^^^ ------ help: you can convert a `u8` to a `u64` | LL | id_u64(b8.into()); @@ -497,8 +812,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:196:12 | LL | id_u64(b16); - | ^^^ expected `u64`, found `u16` + | ------ ^^^ expected `u64`, found `u16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:30:8 | +LL | fn id_u64(n: u64) -> u64 { n } + | ^^^^^^ ------ help: you can convert a `u16` to a `u64` | LL | id_u64(b16.into()); @@ -508,8 +830,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:199:12 | LL | id_u64(b32); - | ^^^ expected `u64`, found `u32` + | ------ ^^^ expected `u64`, found `u32` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:30:8 + | +LL | fn id_u64(n: u64) -> u64 { n } + | ^^^^^^ ------ help: you can convert a `u32` to a `u64` | LL | id_u64(b32.into()); @@ -519,8 +848,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:203:12 | LL | id_u64(bsize); - | ^^^^^ expected `u64`, found `usize` + | ------ ^^^^^ expected `u64`, found `usize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:30:8 | +LL | fn id_u64(n: u64) -> u64 { n } + | ^^^^^^ ------ help: you can convert a `usize` to a `u64` and panic if the converted value doesn't fit | LL | id_u64(bsize.try_into().unwrap()); @@ -530,8 +866,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:207:14 | LL | id_usize(b8); - | ^^ expected `usize`, found `u8` + | -------- ^^ expected `usize`, found `u8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:31:8 | +LL | fn id_usize(n: usize) -> usize { n } + | ^^^^^^^^ -------- help: you can convert a `u8` to a `usize` | LL | id_usize(b8.into()); @@ -541,8 +884,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:210:14 | LL | id_usize(b16); - | ^^^ expected `usize`, found `u16` + | -------- ^^^ expected `usize`, found `u16` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:31:8 + | +LL | fn id_usize(n: usize) -> usize { n } + | ^^^^^^^^ -------- help: you can convert a `u16` to a `usize` | LL | id_usize(b16.into()); @@ -552,8 +902,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:213:14 | LL | id_usize(b32); - | ^^^ expected `usize`, found `u32` + | -------- ^^^ expected `usize`, found `u32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:31:8 | +LL | fn id_usize(n: usize) -> usize { n } + | ^^^^^^^^ -------- help: you can convert a `u32` to a `usize` and panic if the converted value doesn't fit | LL | id_usize(b32.try_into().unwrap()); @@ -563,8 +920,15 @@ error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:216:14 | LL | id_usize(b64); - | ^^^ expected `usize`, found `u64` + | -------- ^^^ expected `usize`, found `u64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/integer-literal-suffix-inference.rs:31:8 | +LL | fn id_usize(n: usize) -> usize { n } + | ^^^^^^^^ -------- help: you can convert a `u64` to a `usize` and panic if the converted value doesn't fit | LL | id_usize(b64.try_into().unwrap()); diff --git a/src/test/ui/numeric/len.stderr b/src/test/ui/numeric/len.stderr index 6319c1ead24..55a61b5e443 100644 --- a/src/test/ui/numeric/len.stderr +++ b/src/test/ui/numeric/len.stderr @@ -2,8 +2,15 @@ error[E0308]: mismatched types --> $DIR/len.rs:3:10 | LL | test(array.len()); - | ^^^^^^^^^^^ expected `u32`, found `usize` + | ---- ^^^^^^^^^^^ expected `u32`, found `usize` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/len.rs:6:4 + | +LL | fn test(length: u32) { + | ^^^^ ----------- help: you can convert a `usize` to a `u32` and panic if the converted value doesn't fit | LL | test(array.len().try_into().unwrap()); diff --git a/src/test/ui/numeric/numeric-cast-without-suggestion.stderr b/src/test/ui/numeric/numeric-cast-without-suggestion.stderr index a96518a3434..581b548abca 100644 --- a/src/test/ui/numeric/numeric-cast-without-suggestion.stderr +++ b/src/test/ui/numeric/numeric-cast-without-suggestion.stderr @@ -2,127 +2,295 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:17:18 | LL | foo::<usize>(x_f64); - | ^^^^^ expected `usize`, found `f64` + | ------------ ^^^^^ expected `usize`, found `f64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast-without-suggestion.rs:1:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:18:18 | LL | foo::<usize>(x_f32); - | ^^^^^ expected `usize`, found `f32` + | ------------ ^^^^^ expected `usize`, found `f32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast-without-suggestion.rs:1:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:19:18 | LL | foo::<isize>(x_f64); - | ^^^^^ expected `isize`, found `f64` + | ------------ ^^^^^ expected `isize`, found `f64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast-without-suggestion.rs:1:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:20:18 | LL | foo::<isize>(x_f32); - | ^^^^^ expected `isize`, found `f32` + | ------------ ^^^^^ expected `isize`, found `f32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast-without-suggestion.rs:1:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:21:16 | LL | foo::<u64>(x_f64); - | ^^^^^ expected `u64`, found `f64` + | ---------- ^^^^^ expected `u64`, found `f64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast-without-suggestion.rs:1:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:22:16 | LL | foo::<u64>(x_f32); - | ^^^^^ expected `u64`, found `f32` + | ---------- ^^^^^ expected `u64`, found `f32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast-without-suggestion.rs:1:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:23:16 | LL | foo::<i64>(x_f64); - | ^^^^^ expected `i64`, found `f64` + | ---------- ^^^^^ expected `i64`, found `f64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast-without-suggestion.rs:1:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:24:16 | LL | foo::<i64>(x_f32); - | ^^^^^ expected `i64`, found `f32` + | ---------- ^^^^^ expected `i64`, found `f32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast-without-suggestion.rs:1:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:25:16 | LL | foo::<u32>(x_f64); - | ^^^^^ expected `u32`, found `f64` + | ---------- ^^^^^ expected `u32`, found `f64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast-without-suggestion.rs:1:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:26:16 | LL | foo::<u32>(x_f32); - | ^^^^^ expected `u32`, found `f32` + | ---------- ^^^^^ expected `u32`, found `f32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast-without-suggestion.rs:1:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:27:16 | LL | foo::<i32>(x_f64); - | ^^^^^ expected `i32`, found `f64` + | ---------- ^^^^^ expected `i32`, found `f64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast-without-suggestion.rs:1:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:28:16 | LL | foo::<i32>(x_f32); - | ^^^^^ expected `i32`, found `f32` + | ---------- ^^^^^ expected `i32`, found `f32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast-without-suggestion.rs:1:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:29:16 | LL | foo::<u16>(x_f64); - | ^^^^^ expected `u16`, found `f64` + | ---------- ^^^^^ expected `u16`, found `f64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast-without-suggestion.rs:1:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:30:16 | LL | foo::<u16>(x_f32); - | ^^^^^ expected `u16`, found `f32` + | ---------- ^^^^^ expected `u16`, found `f32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast-without-suggestion.rs:1:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:31:16 | LL | foo::<i16>(x_f64); - | ^^^^^ expected `i16`, found `f64` + | ---------- ^^^^^ expected `i16`, found `f64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast-without-suggestion.rs:1:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:32:16 | LL | foo::<i16>(x_f32); - | ^^^^^ expected `i16`, found `f32` + | ---------- ^^^^^ expected `i16`, found `f32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast-without-suggestion.rs:1:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:33:15 | LL | foo::<u8>(x_f64); - | ^^^^^ expected `u8`, found `f64` + | --------- ^^^^^ expected `u8`, found `f64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast-without-suggestion.rs:1:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:34:15 | LL | foo::<u8>(x_f32); - | ^^^^^ expected `u8`, found `f32` + | --------- ^^^^^ expected `u8`, found `f32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast-without-suggestion.rs:1:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:35:15 | LL | foo::<i8>(x_f64); - | ^^^^^ expected `i8`, found `f64` + | --------- ^^^^^ expected `i8`, found `f64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast-without-suggestion.rs:1:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:36:15 | LL | foo::<i8>(x_f32); - | ^^^^^ expected `i8`, found `f32` + | --------- ^^^^^ expected `i8`, found `f32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast-without-suggestion.rs:1:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- error[E0308]: mismatched types --> $DIR/numeric-cast-without-suggestion.rs:37:16 | LL | foo::<f32>(x_f64); - | ^^^^^ expected `f32`, found `f64` + | ---------- ^^^^^ expected `f32`, found `f64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast-without-suggestion.rs:1:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- error: aborting due to 21 previous errors diff --git a/src/test/ui/numeric/numeric-cast.stderr b/src/test/ui/numeric/numeric-cast.stderr index b8f2d88ab49..d347875d5a9 100644 --- a/src/test/ui/numeric/numeric-cast.stderr +++ b/src/test/ui/numeric/numeric-cast.stderr @@ -2,8 +2,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:23:18 | LL | foo::<usize>(x_u64); - | ^^^^^ expected `usize`, found `u64` + | ------------ ^^^^^ expected `usize`, found `u64` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u64` to a `usize` and panic if the converted value doesn't fit | LL | foo::<usize>(x_u64.try_into().unwrap()); @@ -13,8 +20,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:25:18 | LL | foo::<usize>(x_u32); - | ^^^^^ expected `usize`, found `u32` + | ------------ ^^^^^ expected `usize`, found `u32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u32` to a `usize` and panic if the converted value doesn't fit | LL | foo::<usize>(x_u32.try_into().unwrap()); @@ -24,8 +38,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:27:18 | LL | foo::<usize>(x_u16); - | ^^^^^ expected `usize`, found `u16` + | ------------ ^^^^^ expected `usize`, found `u16` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u16` to a `usize` | LL | foo::<usize>(x_u16.into()); @@ -35,8 +56,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:29:18 | LL | foo::<usize>(x_u8); - | ^^^^ expected `usize`, found `u8` + | ------------ ^^^^ expected `usize`, found `u8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u8` to a `usize` | LL | foo::<usize>(x_u8.into()); @@ -46,8 +74,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:31:18 | LL | foo::<usize>(x_isize); - | ^^^^^^^ expected `usize`, found `isize` + | ------------ ^^^^^^^ expected `usize`, found `isize` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `isize` to a `usize` and panic if the converted value doesn't fit | LL | foo::<usize>(x_isize.try_into().unwrap()); @@ -57,8 +92,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:33:18 | LL | foo::<usize>(x_i64); - | ^^^^^ expected `usize`, found `i64` + | ------------ ^^^^^ expected `usize`, found `i64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i64` to a `usize` and panic if the converted value doesn't fit | LL | foo::<usize>(x_i64.try_into().unwrap()); @@ -68,8 +110,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:35:18 | LL | foo::<usize>(x_i32); - | ^^^^^ expected `usize`, found `i32` + | ------------ ^^^^^ expected `usize`, found `i32` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i32` to a `usize` and panic if the converted value doesn't fit | LL | foo::<usize>(x_i32.try_into().unwrap()); @@ -79,8 +128,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:37:18 | LL | foo::<usize>(x_i16); - | ^^^^^ expected `usize`, found `i16` + | ------------ ^^^^^ expected `usize`, found `i16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i16` to a `usize` and panic if the converted value doesn't fit | LL | foo::<usize>(x_i16.try_into().unwrap()); @@ -90,8 +146,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:39:18 | LL | foo::<usize>(x_i8); - | ^^^^ expected `usize`, found `i8` + | ------------ ^^^^ expected `usize`, found `i8` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i8` to a `usize` and panic if the converted value doesn't fit | LL | foo::<usize>(x_i8.try_into().unwrap()); @@ -101,8 +164,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:44:18 | LL | foo::<isize>(x_usize); - | ^^^^^^^ expected `isize`, found `usize` + | ------------ ^^^^^^^ expected `isize`, found `usize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `usize` to an `isize` and panic if the converted value doesn't fit | LL | foo::<isize>(x_usize.try_into().unwrap()); @@ -112,8 +182,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:46:18 | LL | foo::<isize>(x_u64); - | ^^^^^ expected `isize`, found `u64` + | ------------ ^^^^^ expected `isize`, found `u64` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u64` to an `isize` and panic if the converted value doesn't fit | LL | foo::<isize>(x_u64.try_into().unwrap()); @@ -123,8 +200,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:48:18 | LL | foo::<isize>(x_u32); - | ^^^^^ expected `isize`, found `u32` + | ------------ ^^^^^ expected `isize`, found `u32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u32` to an `isize` and panic if the converted value doesn't fit | LL | foo::<isize>(x_u32.try_into().unwrap()); @@ -134,8 +218,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:50:18 | LL | foo::<isize>(x_u16); - | ^^^^^ expected `isize`, found `u16` + | ------------ ^^^^^ expected `isize`, found `u16` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u16` to an `isize` and panic if the converted value doesn't fit | LL | foo::<isize>(x_u16.try_into().unwrap()); @@ -145,8 +236,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:52:18 | LL | foo::<isize>(x_u8); - | ^^^^ expected `isize`, found `u8` + | ------------ ^^^^ expected `isize`, found `u8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u8` to an `isize` | LL | foo::<isize>(x_u8.into()); @@ -156,8 +254,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:55:18 | LL | foo::<isize>(x_i64); - | ^^^^^ expected `isize`, found `i64` + | ------------ ^^^^^ expected `isize`, found `i64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i64` to an `isize` and panic if the converted value doesn't fit | LL | foo::<isize>(x_i64.try_into().unwrap()); @@ -167,8 +272,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:57:18 | LL | foo::<isize>(x_i32); - | ^^^^^ expected `isize`, found `i32` + | ------------ ^^^^^ expected `isize`, found `i32` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i32` to an `isize` and panic if the converted value doesn't fit | LL | foo::<isize>(x_i32.try_into().unwrap()); @@ -178,8 +290,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:59:18 | LL | foo::<isize>(x_i16); - | ^^^^^ expected `isize`, found `i16` + | ------------ ^^^^^ expected `isize`, found `i16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i16` to an `isize` | LL | foo::<isize>(x_i16.into()); @@ -189,8 +308,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:61:18 | LL | foo::<isize>(x_i8); - | ^^^^ expected `isize`, found `i8` + | ------------ ^^^^ expected `isize`, found `i8` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i8` to an `isize` | LL | foo::<isize>(x_i8.into()); @@ -200,8 +326,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:66:16 | LL | foo::<u64>(x_usize); - | ^^^^^^^ expected `u64`, found `usize` + | ---------- ^^^^^^^ expected `u64`, found `usize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `usize` to a `u64` and panic if the converted value doesn't fit | LL | foo::<u64>(x_usize.try_into().unwrap()); @@ -211,8 +344,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:69:16 | LL | foo::<u64>(x_u32); - | ^^^^^ expected `u64`, found `u32` + | ---------- ^^^^^ expected `u64`, found `u32` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u32` to a `u64` | LL | foo::<u64>(x_u32.into()); @@ -222,8 +362,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:71:16 | LL | foo::<u64>(x_u16); - | ^^^^^ expected `u64`, found `u16` + | ---------- ^^^^^ expected `u64`, found `u16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u16` to a `u64` | LL | foo::<u64>(x_u16.into()); @@ -233,8 +380,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:73:16 | LL | foo::<u64>(x_u8); - | ^^^^ expected `u64`, found `u8` + | ---------- ^^^^ expected `u64`, found `u8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u8` to a `u64` | LL | foo::<u64>(x_u8.into()); @@ -244,8 +398,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:75:16 | LL | foo::<u64>(x_isize); - | ^^^^^^^ expected `u64`, found `isize` + | ---------- ^^^^^^^ expected `u64`, found `isize` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `isize` to a `u64` and panic if the converted value doesn't fit | LL | foo::<u64>(x_isize.try_into().unwrap()); @@ -255,8 +416,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:77:16 | LL | foo::<u64>(x_i64); - | ^^^^^ expected `u64`, found `i64` + | ---------- ^^^^^ expected `u64`, found `i64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i64` to a `u64` and panic if the converted value doesn't fit | LL | foo::<u64>(x_i64.try_into().unwrap()); @@ -266,8 +434,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:79:16 | LL | foo::<u64>(x_i32); - | ^^^^^ expected `u64`, found `i32` + | ---------- ^^^^^ expected `u64`, found `i32` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i32` to a `u64` and panic if the converted value doesn't fit | LL | foo::<u64>(x_i32.try_into().unwrap()); @@ -277,8 +452,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:81:16 | LL | foo::<u64>(x_i16); - | ^^^^^ expected `u64`, found `i16` + | ---------- ^^^^^ expected `u64`, found `i16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i16` to a `u64` and panic if the converted value doesn't fit | LL | foo::<u64>(x_i16.try_into().unwrap()); @@ -288,8 +470,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:83:16 | LL | foo::<u64>(x_i8); - | ^^^^ expected `u64`, found `i8` + | ---------- ^^^^ expected `u64`, found `i8` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i8` to a `u64` and panic if the converted value doesn't fit | LL | foo::<u64>(x_i8.try_into().unwrap()); @@ -299,8 +488,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:88:16 | LL | foo::<i64>(x_usize); - | ^^^^^^^ expected `i64`, found `usize` + | ---------- ^^^^^^^ expected `i64`, found `usize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `usize` to an `i64` and panic if the converted value doesn't fit | LL | foo::<i64>(x_usize.try_into().unwrap()); @@ -310,8 +506,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:90:16 | LL | foo::<i64>(x_u64); - | ^^^^^ expected `i64`, found `u64` + | ---------- ^^^^^ expected `i64`, found `u64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u64` to an `i64` and panic if the converted value doesn't fit | LL | foo::<i64>(x_u64.try_into().unwrap()); @@ -321,8 +524,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:92:16 | LL | foo::<i64>(x_u32); - | ^^^^^ expected `i64`, found `u32` + | ---------- ^^^^^ expected `i64`, found `u32` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u32` to an `i64` | LL | foo::<i64>(x_u32.into()); @@ -332,8 +542,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:94:16 | LL | foo::<i64>(x_u16); - | ^^^^^ expected `i64`, found `u16` + | ---------- ^^^^^ expected `i64`, found `u16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u16` to an `i64` | LL | foo::<i64>(x_u16.into()); @@ -343,8 +560,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:96:16 | LL | foo::<i64>(x_u8); - | ^^^^ expected `i64`, found `u8` + | ---------- ^^^^ expected `i64`, found `u8` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u8` to an `i64` | LL | foo::<i64>(x_u8.into()); @@ -354,8 +578,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:98:16 | LL | foo::<i64>(x_isize); - | ^^^^^^^ expected `i64`, found `isize` + | ---------- ^^^^^^^ expected `i64`, found `isize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `isize` to an `i64` and panic if the converted value doesn't fit | LL | foo::<i64>(x_isize.try_into().unwrap()); @@ -365,8 +596,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:101:16 | LL | foo::<i64>(x_i32); - | ^^^^^ expected `i64`, found `i32` + | ---------- ^^^^^ expected `i64`, found `i32` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i32` to an `i64` | LL | foo::<i64>(x_i32.into()); @@ -376,8 +614,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:103:16 | LL | foo::<i64>(x_i16); - | ^^^^^ expected `i64`, found `i16` + | ---------- ^^^^^ expected `i64`, found `i16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i16` to an `i64` | LL | foo::<i64>(x_i16.into()); @@ -387,8 +632,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:105:16 | LL | foo::<i64>(x_i8); - | ^^^^ expected `i64`, found `i8` + | ---------- ^^^^ expected `i64`, found `i8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i8` to an `i64` | LL | foo::<i64>(x_i8.into()); @@ -398,8 +650,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:110:16 | LL | foo::<u32>(x_usize); - | ^^^^^^^ expected `u32`, found `usize` + | ---------- ^^^^^^^ expected `u32`, found `usize` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `usize` to a `u32` and panic if the converted value doesn't fit | LL | foo::<u32>(x_usize.try_into().unwrap()); @@ -409,8 +668,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:112:16 | LL | foo::<u32>(x_u64); - | ^^^^^ expected `u32`, found `u64` + | ---------- ^^^^^ expected `u32`, found `u64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u64` to a `u32` and panic if the converted value doesn't fit | LL | foo::<u32>(x_u64.try_into().unwrap()); @@ -420,8 +686,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:115:16 | LL | foo::<u32>(x_u16); - | ^^^^^ expected `u32`, found `u16` + | ---------- ^^^^^ expected `u32`, found `u16` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u16` to a `u32` | LL | foo::<u32>(x_u16.into()); @@ -431,8 +704,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:117:16 | LL | foo::<u32>(x_u8); - | ^^^^ expected `u32`, found `u8` + | ---------- ^^^^ expected `u32`, found `u8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u8` to a `u32` | LL | foo::<u32>(x_u8.into()); @@ -442,8 +722,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:119:16 | LL | foo::<u32>(x_isize); - | ^^^^^^^ expected `u32`, found `isize` + | ---------- ^^^^^^^ expected `u32`, found `isize` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `isize` to a `u32` and panic if the converted value doesn't fit | LL | foo::<u32>(x_isize.try_into().unwrap()); @@ -453,8 +740,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:121:16 | LL | foo::<u32>(x_i64); - | ^^^^^ expected `u32`, found `i64` + | ---------- ^^^^^ expected `u32`, found `i64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i64` to a `u32` and panic if the converted value doesn't fit | LL | foo::<u32>(x_i64.try_into().unwrap()); @@ -464,8 +758,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:123:16 | LL | foo::<u32>(x_i32); - | ^^^^^ expected `u32`, found `i32` + | ---------- ^^^^^ expected `u32`, found `i32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i32` to a `u32` and panic if the converted value doesn't fit | LL | foo::<u32>(x_i32.try_into().unwrap()); @@ -475,8 +776,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:125:16 | LL | foo::<u32>(x_i16); - | ^^^^^ expected `u32`, found `i16` + | ---------- ^^^^^ expected `u32`, found `i16` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i16` to a `u32` and panic if the converted value doesn't fit | LL | foo::<u32>(x_i16.try_into().unwrap()); @@ -486,8 +794,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:127:16 | LL | foo::<u32>(x_i8); - | ^^^^ expected `u32`, found `i8` + | ---------- ^^^^ expected `u32`, found `i8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i8` to a `u32` and panic if the converted value doesn't fit | LL | foo::<u32>(x_i8.try_into().unwrap()); @@ -497,8 +812,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:132:16 | LL | foo::<i32>(x_usize); - | ^^^^^^^ expected `i32`, found `usize` + | ---------- ^^^^^^^ expected `i32`, found `usize` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `usize` to an `i32` and panic if the converted value doesn't fit | LL | foo::<i32>(x_usize.try_into().unwrap()); @@ -508,8 +830,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:134:16 | LL | foo::<i32>(x_u64); - | ^^^^^ expected `i32`, found `u64` + | ---------- ^^^^^ expected `i32`, found `u64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u64` to an `i32` and panic if the converted value doesn't fit | LL | foo::<i32>(x_u64.try_into().unwrap()); @@ -519,8 +848,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:136:16 | LL | foo::<i32>(x_u32); - | ^^^^^ expected `i32`, found `u32` + | ---------- ^^^^^ expected `i32`, found `u32` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u32` to an `i32` and panic if the converted value doesn't fit | LL | foo::<i32>(x_u32.try_into().unwrap()); @@ -530,8 +866,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:138:16 | LL | foo::<i32>(x_u16); - | ^^^^^ expected `i32`, found `u16` + | ---------- ^^^^^ expected `i32`, found `u16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u16` to an `i32` | LL | foo::<i32>(x_u16.into()); @@ -541,8 +884,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:140:16 | LL | foo::<i32>(x_u8); - | ^^^^ expected `i32`, found `u8` + | ---------- ^^^^ expected `i32`, found `u8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u8` to an `i32` | LL | foo::<i32>(x_u8.into()); @@ -552,8 +902,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:142:16 | LL | foo::<i32>(x_isize); - | ^^^^^^^ expected `i32`, found `isize` + | ---------- ^^^^^^^ expected `i32`, found `isize` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `isize` to an `i32` and panic if the converted value doesn't fit | LL | foo::<i32>(x_isize.try_into().unwrap()); @@ -563,8 +920,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:144:16 | LL | foo::<i32>(x_i64); - | ^^^^^ expected `i32`, found `i64` + | ---------- ^^^^^ expected `i32`, found `i64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i64` to an `i32` and panic if the converted value doesn't fit | LL | foo::<i32>(x_i64.try_into().unwrap()); @@ -574,8 +938,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:147:16 | LL | foo::<i32>(x_i16); - | ^^^^^ expected `i32`, found `i16` + | ---------- ^^^^^ expected `i32`, found `i16` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i16` to an `i32` | LL | foo::<i32>(x_i16.into()); @@ -585,8 +956,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:149:16 | LL | foo::<i32>(x_i8); - | ^^^^ expected `i32`, found `i8` + | ---------- ^^^^ expected `i32`, found `i8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i8` to an `i32` | LL | foo::<i32>(x_i8.into()); @@ -596,8 +974,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:154:16 | LL | foo::<u16>(x_usize); - | ^^^^^^^ expected `u16`, found `usize` + | ---------- ^^^^^^^ expected `u16`, found `usize` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `usize` to a `u16` and panic if the converted value doesn't fit | LL | foo::<u16>(x_usize.try_into().unwrap()); @@ -607,8 +992,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:156:16 | LL | foo::<u16>(x_u64); - | ^^^^^ expected `u16`, found `u64` + | ---------- ^^^^^ expected `u16`, found `u64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u64` to a `u16` and panic if the converted value doesn't fit | LL | foo::<u16>(x_u64.try_into().unwrap()); @@ -618,8 +1010,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:158:16 | LL | foo::<u16>(x_u32); - | ^^^^^ expected `u16`, found `u32` + | ---------- ^^^^^ expected `u16`, found `u32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u32` to a `u16` and panic if the converted value doesn't fit | LL | foo::<u16>(x_u32.try_into().unwrap()); @@ -629,8 +1028,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:161:16 | LL | foo::<u16>(x_u8); - | ^^^^ expected `u16`, found `u8` + | ---------- ^^^^ expected `u16`, found `u8` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u8` to a `u16` | LL | foo::<u16>(x_u8.into()); @@ -640,8 +1046,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:163:16 | LL | foo::<u16>(x_isize); - | ^^^^^^^ expected `u16`, found `isize` + | ---------- ^^^^^^^ expected `u16`, found `isize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `isize` to a `u16` and panic if the converted value doesn't fit | LL | foo::<u16>(x_isize.try_into().unwrap()); @@ -651,8 +1064,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:165:16 | LL | foo::<u16>(x_i64); - | ^^^^^ expected `u16`, found `i64` + | ---------- ^^^^^ expected `u16`, found `i64` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i64` to a `u16` and panic if the converted value doesn't fit | LL | foo::<u16>(x_i64.try_into().unwrap()); @@ -662,8 +1082,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:167:16 | LL | foo::<u16>(x_i32); - | ^^^^^ expected `u16`, found `i32` + | ---------- ^^^^^ expected `u16`, found `i32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i32` to a `u16` and panic if the converted value doesn't fit | LL | foo::<u16>(x_i32.try_into().unwrap()); @@ -673,8 +1100,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:169:16 | LL | foo::<u16>(x_i16); - | ^^^^^ expected `u16`, found `i16` + | ---------- ^^^^^ expected `u16`, found `i16` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i16` to a `u16` and panic if the converted value doesn't fit | LL | foo::<u16>(x_i16.try_into().unwrap()); @@ -684,8 +1118,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:171:16 | LL | foo::<u16>(x_i8); - | ^^^^ expected `u16`, found `i8` + | ---------- ^^^^ expected `u16`, found `i8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i8` to a `u16` and panic if the converted value doesn't fit | LL | foo::<u16>(x_i8.try_into().unwrap()); @@ -695,8 +1136,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:176:16 | LL | foo::<i16>(x_usize); - | ^^^^^^^ expected `i16`, found `usize` + | ---------- ^^^^^^^ expected `i16`, found `usize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `usize` to an `i16` and panic if the converted value doesn't fit | LL | foo::<i16>(x_usize.try_into().unwrap()); @@ -706,8 +1154,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:178:16 | LL | foo::<i16>(x_u64); - | ^^^^^ expected `i16`, found `u64` + | ---------- ^^^^^ expected `i16`, found `u64` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u64` to an `i16` and panic if the converted value doesn't fit | LL | foo::<i16>(x_u64.try_into().unwrap()); @@ -717,8 +1172,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:180:16 | LL | foo::<i16>(x_u32); - | ^^^^^ expected `i16`, found `u32` + | ---------- ^^^^^ expected `i16`, found `u32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u32` to an `i16` and panic if the converted value doesn't fit | LL | foo::<i16>(x_u32.try_into().unwrap()); @@ -728,8 +1190,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:182:16 | LL | foo::<i16>(x_u16); - | ^^^^^ expected `i16`, found `u16` + | ---------- ^^^^^ expected `i16`, found `u16` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u16` to an `i16` and panic if the converted value doesn't fit | LL | foo::<i16>(x_u16.try_into().unwrap()); @@ -739,8 +1208,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:184:16 | LL | foo::<i16>(x_u8); - | ^^^^ expected `i16`, found `u8` + | ---------- ^^^^ expected `i16`, found `u8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u8` to an `i16` | LL | foo::<i16>(x_u8.into()); @@ -750,8 +1226,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:186:16 | LL | foo::<i16>(x_isize); - | ^^^^^^^ expected `i16`, found `isize` + | ---------- ^^^^^^^ expected `i16`, found `isize` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `isize` to an `i16` and panic if the converted value doesn't fit | LL | foo::<i16>(x_isize.try_into().unwrap()); @@ -761,8 +1244,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:188:16 | LL | foo::<i16>(x_i64); - | ^^^^^ expected `i16`, found `i64` + | ---------- ^^^^^ expected `i16`, found `i64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i64` to an `i16` and panic if the converted value doesn't fit | LL | foo::<i16>(x_i64.try_into().unwrap()); @@ -772,8 +1262,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:190:16 | LL | foo::<i16>(x_i32); - | ^^^^^ expected `i16`, found `i32` + | ---------- ^^^^^ expected `i16`, found `i32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i32` to an `i16` and panic if the converted value doesn't fit | LL | foo::<i16>(x_i32.try_into().unwrap()); @@ -783,8 +1280,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:193:16 | LL | foo::<i16>(x_i8); - | ^^^^ expected `i16`, found `i8` + | ---------- ^^^^ expected `i16`, found `i8` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i8` to an `i16` | LL | foo::<i16>(x_i8.into()); @@ -794,8 +1298,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:198:15 | LL | foo::<u8>(x_usize); - | ^^^^^^^ expected `u8`, found `usize` + | --------- ^^^^^^^ expected `u8`, found `usize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `usize` to a `u8` and panic if the converted value doesn't fit | LL | foo::<u8>(x_usize.try_into().unwrap()); @@ -805,8 +1316,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:200:15 | LL | foo::<u8>(x_u64); - | ^^^^^ expected `u8`, found `u64` + | --------- ^^^^^ expected `u8`, found `u64` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u64` to a `u8` and panic if the converted value doesn't fit | LL | foo::<u8>(x_u64.try_into().unwrap()); @@ -816,8 +1334,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:202:15 | LL | foo::<u8>(x_u32); - | ^^^^^ expected `u8`, found `u32` + | --------- ^^^^^ expected `u8`, found `u32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u32` to a `u8` and panic if the converted value doesn't fit | LL | foo::<u8>(x_u32.try_into().unwrap()); @@ -827,8 +1352,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:204:15 | LL | foo::<u8>(x_u16); - | ^^^^^ expected `u8`, found `u16` + | --------- ^^^^^ expected `u8`, found `u16` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u16` to a `u8` and panic if the converted value doesn't fit | LL | foo::<u8>(x_u16.try_into().unwrap()); @@ -838,8 +1370,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:207:15 | LL | foo::<u8>(x_isize); - | ^^^^^^^ expected `u8`, found `isize` + | --------- ^^^^^^^ expected `u8`, found `isize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `isize` to a `u8` and panic if the converted value doesn't fit | LL | foo::<u8>(x_isize.try_into().unwrap()); @@ -849,8 +1388,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:209:15 | LL | foo::<u8>(x_i64); - | ^^^^^ expected `u8`, found `i64` + | --------- ^^^^^ expected `u8`, found `i64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i64` to a `u8` and panic if the converted value doesn't fit | LL | foo::<u8>(x_i64.try_into().unwrap()); @@ -860,8 +1406,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:211:15 | LL | foo::<u8>(x_i32); - | ^^^^^ expected `u8`, found `i32` + | --------- ^^^^^ expected `u8`, found `i32` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i32` to a `u8` and panic if the converted value doesn't fit | LL | foo::<u8>(x_i32.try_into().unwrap()); @@ -871,8 +1424,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:213:15 | LL | foo::<u8>(x_i16); - | ^^^^^ expected `u8`, found `i16` + | --------- ^^^^^ expected `u8`, found `i16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i16` to a `u8` and panic if the converted value doesn't fit | LL | foo::<u8>(x_i16.try_into().unwrap()); @@ -882,8 +1442,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:215:15 | LL | foo::<u8>(x_i8); - | ^^^^ expected `u8`, found `i8` + | --------- ^^^^ expected `u8`, found `i8` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i8` to a `u8` and panic if the converted value doesn't fit | LL | foo::<u8>(x_i8.try_into().unwrap()); @@ -893,8 +1460,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:220:15 | LL | foo::<i8>(x_usize); - | ^^^^^^^ expected `i8`, found `usize` + | --------- ^^^^^^^ expected `i8`, found `usize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `usize` to an `i8` and panic if the converted value doesn't fit | LL | foo::<i8>(x_usize.try_into().unwrap()); @@ -904,8 +1478,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:222:15 | LL | foo::<i8>(x_u64); - | ^^^^^ expected `i8`, found `u64` + | --------- ^^^^^ expected `i8`, found `u64` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u64` to an `i8` and panic if the converted value doesn't fit | LL | foo::<i8>(x_u64.try_into().unwrap()); @@ -915,8 +1496,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:224:15 | LL | foo::<i8>(x_u32); - | ^^^^^ expected `i8`, found `u32` + | --------- ^^^^^ expected `i8`, found `u32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u32` to an `i8` and panic if the converted value doesn't fit | LL | foo::<i8>(x_u32.try_into().unwrap()); @@ -926,8 +1514,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:226:15 | LL | foo::<i8>(x_u16); - | ^^^^^ expected `i8`, found `u16` + | --------- ^^^^^ expected `i8`, found `u16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u16` to an `i8` and panic if the converted value doesn't fit | LL | foo::<i8>(x_u16.try_into().unwrap()); @@ -937,8 +1532,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:228:15 | LL | foo::<i8>(x_u8); - | ^^^^ expected `i8`, found `u8` + | --------- ^^^^ expected `i8`, found `u8` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u8` to an `i8` and panic if the converted value doesn't fit | LL | foo::<i8>(x_u8.try_into().unwrap()); @@ -948,8 +1550,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:230:15 | LL | foo::<i8>(x_isize); - | ^^^^^^^ expected `i8`, found `isize` + | --------- ^^^^^^^ expected `i8`, found `isize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `isize` to an `i8` and panic if the converted value doesn't fit | LL | foo::<i8>(x_isize.try_into().unwrap()); @@ -959,8 +1568,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:232:15 | LL | foo::<i8>(x_i64); - | ^^^^^ expected `i8`, found `i64` + | --------- ^^^^^ expected `i8`, found `i64` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i64` to an `i8` and panic if the converted value doesn't fit | LL | foo::<i8>(x_i64.try_into().unwrap()); @@ -970,8 +1586,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:234:15 | LL | foo::<i8>(x_i32); - | ^^^^^ expected `i8`, found `i32` + | --------- ^^^^^ expected `i8`, found `i32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i32` to an `i8` and panic if the converted value doesn't fit | LL | foo::<i8>(x_i32.try_into().unwrap()); @@ -981,8 +1604,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:236:15 | LL | foo::<i8>(x_i16); - | ^^^^^ expected `i8`, found `i16` + | --------- ^^^^^ expected `i8`, found `i16` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i16` to an `i8` and panic if the converted value doesn't fit | LL | foo::<i8>(x_i16.try_into().unwrap()); @@ -992,8 +1622,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:242:16 | LL | foo::<f64>(x_usize); - | ^^^^^^^ expected `f64`, found `usize` + | ---------- ^^^^^^^ expected `f64`, found `usize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can cast a `usize` to an `f64`, producing the floating point representation of the integer, rounded if necessary | LL | foo::<f64>(x_usize as f64); @@ -1003,8 +1640,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:244:16 | LL | foo::<f64>(x_u64); - | ^^^^^ expected `f64`, found `u64` + | ---------- ^^^^^ expected `f64`, found `u64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can cast a `u64` to an `f64`, producing the floating point representation of the integer, rounded if necessary | LL | foo::<f64>(x_u64 as f64); @@ -1014,8 +1658,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:246:16 | LL | foo::<f64>(x_u32); - | ^^^^^ expected `f64`, found `u32` + | ---------- ^^^^^ expected `f64`, found `u32` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6: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>(x_u32.into()); @@ -1025,8 +1676,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:248:16 | LL | foo::<f64>(x_u16); - | ^^^^^ expected `f64`, found `u16` + | ---------- ^^^^^ expected `f64`, found `u16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6: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>(x_u16.into()); @@ -1036,8 +1694,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:250:16 | LL | foo::<f64>(x_u8); - | ^^^^ expected `f64`, found `u8` + | ---------- ^^^^ expected `f64`, found `u8` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6: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>(x_u8.into()); @@ -1047,8 +1712,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:252:16 | LL | foo::<f64>(x_isize); - | ^^^^^^^ expected `f64`, found `isize` + | ---------- ^^^^^^^ expected `f64`, found `isize` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `isize` to an `f64`, producing the floating point representation of the integer, rounded if necessary | LL | foo::<f64>(x_isize as f64); @@ -1058,8 +1730,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:254:16 | LL | foo::<f64>(x_i64); - | ^^^^^ expected `f64`, found `i64` + | ---------- ^^^^^ expected `f64`, found `i64` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i64` to an `f64`, producing the floating point representation of the integer, rounded if necessary | LL | foo::<f64>(x_i64 as f64); @@ -1069,8 +1748,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:256:16 | LL | foo::<f64>(x_i32); - | ^^^^^ expected `f64`, found `i32` + | ---------- ^^^^^ expected `f64`, found `i32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6: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>(x_i32.into()); @@ -1080,8 +1766,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:258:16 | LL | foo::<f64>(x_i16); - | ^^^^^ expected `f64`, found `i16` + | ---------- ^^^^^ expected `f64`, found `i16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6: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>(x_i16.into()); @@ -1091,8 +1784,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:260:16 | LL | foo::<f64>(x_i8); - | ^^^^ expected `f64`, found `i8` + | ---------- ^^^^ expected `f64`, found `i8` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6: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>(x_i8.into()); @@ -1102,8 +1802,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:263:16 | LL | foo::<f64>(x_f32); - | ^^^^^ expected `f64`, found `f32` + | ---------- ^^^^^ expected `f64`, found `f32` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `f32` to an `f64` | LL | foo::<f64>(x_f32.into()); @@ -1113,8 +1820,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:266:16 | LL | foo::<f32>(x_usize); - | ^^^^^^^ expected `f32`, found `usize` + | ---------- ^^^^^^^ expected `f32`, found `usize` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can cast a `usize` to an `f32`, producing the floating point representation of the integer, rounded if necessary | LL | foo::<f32>(x_usize as f32); @@ -1124,8 +1838,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:268:16 | LL | foo::<f32>(x_u64); - | ^^^^^ expected `f32`, found `u64` + | ---------- ^^^^^ expected `f32`, found `u64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can cast a `u64` to an `f32`, producing the floating point representation of the integer, rounded if necessary | LL | foo::<f32>(x_u64 as f32); @@ -1135,8 +1856,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:270:16 | LL | foo::<f32>(x_u32); - | ^^^^^ expected `f32`, found `u32` + | ---------- ^^^^^ expected `f32`, found `u32` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can cast a `u32` to an `f32`, producing the floating point representation of the integer, rounded if necessary | LL | foo::<f32>(x_u32 as f32); @@ -1146,8 +1874,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:272:16 | LL | foo::<f32>(x_u16); - | ^^^^^ expected `f32`, found `u16` + | ---------- ^^^^^ expected `f32`, found `u16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6: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>(x_u16.into()); @@ -1157,8 +1892,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:274:16 | LL | foo::<f32>(x_u8); - | ^^^^ expected `f32`, found `u8` + | ---------- ^^^^ expected `f32`, found `u8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6: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>(x_u8.into()); @@ -1168,8 +1910,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:276:16 | LL | foo::<f32>(x_isize); - | ^^^^^^^ expected `f32`, found `isize` + | ---------- ^^^^^^^ expected `f32`, found `isize` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `isize` to an `f32`, producing the floating point representation of the integer, rounded if necessary | LL | foo::<f32>(x_isize as f32); @@ -1179,8 +1928,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:278:16 | LL | foo::<f32>(x_i64); - | ^^^^^ expected `f32`, found `i64` + | ---------- ^^^^^ expected `f32`, found `i64` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i64` to an `f32`, producing the floating point representation of the integer, rounded if necessary | LL | foo::<f32>(x_i64 as f32); @@ -1190,8 +1946,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:280:16 | LL | foo::<f32>(x_i32); - | ^^^^^ expected `f32`, found `i32` + | ---------- ^^^^^ expected `f32`, found `i32` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 + | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i32` to an `f32`, producing the floating point representation of the integer, rounded if necessary | LL | foo::<f32>(x_i32 as f32); @@ -1201,8 +1964,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:282:16 | LL | foo::<f32>(x_i16); - | ^^^^^ expected `f32`, found `i16` + | ---------- ^^^^^ expected `f32`, found `i16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6: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>(x_i16.into()); @@ -1212,8 +1982,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:284:16 | LL | foo::<f32>(x_i8); - | ^^^^ expected `f32`, found `i8` + | ---------- ^^^^ expected `f32`, found `i8` + | | + | arguments to this function are incorrect | +note: function defined here + --> $DIR/numeric-cast.rs:6: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>(x_i8.into()); @@ -1223,8 +2000,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:289:16 | LL | foo::<u32>(x_u8 as u16); - | ^^^^^^^^^^^ expected `u32`, found `u16` + | ---------- ^^^^^^^^^^^ expected `u32`, found `u16` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert a `u16` to a `u32` | LL | foo::<u32>((x_u8 as u16).into()); @@ -1234,8 +2018,15 @@ error[E0308]: mismatched types --> $DIR/numeric-cast.rs:291:16 | LL | foo::<i32>(-x_i8); - | ^^^^^ expected `i32`, found `i8` + | ---------- ^^^^^ expected `i32`, found `i8` + | | + | arguments to this function are incorrect + | +note: function defined here + --> $DIR/numeric-cast.rs:6:4 | +LL | fn foo<N>(_x: N) {} + | ^^^ ----- help: you can convert an `i8` to an `i32` | LL | foo::<i32>((-x_i8).into()); diff --git a/src/test/ui/numeric/numeric-suffix.fixed b/src/test/ui/numeric/numeric-suffix.fixed deleted file mode 100644 index 53c5fe0f435..00000000000 --- a/src/test/ui/numeric/numeric-suffix.fixed +++ /dev/null @@ -1,298 +0,0 @@ -// run-rustfix - -fn foo<N>(_x: N) {} - -fn main() { - foo::<usize>(42_usize); - foo::<usize>(42_usize); - //~^ ERROR mismatched types - foo::<usize>(42_usize); - //~^ ERROR mismatched types - foo::<usize>(42_usize); - //~^ ERROR mismatched types - foo::<usize>(42_usize); - //~^ ERROR mismatched types - foo::<usize>(42_usize); - //~^ ERROR mismatched types - foo::<usize>(42_usize); - //~^ ERROR mismatched types - foo::<usize>(42_usize); - //~^ ERROR mismatched types - foo::<usize>(42_usize); - //~^ ERROR mismatched types - foo::<usize>(42_usize); - //~^ ERROR mismatched types - foo::<usize>(42usize); - //~^ ERROR mismatched types - foo::<usize>(42usize); - //~^ ERROR mismatched types - - foo::<isize>(42_isize); - //~^ ERROR mismatched types - foo::<isize>(42_isize); - //~^ ERROR mismatched types - foo::<isize>(42_isize); - //~^ ERROR mismatched types - foo::<isize>(42_isize); - //~^ ERROR mismatched types - foo::<isize>(42_isize); - //~^ ERROR mismatched types - foo::<isize>(42_isize); - foo::<isize>(42_isize); - //~^ ERROR mismatched types - foo::<isize>(42_isize); - //~^ ERROR mismatched types - foo::<isize>(42_isize); - //~^ ERROR mismatched types - foo::<isize>(42_isize); - //~^ ERROR mismatched types - foo::<isize>(42isize); - //~^ ERROR mismatched types - foo::<isize>(42isize); - //~^ ERROR mismatched types - - foo::<u64>(42_u64); - //~^ ERROR mismatched types - foo::<u64>(42_u64); - foo::<u64>(42_u64); - //~^ ERROR mismatched types - foo::<u64>(42_u64); - //~^ ERROR mismatched types - foo::<u64>(42_u64); - //~^ ERROR mismatched types - foo::<u64>(42_u64); - //~^ ERROR mismatched types - foo::<u64>(42_u64); - //~^ ERROR mismatched types - foo::<u64>(42_u64); - //~^ ERROR mismatched types - foo::<u64>(42_u64); - //~^ ERROR mismatched types - foo::<u64>(42_u64); - //~^ ERROR mismatched types - foo::<u64>(42u64); - //~^ ERROR mismatched types - foo::<u64>(42u64); - //~^ ERROR mismatched types - - foo::<i64>(42_i64); - //~^ ERROR mismatched types - foo::<i64>(42_i64); - //~^ ERROR mismatched types - foo::<i64>(42_i64); - //~^ ERROR mismatched types - foo::<i64>(42_i64); - //~^ ERROR mismatched types - foo::<i64>(42_i64); - //~^ ERROR mismatched types - foo::<i64>(42_i64); - //~^ ERROR mismatched types - foo::<i64>(42_i64); - foo::<i64>(42_i64); - //~^ ERROR mismatched types - foo::<i64>(42_i64); - //~^ ERROR mismatched types - foo::<i64>(42_i64); - //~^ ERROR mismatched types - foo::<i64>(42i64); - //~^ ERROR mismatched types - foo::<i64>(42i64); - //~^ ERROR mismatched types - - foo::<u32>(42_u32); - //~^ ERROR mismatched types - foo::<u32>(42_u32); - //~^ ERROR mismatched types - foo::<u32>(42_u32); - foo::<u32>(42_u32); - //~^ ERROR mismatched types - foo::<u32>(42_u32); - //~^ ERROR mismatched types - foo::<u32>(42_u32); - //~^ ERROR mismatched types - foo::<u32>(42_u32); - //~^ ERROR mismatched types - foo::<u32>(42_u32); - //~^ ERROR mismatched types - foo::<u32>(42_u32); - //~^ ERROR mismatched types - foo::<u32>(42_u32); - //~^ ERROR mismatched types - foo::<u32>(42u32); - //~^ ERROR mismatched types - foo::<u32>(42u32); - //~^ ERROR mismatched types - - foo::<i32>(42_i32); - //~^ ERROR mismatched types - foo::<i32>(42_i32); - //~^ ERROR mismatched types - foo::<i32>(42_i32); - //~^ ERROR mismatched types - foo::<i32>(42_i32); - //~^ ERROR mismatched types - foo::<i32>(42_i32); - //~^ ERROR mismatched types - foo::<i32>(42_i32); - //~^ ERROR mismatched types - foo::<i32>(42_i32); - //~^ ERROR mismatched types - foo::<i32>(42_i32); - foo::<i32>(42_i32); - //~^ ERROR mismatched types - foo::<i32>(42_i32); - //~^ ERROR mismatched types - foo::<i32>(42i32); - //~^ ERROR mismatched types - foo::<i32>(42i32); - //~^ ERROR mismatched types - - foo::<u16>(42_u16); - //~^ ERROR mismatched types - foo::<u16>(42_u16); - //~^ ERROR mismatched types - foo::<u16>(42_u16); - //~^ ERROR mismatched types - foo::<u16>(42_u16); - foo::<u16>(42_u16); - //~^ ERROR mismatched types - foo::<u16>(42_u16); - //~^ ERROR mismatched types - foo::<u16>(42_u16); - //~^ ERROR mismatched types - foo::<u16>(42_u16); - //~^ ERROR mismatched types - foo::<u16>(42_u16); - //~^ ERROR mismatched types - foo::<u16>(42_u16); - //~^ ERROR mismatched types - foo::<u16>(42u16); - //~^ ERROR mismatched types - foo::<u16>(42u16); - //~^ ERROR mismatched types - - foo::<i16>(42_i16); - //~^ ERROR mismatched types - foo::<i16>(42_i16); - //~^ ERROR mismatched types - foo::<i16>(42_i16); - //~^ ERROR mismatched types - foo::<i16>(42_i16); - //~^ ERROR mismatched types - foo::<i16>(42_i16); - //~^ ERROR mismatched types - foo::<i16>(42_i16); - //~^ ERROR mismatched types - foo::<i16>(42_i16); - //~^ ERROR mismatched types - foo::<i16>(42_i16); - //~^ ERROR mismatched types - foo::<i16>(42_i16); - foo::<i16>(42_i16); - //~^ ERROR mismatched types - foo::<i16>(42i16); - //~^ ERROR mismatched types - foo::<i16>(42i16); - //~^ ERROR mismatched types - - foo::<u8>(42_u8); - //~^ ERROR mismatched types - foo::<u8>(42_u8); - //~^ ERROR mismatched types - foo::<u8>(42_u8); - //~^ ERROR mismatched types - foo::<u8>(42_u8); - //~^ ERROR mismatched types - foo::<u8>(42_u8); - foo::<u8>(42_u8); - //~^ ERROR mismatched types - foo::<u8>(42_u8); - //~^ ERROR mismatched types - foo::<u8>(42_u8); - //~^ ERROR mismatched types - foo::<u8>(42_u8); - //~^ ERROR mismatched types - foo::<u8>(42_u8); - //~^ ERROR mismatched types - foo::<u8>(42u8); - //~^ ERROR mismatched types - foo::<u8>(42u8); - //~^ ERROR mismatched types - - foo::<i8>(42_i8); - //~^ ERROR mismatched types - foo::<i8>(42_i8); - //~^ ERROR mismatched types - foo::<i8>(42_i8); - //~^ ERROR mismatched types - foo::<i8>(42_i8); - //~^ ERROR mismatched types - foo::<i8>(42_i8); - //~^ ERROR mismatched types - foo::<i8>(42_i8); - //~^ ERROR mismatched types - foo::<i8>(42_i8); - //~^ ERROR mismatched types - foo::<i8>(42_i8); - //~^ ERROR mismatched types - foo::<i8>(42_i8); - //~^ ERROR mismatched types - foo::<i8>(42_i8); - foo::<i8>(42i8); - //~^ ERROR mismatched types - foo::<i8>(42i8); - //~^ ERROR mismatched types - - foo::<f64>(42_f64); - //~^ ERROR mismatched types - foo::<f64>(42_f64); - //~^ ERROR mismatched types - foo::<f64>(42_u32.into()); - //~^ ERROR mismatched types - foo::<f64>(42_u16.into()); - //~^ ERROR mismatched types - foo::<f64>(42_u8.into()); - //~^ ERROR mismatched types - foo::<f64>(42_f64); - //~^ ERROR mismatched types - foo::<f64>(42_f64); - //~^ ERROR mismatched types - foo::<f64>(42_i32.into()); - //~^ ERROR mismatched types - foo::<f64>(42_i16.into()); - //~^ ERROR mismatched types - foo::<f64>(42_i8.into()); - //~^ ERROR mismatched types - foo::<f64>(42.0_f64); - foo::<f64>(42.0_f64); - //~^ ERROR mismatched types - - foo::<f32>(42_f32); - //~^ ERROR mismatched types - foo::<f32>(42_f32); - //~^ ERROR mismatched types - foo::<f32>(42_f32); - //~^ ERROR mismatched types - foo::<f32>(42_u16.into()); - //~^ ERROR mismatched types - foo::<f32>(42_u8.into()); - //~^ ERROR mismatched types - foo::<f32>(42_f32); - //~^ ERROR mismatched types - foo::<f32>(42_f32); - //~^ ERROR mismatched types - foo::<f32>(42_f32); - //~^ ERROR mismatched types - foo::<f32>(42_i16.into()); - //~^ ERROR mismatched types - foo::<f32>(42_i8.into()); - //~^ ERROR mismatched types - foo::<f32>(42.0_f32); - //~^ ERROR mismatched types - foo::<f32>(42.0_f32); - - foo::<u32>((42_u8 as u16).into()); - //~^ ERROR mismatched types - foo::<i32>((-42_i8).into()); - //~^ ERROR mismatched types -} diff --git a/src/test/ui/numeric/numeric-suffix.rs b/src/test/ui/numeric/numeric-suffix.rs deleted file mode 100644 index ca38ed82220..00000000000 --- a/src/test/ui/numeric/numeric-suffix.rs +++ /dev/null @@ -1,298 +0,0 @@ -// run-rustfix - -fn foo<N>(_x: N) {} - -fn main() { - foo::<usize>(42_usize); - foo::<usize>(42_u64); - //~^ ERROR mismatched types - foo::<usize>(42_u32); - //~^ ERROR mismatched types - foo::<usize>(42_u16); - //~^ ERROR mismatched types - foo::<usize>(42_u8); - //~^ ERROR mismatched types - foo::<usize>(42_isize); - //~^ ERROR mismatched types - foo::<usize>(42_i64); - //~^ ERROR mismatched types - foo::<usize>(42_i32); - //~^ ERROR mismatched types - foo::<usize>(42_i16); - //~^ ERROR mismatched types - foo::<usize>(42_i8); - //~^ ERROR mismatched types - foo::<usize>(42.0_f64); - //~^ ERROR mismatched types - foo::<usize>(42.0_f32); - //~^ ERROR mismatched types - - foo::<isize>(42_usize); - //~^ ERROR mismatched types - foo::<isize>(42_u64); - //~^ ERROR mismatched types - foo::<isize>(42_u32); - //~^ ERROR mismatched types - foo::<isize>(42_u16); - //~^ ERROR mismatched types - foo::<isize>(42_u8); - //~^ ERROR mismatched types - foo::<isize>(42_isize); - foo::<isize>(42_i64); - //~^ ERROR mismatched types - foo::<isize>(42_i32); - //~^ ERROR mismatched types - foo::<isize>(42_i16); - //~^ ERROR mismatched types - foo::<isize>(42_i8); - //~^ ERROR mismatched types - foo::<isize>(42.0_f64); - //~^ ERROR mismatched types - foo::<isize>(42.0_f32); - //~^ ERROR mismatched types - - foo::<u64>(42_usize); - //~^ ERROR mismatched types - foo::<u64>(42_u64); - foo::<u64>(42_u32); - //~^ ERROR mismatched types - foo::<u64>(42_u16); - //~^ ERROR mismatched types - foo::<u64>(42_u8); - //~^ ERROR mismatched types - foo::<u64>(42_isize); - //~^ ERROR mismatched types - foo::<u64>(42_i64); - //~^ ERROR mismatched types - foo::<u64>(42_i32); - //~^ ERROR mismatched types - foo::<u64>(42_i16); - //~^ ERROR mismatched types - foo::<u64>(42_i8); - //~^ ERROR mismatched types - foo::<u64>(42.0_f64); - //~^ ERROR mismatched types - foo::<u64>(42.0_f32); - //~^ ERROR mismatched types - - foo::<i64>(42_usize); - //~^ ERROR mismatched types - foo::<i64>(42_u64); - //~^ ERROR mismatched types - foo::<i64>(42_u32); - //~^ ERROR mismatched types - foo::<i64>(42_u16); - //~^ ERROR mismatched types - foo::<i64>(42_u8); - //~^ ERROR mismatched types - foo::<i64>(42_isize); - //~^ ERROR mismatched types - foo::<i64>(42_i64); - foo::<i64>(42_i32); - //~^ ERROR mismatched types - foo::<i64>(42_i16); - //~^ ERROR mismatched types - foo::<i64>(42_i8); - //~^ ERROR mismatched types - foo::<i64>(42.0_f64); - //~^ ERROR mismatched types - foo::<i64>(42.0_f32); - //~^ ERROR mismatched types - - foo::<u32>(42_usize); - //~^ ERROR mismatched types - foo::<u32>(42_u64); - //~^ ERROR mismatched types - foo::<u32>(42_u32); - foo::<u32>(42_u16); - //~^ ERROR mismatched types - foo::<u32>(42_u8); - //~^ ERROR mismatched types - foo::<u32>(42_isize); - //~^ ERROR mismatched types - foo::<u32>(42_i64); - //~^ ERROR mismatched types - foo::<u32>(42_i32); - //~^ ERROR mismatched types - foo::<u32>(42_i16); - //~^ ERROR mismatched types - foo::<u32>(42_i8); - //~^ ERROR mismatched types - foo::<u32>(42.0_f64); - //~^ ERROR mismatched types - foo::<u32>(42.0_f32); - //~^ ERROR mismatched types - - foo::<i32>(42_usize); - //~^ ERROR mismatched types - foo::<i32>(42_u64); - //~^ ERROR mismatched types - foo::<i32>(42_u32); - //~^ ERROR mismatched types - foo::<i32>(42_u16); - //~^ ERROR mismatched types - foo::<i32>(42_u8); - //~^ ERROR mismatched types - foo::<i32>(42_isize); - //~^ ERROR mismatched types - foo::<i32>(42_i64); - //~^ ERROR mismatched types - foo::<i32>(42_i32); - foo::<i32>(42_i16); - //~^ ERROR mismatched types - foo::<i32>(42_i8); - //~^ ERROR mismatched types - foo::<i32>(42.0_f64); - //~^ ERROR mismatched types - foo::<i32>(42.0_f32); - //~^ ERROR mismatched types - - foo::<u16>(42_usize); - //~^ ERROR mismatched types - foo::<u16>(42_u64); - //~^ ERROR mismatched types - foo::<u16>(42_u32); - //~^ ERROR mismatched types - foo::<u16>(42_u16); - foo::<u16>(42_u8); - //~^ ERROR mismatched types - foo::<u16>(42_isize); - //~^ ERROR mismatched types - foo::<u16>(42_i64); - //~^ ERROR mismatched types - foo::<u16>(42_i32); - //~^ ERROR mismatched types - foo::<u16>(42_i16); - //~^ ERROR mismatched types - foo::<u16>(42_i8); - //~^ ERROR mismatched types - foo::<u16>(42.0_f64); - //~^ ERROR mismatched types - foo::<u16>(42.0_f32); - //~^ ERROR mismatched types - - foo::<i16>(42_usize); - //~^ ERROR mismatched types - foo::<i16>(42_u64); - //~^ ERROR mismatched types - foo::<i16>(42_u32); - //~^ ERROR mismatched types - foo::<i16>(42_u16); - //~^ ERROR mismatched types - foo::<i16>(42_u8); - //~^ ERROR mismatched types - foo::<i16>(42_isize); - //~^ ERROR mismatched types - foo::<i16>(42_i64); - //~^ ERROR mismatched types - foo::<i16>(42_i32); - //~^ ERROR mismatched types - foo::<i16>(42_i16); - foo::<i16>(42_i8); - //~^ ERROR mismatched types - foo::<i16>(42.0_f64); - //~^ ERROR mismatched types - foo::<i16>(42.0_f32); - //~^ ERROR mismatched types - - foo::<u8>(42_usize); - //~^ ERROR mismatched types - foo::<u8>(42_u64); - //~^ ERROR mismatched types - foo::<u8>(42_u32); - //~^ ERROR mismatched types - foo::<u8>(42_u16); - //~^ ERROR mismatched types - foo::<u8>(42_u8); - foo::<u8>(42_isize); - //~^ ERROR mismatched types - foo::<u8>(42_i64); - //~^ ERROR mismatched types - foo::<u8>(42_i32); - //~^ ERROR mismatched types - foo::<u8>(42_i16); - //~^ ERROR mismatched types - foo::<u8>(42_i8); - //~^ ERROR mismatched types - foo::<u8>(42.0_f64); - //~^ ERROR mismatched types - foo::<u8>(42.0_f32); - //~^ ERROR mismatched types - - foo::<i8>(42_usize); - //~^ ERROR mismatched types - foo::<i8>(42_u64); - //~^ ERROR mismatched types - foo::<i8>(42_u32); - //~^ ERROR mismatched types - foo::<i8>(42_u16); - //~^ ERROR mismatched types - foo::<i8>(42_u8); - //~^ ERROR mismatched types - foo::<i8>(42_isize); - //~^ ERROR mismatched types - foo::<i8>(42_i64); - //~^ ERROR mismatched types - foo::<i8>(42_i32); - //~^ ERROR mismatched types - foo::<i8>(42_i16); - //~^ ERROR mismatched types - foo::<i8>(42_i8); - foo::<i8>(42.0_f64); - //~^ ERROR mismatched types - foo::<i8>(42.0_f32); - //~^ ERROR mismatched types - - foo::<f64>(42_usize); - //~^ ERROR mismatched types - foo::<f64>(42_u64); - //~^ ERROR mismatched types - foo::<f64>(42_u32); - //~^ ERROR mismatched types - foo::<f64>(42_u16); - //~^ ERROR mismatched types - foo::<f64>(42_u8); - //~^ ERROR mismatched types - foo::<f64>(42_isize); - //~^ ERROR mismatched types - foo::<f64>(42_i64); - //~^ ERROR mismatched types - foo::<f64>(42_i32); - //~^ ERROR mismatched types - foo::<f64>(42_i16); - //~^ ERROR mismatched types - foo::<f64>(42_i8); - //~^ ERROR mismatched types - foo::<f64>(42.0_f64); - foo::<f64>(42.0_f32); - //~^ ERROR mismatched types - - foo::<f32>(42_usize); - //~^ ERROR mismatched types - foo::<f32>(42_u64); - //~^ ERROR mismatched types - foo::<f32>(42_u32); - //~^ ERROR mismatched types - foo::<f32>(42_u16); - //~^ ERROR mismatched types - foo::<f32>(42_u8); - //~^ ERROR mismatched types - foo::<f32>(42_isize); - //~^ ERROR mismatched types - foo::<f32>(42_i64); - //~^ ERROR mismatched types - foo::<f32>(42_i32); - //~^ ERROR mismatched types - foo::<f32>(42_i16); - //~^ ERROR mismatched types - foo::<f32>(42_i8); - //~^ ERROR mismatched types - foo::<f32>(42.0_f64); - //~^ ERROR mismatched types - foo::<f32>(42.0_f32); - - foo::<u32>(42_u8 as u16); - //~^ ERROR mismatched types - foo::<i32>(-42_i8); - //~^ ERROR mismatched types -} diff --git a/src/test/ui/numeric/numeric-suffix.stderr b/src/test/ui/numeric/numeric-suffix.stderr deleted file mode 100644 index b829946e522..00000000000 --- a/src/test/ui/numeric/numeric-suffix.stderr +++ /dev/null @@ -1,1477 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:7:18 - | -LL | foo::<usize>(42_u64); - | ^^^^^^ expected `usize`, found `u64` - | -help: change the type of the numeric literal from `u64` to `usize` - | -LL | foo::<usize>(42_usize); - | ~~~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:9:18 - | -LL | foo::<usize>(42_u32); - | ^^^^^^ expected `usize`, found `u32` - | -help: change the type of the numeric literal from `u32` to `usize` - | -LL | foo::<usize>(42_usize); - | ~~~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:11:18 - | -LL | foo::<usize>(42_u16); - | ^^^^^^ expected `usize`, found `u16` - | -help: change the type of the numeric literal from `u16` to `usize` - | -LL | foo::<usize>(42_usize); - | ~~~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:13:18 - | -LL | foo::<usize>(42_u8); - | ^^^^^ expected `usize`, found `u8` - | -help: change the type of the numeric literal from `u8` to `usize` - | -LL | foo::<usize>(42_usize); - | ~~~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:15:18 - | -LL | foo::<usize>(42_isize); - | ^^^^^^^^ expected `usize`, found `isize` - | -help: change the type of the numeric literal from `isize` to `usize` - | -LL | foo::<usize>(42_usize); - | ~~~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:17:18 - | -LL | foo::<usize>(42_i64); - | ^^^^^^ expected `usize`, found `i64` - | -help: change the type of the numeric literal from `i64` to `usize` - | -LL | foo::<usize>(42_usize); - | ~~~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:19:18 - | -LL | foo::<usize>(42_i32); - | ^^^^^^ expected `usize`, found `i32` - | -help: change the type of the numeric literal from `i32` to `usize` - | -LL | foo::<usize>(42_usize); - | ~~~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:21:18 - | -LL | foo::<usize>(42_i16); - | ^^^^^^ expected `usize`, found `i16` - | -help: change the type of the numeric literal from `i16` to `usize` - | -LL | foo::<usize>(42_usize); - | ~~~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:23:18 - | -LL | foo::<usize>(42_i8); - | ^^^^^ expected `usize`, found `i8` - | -help: change the type of the numeric literal from `i8` to `usize` - | -LL | foo::<usize>(42_usize); - | ~~~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:25:18 - | -LL | foo::<usize>(42.0_f64); - | ^^^^^^^^ expected `usize`, found `f64` - | -help: change the type of the numeric literal from `f64` to `usize` - | -LL | foo::<usize>(42usize); - | ~~~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:27:18 - | -LL | foo::<usize>(42.0_f32); - | ^^^^^^^^ expected `usize`, found `f32` - | -help: change the type of the numeric literal from `f32` to `usize` - | -LL | foo::<usize>(42usize); - | ~~~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:30:18 - | -LL | foo::<isize>(42_usize); - | ^^^^^^^^ expected `isize`, found `usize` - | -help: change the type of the numeric literal from `usize` to `isize` - | -LL | foo::<isize>(42_isize); - | ~~~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:32:18 - | -LL | foo::<isize>(42_u64); - | ^^^^^^ expected `isize`, found `u64` - | -help: change the type of the numeric literal from `u64` to `isize` - | -LL | foo::<isize>(42_isize); - | ~~~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:34:18 - | -LL | foo::<isize>(42_u32); - | ^^^^^^ expected `isize`, found `u32` - | -help: change the type of the numeric literal from `u32` to `isize` - | -LL | foo::<isize>(42_isize); - | ~~~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:36:18 - | -LL | foo::<isize>(42_u16); - | ^^^^^^ expected `isize`, found `u16` - | -help: change the type of the numeric literal from `u16` to `isize` - | -LL | foo::<isize>(42_isize); - | ~~~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:38:18 - | -LL | foo::<isize>(42_u8); - | ^^^^^ expected `isize`, found `u8` - | -help: change the type of the numeric literal from `u8` to `isize` - | -LL | foo::<isize>(42_isize); - | ~~~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:41:18 - | -LL | foo::<isize>(42_i64); - | ^^^^^^ expected `isize`, found `i64` - | -help: change the type of the numeric literal from `i64` to `isize` - | -LL | foo::<isize>(42_isize); - | ~~~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:43:18 - | -LL | foo::<isize>(42_i32); - | ^^^^^^ expected `isize`, found `i32` - | -help: change the type of the numeric literal from `i32` to `isize` - | -LL | foo::<isize>(42_isize); - | ~~~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:45:18 - | -LL | foo::<isize>(42_i16); - | ^^^^^^ expected `isize`, found `i16` - | -help: change the type of the numeric literal from `i16` to `isize` - | -LL | foo::<isize>(42_isize); - | ~~~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:47:18 - | -LL | foo::<isize>(42_i8); - | ^^^^^ expected `isize`, found `i8` - | -help: change the type of the numeric literal from `i8` to `isize` - | -LL | foo::<isize>(42_isize); - | ~~~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:49:18 - | -LL | foo::<isize>(42.0_f64); - | ^^^^^^^^ expected `isize`, found `f64` - | -help: change the type of the numeric literal from `f64` to `isize` - | -LL | foo::<isize>(42isize); - | ~~~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:51:18 - | -LL | foo::<isize>(42.0_f32); - | ^^^^^^^^ expected `isize`, found `f32` - | -help: change the type of the numeric literal from `f32` to `isize` - | -LL | foo::<isize>(42isize); - | ~~~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:54:16 - | -LL | foo::<u64>(42_usize); - | ^^^^^^^^ expected `u64`, found `usize` - | -help: change the type of the numeric literal from `usize` to `u64` - | -LL | foo::<u64>(42_u64); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:57:16 - | -LL | foo::<u64>(42_u32); - | ^^^^^^ expected `u64`, found `u32` - | -help: change the type of the numeric literal from `u32` to `u64` - | -LL | foo::<u64>(42_u64); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:59:16 - | -LL | foo::<u64>(42_u16); - | ^^^^^^ expected `u64`, found `u16` - | -help: change the type of the numeric literal from `u16` to `u64` - | -LL | foo::<u64>(42_u64); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:61:16 - | -LL | foo::<u64>(42_u8); - | ^^^^^ expected `u64`, found `u8` - | -help: change the type of the numeric literal from `u8` to `u64` - | -LL | foo::<u64>(42_u64); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:63:16 - | -LL | foo::<u64>(42_isize); - | ^^^^^^^^ expected `u64`, found `isize` - | -help: change the type of the numeric literal from `isize` to `u64` - | -LL | foo::<u64>(42_u64); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:65:16 - | -LL | foo::<u64>(42_i64); - | ^^^^^^ expected `u64`, found `i64` - | -help: change the type of the numeric literal from `i64` to `u64` - | -LL | foo::<u64>(42_u64); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:67:16 - | -LL | foo::<u64>(42_i32); - | ^^^^^^ expected `u64`, found `i32` - | -help: change the type of the numeric literal from `i32` to `u64` - | -LL | foo::<u64>(42_u64); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:69:16 - | -LL | foo::<u64>(42_i16); - | ^^^^^^ expected `u64`, found `i16` - | -help: change the type of the numeric literal from `i16` to `u64` - | -LL | foo::<u64>(42_u64); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:71:16 - | -LL | foo::<u64>(42_i8); - | ^^^^^ expected `u64`, found `i8` - | -help: change the type of the numeric literal from `i8` to `u64` - | -LL | foo::<u64>(42_u64); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:73:16 - | -LL | foo::<u64>(42.0_f64); - | ^^^^^^^^ expected `u64`, found `f64` - | -help: change the type of the numeric literal from `f64` to `u64` - | -LL | foo::<u64>(42u64); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:75:16 - | -LL | foo::<u64>(42.0_f32); - | ^^^^^^^^ expected `u64`, found `f32` - | -help: change the type of the numeric literal from `f32` to `u64` - | -LL | foo::<u64>(42u64); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:78:16 - | -LL | foo::<i64>(42_usize); - | ^^^^^^^^ expected `i64`, found `usize` - | -help: change the type of the numeric literal from `usize` to `i64` - | -LL | foo::<i64>(42_i64); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:80:16 - | -LL | foo::<i64>(42_u64); - | ^^^^^^ expected `i64`, found `u64` - | -help: change the type of the numeric literal from `u64` to `i64` - | -LL | foo::<i64>(42_i64); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:82:16 - | -LL | foo::<i64>(42_u32); - | ^^^^^^ expected `i64`, found `u32` - | -help: change the type of the numeric literal from `u32` to `i64` - | -LL | foo::<i64>(42_i64); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:84:16 - | -LL | foo::<i64>(42_u16); - | ^^^^^^ expected `i64`, found `u16` - | -help: change the type of the numeric literal from `u16` to `i64` - | -LL | foo::<i64>(42_i64); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:86:16 - | -LL | foo::<i64>(42_u8); - | ^^^^^ expected `i64`, found `u8` - | -help: change the type of the numeric literal from `u8` to `i64` - | -LL | foo::<i64>(42_i64); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:88:16 - | -LL | foo::<i64>(42_isize); - | ^^^^^^^^ expected `i64`, found `isize` - | -help: change the type of the numeric literal from `isize` to `i64` - | -LL | foo::<i64>(42_i64); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:91:16 - | -LL | foo::<i64>(42_i32); - | ^^^^^^ expected `i64`, found `i32` - | -help: change the type of the numeric literal from `i32` to `i64` - | -LL | foo::<i64>(42_i64); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:93:16 - | -LL | foo::<i64>(42_i16); - | ^^^^^^ expected `i64`, found `i16` - | -help: change the type of the numeric literal from `i16` to `i64` - | -LL | foo::<i64>(42_i64); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:95:16 - | -LL | foo::<i64>(42_i8); - | ^^^^^ expected `i64`, found `i8` - | -help: change the type of the numeric literal from `i8` to `i64` - | -LL | foo::<i64>(42_i64); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:97:16 - | -LL | foo::<i64>(42.0_f64); - | ^^^^^^^^ expected `i64`, found `f64` - | -help: change the type of the numeric literal from `f64` to `i64` - | -LL | foo::<i64>(42i64); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:99:16 - | -LL | foo::<i64>(42.0_f32); - | ^^^^^^^^ expected `i64`, found `f32` - | -help: change the type of the numeric literal from `f32` to `i64` - | -LL | foo::<i64>(42i64); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:102:16 - | -LL | foo::<u32>(42_usize); - | ^^^^^^^^ expected `u32`, found `usize` - | -help: change the type of the numeric literal from `usize` to `u32` - | -LL | foo::<u32>(42_u32); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:104:16 - | -LL | foo::<u32>(42_u64); - | ^^^^^^ expected `u32`, found `u64` - | -help: change the type of the numeric literal from `u64` to `u32` - | -LL | foo::<u32>(42_u32); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:107:16 - | -LL | foo::<u32>(42_u16); - | ^^^^^^ expected `u32`, found `u16` - | -help: change the type of the numeric literal from `u16` to `u32` - | -LL | foo::<u32>(42_u32); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:109:16 - | -LL | foo::<u32>(42_u8); - | ^^^^^ expected `u32`, found `u8` - | -help: change the type of the numeric literal from `u8` to `u32` - | -LL | foo::<u32>(42_u32); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:111:16 - | -LL | foo::<u32>(42_isize); - | ^^^^^^^^ expected `u32`, found `isize` - | -help: change the type of the numeric literal from `isize` to `u32` - | -LL | foo::<u32>(42_u32); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:113:16 - | -LL | foo::<u32>(42_i64); - | ^^^^^^ expected `u32`, found `i64` - | -help: change the type of the numeric literal from `i64` to `u32` - | -LL | foo::<u32>(42_u32); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:115:16 - | -LL | foo::<u32>(42_i32); - | ^^^^^^ expected `u32`, found `i32` - | -help: change the type of the numeric literal from `i32` to `u32` - | -LL | foo::<u32>(42_u32); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:117:16 - | -LL | foo::<u32>(42_i16); - | ^^^^^^ expected `u32`, found `i16` - | -help: change the type of the numeric literal from `i16` to `u32` - | -LL | foo::<u32>(42_u32); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:119:16 - | -LL | foo::<u32>(42_i8); - | ^^^^^ expected `u32`, found `i8` - | -help: change the type of the numeric literal from `i8` to `u32` - | -LL | foo::<u32>(42_u32); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:121:16 - | -LL | foo::<u32>(42.0_f64); - | ^^^^^^^^ expected `u32`, found `f64` - | -help: change the type of the numeric literal from `f64` to `u32` - | -LL | foo::<u32>(42u32); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:123:16 - | -LL | foo::<u32>(42.0_f32); - | ^^^^^^^^ expected `u32`, found `f32` - | -help: change the type of the numeric literal from `f32` to `u32` - | -LL | foo::<u32>(42u32); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:126:16 - | -LL | foo::<i32>(42_usize); - | ^^^^^^^^ expected `i32`, found `usize` - | -help: change the type of the numeric literal from `usize` to `i32` - | -LL | foo::<i32>(42_i32); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:128:16 - | -LL | foo::<i32>(42_u64); - | ^^^^^^ expected `i32`, found `u64` - | -help: change the type of the numeric literal from `u64` to `i32` - | -LL | foo::<i32>(42_i32); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:130:16 - | -LL | foo::<i32>(42_u32); - | ^^^^^^ expected `i32`, found `u32` - | -help: change the type of the numeric literal from `u32` to `i32` - | -LL | foo::<i32>(42_i32); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:132:16 - | -LL | foo::<i32>(42_u16); - | ^^^^^^ expected `i32`, found `u16` - | -help: change the type of the numeric literal from `u16` to `i32` - | -LL | foo::<i32>(42_i32); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:134:16 - | -LL | foo::<i32>(42_u8); - | ^^^^^ expected `i32`, found `u8` - | -help: change the type of the numeric literal from `u8` to `i32` - | -LL | foo::<i32>(42_i32); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:136:16 - | -LL | foo::<i32>(42_isize); - | ^^^^^^^^ expected `i32`, found `isize` - | -help: change the type of the numeric literal from `isize` to `i32` - | -LL | foo::<i32>(42_i32); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:138:16 - | -LL | foo::<i32>(42_i64); - | ^^^^^^ expected `i32`, found `i64` - | -help: change the type of the numeric literal from `i64` to `i32` - | -LL | foo::<i32>(42_i32); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:141:16 - | -LL | foo::<i32>(42_i16); - | ^^^^^^ expected `i32`, found `i16` - | -help: change the type of the numeric literal from `i16` to `i32` - | -LL | foo::<i32>(42_i32); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:143:16 - | -LL | foo::<i32>(42_i8); - | ^^^^^ expected `i32`, found `i8` - | -help: change the type of the numeric literal from `i8` to `i32` - | -LL | foo::<i32>(42_i32); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:145:16 - | -LL | foo::<i32>(42.0_f64); - | ^^^^^^^^ expected `i32`, found `f64` - | -help: change the type of the numeric literal from `f64` to `i32` - | -LL | foo::<i32>(42i32); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:147:16 - | -LL | foo::<i32>(42.0_f32); - | ^^^^^^^^ expected `i32`, found `f32` - | -help: change the type of the numeric literal from `f32` to `i32` - | -LL | foo::<i32>(42i32); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:150:16 - | -LL | foo::<u16>(42_usize); - | ^^^^^^^^ expected `u16`, found `usize` - | -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:152:16 - | -LL | foo::<u16>(42_u64); - | ^^^^^^ expected `u16`, found `u64` - | -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:154:16 - | -LL | foo::<u16>(42_u32); - | ^^^^^^ expected `u16`, found `u32` - | -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:157:16 - | -LL | foo::<u16>(42_u8); - | ^^^^^ expected `u16`, found `u8` - | -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:159:16 - | -LL | foo::<u16>(42_isize); - | ^^^^^^^^ expected `u16`, found `isize` - | -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:161:16 - | -LL | foo::<u16>(42_i64); - | ^^^^^^ expected `u16`, found `i64` - | -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:163:16 - | -LL | foo::<u16>(42_i32); - | ^^^^^^ expected `u16`, found `i32` - | -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:165:16 - | -LL | foo::<u16>(42_i16); - | ^^^^^^ expected `u16`, found `i16` - | -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:167:16 - | -LL | foo::<u16>(42_i8); - | ^^^^^ expected `u16`, found `i8` - | -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:169:16 - | -LL | foo::<u16>(42.0_f64); - | ^^^^^^^^ expected `u16`, found `f64` - | -help: change the type of the numeric literal from `f64` to `u16` - | -LL | foo::<u16>(42u16); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:171:16 - | -LL | foo::<u16>(42.0_f32); - | ^^^^^^^^ expected `u16`, found `f32` - | -help: change the type of the numeric literal from `f32` to `u16` - | -LL | foo::<u16>(42u16); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:174:16 - | -LL | foo::<i16>(42_usize); - | ^^^^^^^^ expected `i16`, found `usize` - | -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:176:16 - | -LL | foo::<i16>(42_u64); - | ^^^^^^ expected `i16`, found `u64` - | -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:178:16 - | -LL | foo::<i16>(42_u32); - | ^^^^^^ expected `i16`, found `u32` - | -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:180:16 - | -LL | foo::<i16>(42_u16); - | ^^^^^^ expected `i16`, found `u16` - | -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:182:16 - | -LL | foo::<i16>(42_u8); - | ^^^^^ expected `i16`, found `u8` - | -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:184:16 - | -LL | foo::<i16>(42_isize); - | ^^^^^^^^ expected `i16`, found `isize` - | -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:186:16 - | -LL | foo::<i16>(42_i64); - | ^^^^^^ expected `i16`, found `i64` - | -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:188:16 - | -LL | foo::<i16>(42_i32); - | ^^^^^^ expected `i16`, found `i32` - | -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:191:16 - | -LL | foo::<i16>(42_i8); - | ^^^^^ expected `i16`, found `i8` - | -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:193:16 - | -LL | foo::<i16>(42.0_f64); - | ^^^^^^^^ expected `i16`, found `f64` - | -help: change the type of the numeric literal from `f64` to `i16` - | -LL | foo::<i16>(42i16); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:195:16 - | -LL | foo::<i16>(42.0_f32); - | ^^^^^^^^ expected `i16`, found `f32` - | -help: change the type of the numeric literal from `f32` to `i16` - | -LL | foo::<i16>(42i16); - | ~~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:198:15 - | -LL | foo::<u8>(42_usize); - | ^^^^^^^^ expected `u8`, found `usize` - | -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:200:15 - | -LL | foo::<u8>(42_u64); - | ^^^^^^ expected `u8`, found `u64` - | -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:202:15 - | -LL | foo::<u8>(42_u32); - | ^^^^^^ expected `u8`, found `u32` - | -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:204:15 - | -LL | foo::<u8>(42_u16); - | ^^^^^^ expected `u8`, found `u16` - | -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:207:15 - | -LL | foo::<u8>(42_isize); - | ^^^^^^^^ expected `u8`, found `isize` - | -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:209:15 - | -LL | foo::<u8>(42_i64); - | ^^^^^^ expected `u8`, found `i64` - | -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:211:15 - | -LL | foo::<u8>(42_i32); - | ^^^^^^ expected `u8`, found `i32` - | -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:213:15 - | -LL | foo::<u8>(42_i16); - | ^^^^^^ expected `u8`, found `i16` - | -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:215:15 - | -LL | foo::<u8>(42_i8); - | ^^^^^ expected `u8`, found `i8` - | -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:217:15 - | -LL | foo::<u8>(42.0_f64); - | ^^^^^^^^ expected `u8`, found `f64` - | -help: change the type of the numeric literal from `f64` to `u8` - | -LL | foo::<u8>(42u8); - | ~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:219:15 - | -LL | foo::<u8>(42.0_f32); - | ^^^^^^^^ expected `u8`, found `f32` - | -help: change the type of the numeric literal from `f32` to `u8` - | -LL | foo::<u8>(42u8); - | ~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:222:15 - | -LL | foo::<i8>(42_usize); - | ^^^^^^^^ expected `i8`, found `usize` - | -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:224:15 - | -LL | foo::<i8>(42_u64); - | ^^^^^^ expected `i8`, found `u64` - | -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:226:15 - | -LL | foo::<i8>(42_u32); - | ^^^^^^ expected `i8`, found `u32` - | -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:228:15 - | -LL | foo::<i8>(42_u16); - | ^^^^^^ expected `i8`, found `u16` - | -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:230:15 - | -LL | foo::<i8>(42_u8); - | ^^^^^ expected `i8`, found `u8` - | -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:232:15 - | -LL | foo::<i8>(42_isize); - | ^^^^^^^^ expected `i8`, found `isize` - | -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:234:15 - | -LL | foo::<i8>(42_i64); - | ^^^^^^ expected `i8`, found `i64` - | -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:236:15 - | -LL | foo::<i8>(42_i32); - | ^^^^^^ expected `i8`, found `i32` - | -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:238:15 - | -LL | foo::<i8>(42_i16); - | ^^^^^^ expected `i8`, found `i16` - | -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:241:15 - | -LL | foo::<i8>(42.0_f64); - | ^^^^^^^^ expected `i8`, found `f64` - | -help: change the type of the numeric literal from `f64` to `i8` - | -LL | foo::<i8>(42i8); - | ~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:243:15 - | -LL | foo::<i8>(42.0_f32); - | ^^^^^^^^ expected `i8`, found `f32` - | -help: change the type of the numeric literal from `f32` to `i8` - | -LL | foo::<i8>(42i8); - | ~~ - -error[E0308]: mismatched types - --> $DIR/numeric-suffix.rs:246:16 - | -LL | foo::<f64>(42_usize); - | ^^^^^^^^ expected `f64`, found `usize` - | -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:248:16 - | -LL | foo::<f64>(42_u64); - | ^^^^^^ expected `f64`, found `u64` - | -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:250:16 - | -LL | foo::<f64>(42_u32); - | ^^^^^^ expected `f64`, found `u32` - | -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:252:16 - | -LL | foo::<f64>(42_u16); - | ^^^^^^ expected `f64`, found `u16` - | -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:254:16 - | -LL | foo::<f64>(42_u8); - | ^^^^^ expected `f64`, found `u8` - | -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:256:16 - | -LL | foo::<f64>(42_isize); - | ^^^^^^^^ expected `f64`, found `isize` - | -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:258:16 - | -LL | foo::<f64>(42_i64); - | ^^^^^^ expected `f64`, found `i64` - | -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:260:16 - | -LL | foo::<f64>(42_i32); - | ^^^^^^ expected `f64`, found `i32` - | -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:262:16 - | -LL | foo::<f64>(42_i16); - | ^^^^^^ expected `f64`, found `i16` - | -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:264:16 - | -LL | foo::<f64>(42_i8); - | ^^^^^ expected `f64`, found `i8` - | -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:267:16 - | -LL | foo::<f64>(42.0_f32); - | ^^^^^^^^ expected `f64`, found `f32` - | -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:270:16 - | -LL | foo::<f32>(42_usize); - | ^^^^^^^^ expected `f32`, found `usize` - | -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:272:16 - | -LL | foo::<f32>(42_u64); - | ^^^^^^ expected `f32`, found `u64` - | -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:274:16 - | -LL | foo::<f32>(42_u32); - | ^^^^^^ expected `f32`, found `u32` - | -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:276:16 - | -LL | foo::<f32>(42_u16); - | ^^^^^^ expected `f32`, found `u16` - | -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:278:16 - | -LL | foo::<f32>(42_u8); - | ^^^^^ expected `f32`, found `u8` - | -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:280:16 - | -LL | foo::<f32>(42_isize); - | ^^^^^^^^ expected `f32`, found `isize` - | -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:282:16 - | -LL | foo::<f32>(42_i64); - | ^^^^^^ expected `f32`, found `i64` - | -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:284:16 - | -LL | foo::<f32>(42_i32); - | ^^^^^^ expected `f32`, found `i32` - | -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:286:16 - | -LL | foo::<f32>(42_i16); - | ^^^^^^ expected `f32`, found `i16` - | -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:288:16 - | -LL | foo::<f32>(42_i8); - | ^^^^^ expected `f32`, found `i8` - | -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:290:16 - | -LL | foo::<f32>(42.0_f64); - | ^^^^^^^^ expected `f32`, found `f64` - | -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:294:16 - | -LL | foo::<u32>(42_u8 as u16); - | ^^^^^^^^^^^^ expected `u32`, found `u16` - | -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:296:16 - | -LL | foo::<i32>(-42_i8); - | ^^^^^^ expected `i32`, found `i8` - | -help: you can convert an `i8` to an `i32` - | -LL | foo::<i32>((-42_i8).into()); - | + ++++++++ - -error: aborting due to 134 previous errors - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/numeric/numeric-suffix/numeric-suffix-i32.fixed b/src/test/ui/numeric/numeric-suffix/numeric-suffix-i32.fixed new file mode 100644 index 00000000000..6e8c54df4b6 --- /dev/null +++ b/src/test/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/src/test/ui/numeric/numeric-suffix/numeric-suffix-i32.rs b/src/test/ui/numeric/numeric-suffix/numeric-suffix-i32.rs new file mode 100644 index 00000000000..b47b0ed02e7 --- /dev/null +++ b/src/test/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/src/test/ui/numeric/numeric-suffix/numeric-suffix-i32.stderr b/src/test/ui/numeric/numeric-suffix/numeric-suffix-i32.stderr new file mode 100644 index 00000000000..f4fb14e7992 --- /dev/null +++ b/src/test/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/src/test/ui/numeric/numeric-suffix/numeric-suffix-i64.fixed b/src/test/ui/numeric/numeric-suffix/numeric-suffix-i64.fixed new file mode 100644 index 00000000000..03821cd4470 --- /dev/null +++ b/src/test/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/src/test/ui/numeric/numeric-suffix/numeric-suffix-i64.rs b/src/test/ui/numeric/numeric-suffix/numeric-suffix-i64.rs new file mode 100644 index 00000000000..629fe7e742c --- /dev/null +++ b/src/test/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/src/test/ui/numeric/numeric-suffix/numeric-suffix-i64.stderr b/src/test/ui/numeric/numeric-suffix/numeric-suffix-i64.stderr new file mode 100644 index 00000000000..47efe9f08bb --- /dev/null +++ b/src/test/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/src/test/ui/numeric/numeric-suffix/numeric-suffix-isize.fixed b/src/test/ui/numeric/numeric-suffix/numeric-suffix-isize.fixed new file mode 100644 index 00000000000..faed65ca410 --- /dev/null +++ b/src/test/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/src/test/ui/numeric/numeric-suffix/numeric-suffix-isize.rs b/src/test/ui/numeric/numeric-suffix/numeric-suffix-isize.rs new file mode 100644 index 00000000000..df0b4cb6204 --- /dev/null +++ b/src/test/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/src/test/ui/numeric/numeric-suffix/numeric-suffix-isize.stderr b/src/test/ui/numeric/numeric-suffix/numeric-suffix-isize.stderr new file mode 100644 index 00000000000..28b79413f68 --- /dev/null +++ b/src/test/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/src/test/ui/numeric/numeric-suffix/numeric-suffix-u32.fixed b/src/test/ui/numeric/numeric-suffix/numeric-suffix-u32.fixed new file mode 100644 index 00000000000..5955829e72c --- /dev/null +++ b/src/test/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/src/test/ui/numeric/numeric-suffix/numeric-suffix-u32.rs b/src/test/ui/numeric/numeric-suffix/numeric-suffix-u32.rs new file mode 100644 index 00000000000..5c303036a79 --- /dev/null +++ b/src/test/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/src/test/ui/numeric/numeric-suffix/numeric-suffix-u32.stderr b/src/test/ui/numeric/numeric-suffix/numeric-suffix-u32.stderr new file mode 100644 index 00000000000..d966893a83b --- /dev/null +++ b/src/test/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/src/test/ui/numeric/numeric-suffix/numeric-suffix-u64.fixed b/src/test/ui/numeric/numeric-suffix/numeric-suffix-u64.fixed new file mode 100644 index 00000000000..4623c211c1c --- /dev/null +++ b/src/test/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/src/test/ui/numeric/numeric-suffix/numeric-suffix-u64.rs b/src/test/ui/numeric/numeric-suffix/numeric-suffix-u64.rs new file mode 100644 index 00000000000..3e9995c7496 --- /dev/null +++ b/src/test/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/src/test/ui/numeric/numeric-suffix/numeric-suffix-u64.stderr b/src/test/ui/numeric/numeric-suffix/numeric-suffix-u64.stderr new file mode 100644 index 00000000000..ff332fa914d --- /dev/null +++ b/src/test/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/src/test/ui/numeric/numeric-suffix/numeric-suffix-usize.fixed b/src/test/ui/numeric/numeric-suffix/numeric-suffix-usize.fixed new file mode 100644 index 00000000000..6cb5243ca84 --- /dev/null +++ b/src/test/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/src/test/ui/numeric/numeric-suffix/numeric-suffix-usize.rs b/src/test/ui/numeric/numeric-suffix/numeric-suffix-usize.rs new file mode 100644 index 00000000000..a2304ba26c6 --- /dev/null +++ b/src/test/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/src/test/ui/numeric/numeric-suffix/numeric-suffix-usize.stderr b/src/test/ui/numeric/numeric-suffix/numeric-suffix-usize.stderr new file mode 100644 index 00000000000..4889abee69c --- /dev/null +++ b/src/test/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/src/test/ui/numeric/numeric-suffix/numeric-suffix.fixed b/src/test/ui/numeric/numeric-suffix/numeric-suffix.fixed new file mode 100644 index 00000000000..69934db217b --- /dev/null +++ b/src/test/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/src/test/ui/numeric/numeric-suffix/numeric-suffix.rs b/src/test/ui/numeric/numeric-suffix/numeric-suffix.rs new file mode 100644 index 00000000000..dabf43f8204 --- /dev/null +++ b/src/test/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/src/test/ui/numeric/numeric-suffix/numeric-suffix.stderr b/src/test/ui/numeric/numeric-suffix/numeric-suffix.stderr new file mode 100644 index 00000000000..e05913b9c62 --- /dev/null +++ b/src/test/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`. |
