Reword casting message

This commit is contained in:
Esteban Küber 2019-05-03 10:41:26 -07:00
parent ef9a876f82
commit 1e2af7d935
16 changed files with 115 additions and 115 deletions

View File

@ -523,7 +523,7 @@ pub fn check_for_cast(
let msg = format!("you can convert an `{}` to `{}`", checked_ty, expected_ty);
let cast_msg = format!("you can cast an `{} to `{}`", checked_ty, expected_ty);
let try_msg = format!("{} or panic if it the converted value wouldn't fit", msg);
let try_msg = format!("{} and panic if the converted value wouldn't fit", msg);
let lit_msg = format!(
"change the type of the numeric literal from `{}` to `{}`",
checked_ty,

View File

@ -49,7 +49,7 @@ error[E0308]: mismatched types
|
LL | let _: i32 = f2(2i32);
| ^^^^^^^^ expected i32, found u32
help: you can convert an `u32` to `i32` or panic if it the converted value wouldn't fit
help: you can convert an `u32` to `i32` and panic if the converted value wouldn't fit
|
LL | let _: i32 = f2(2i32).try_into().unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -12,7 +12,7 @@ error[E0308]: mismatched types
|
LL | bar::<isize>(i); // i should not be re-coerced back to an isize
| ^ expected isize, found usize
help: you can convert an `usize` to `isize` or panic if it the converted value wouldn't fit
help: you can convert an `usize` to `isize` and panic if the converted value wouldn't fit
|
LL | bar::<isize>(i.try_into().unwrap()); // i should not be re-coerced back to an isize
| ^^^^^^^^^^^^^^^^^^^^^

View File

@ -3,7 +3,7 @@ error[E0308]: mismatched types
|
LL | id_i8(a16);
| ^^^ expected i8, found i16
help: you can convert an `i16` to `i8` or panic if it the converted value wouldn't fit
help: you can convert an `i16` to `i8` and panic if the converted value wouldn't fit
|
LL | id_i8(a16.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -13,7 +13,7 @@ error[E0308]: mismatched types
|
LL | id_i8(a32);
| ^^^ expected i8, found i32
help: you can convert an `i32` to `i8` or panic if it the converted value wouldn't fit
help: you can convert an `i32` to `i8` and panic if the converted value wouldn't fit
|
LL | id_i8(a32.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -23,7 +23,7 @@ error[E0308]: mismatched types
|
LL | id_i8(a64);
| ^^^ expected i8, found i64
help: you can convert an `i64` to `i8` or panic if it the converted value wouldn't fit
help: you can convert an `i64` to `i8` and panic if the converted value wouldn't fit
|
LL | id_i8(a64.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -42,7 +42,7 @@ error[E0308]: mismatched types
|
LL | id_i16(a32);
| ^^^ expected i16, found i32
help: you can convert an `i32` to `i16` or panic if it the converted value wouldn't fit
help: you can convert an `i32` to `i16` and panic if the converted value wouldn't fit
|
LL | id_i16(a32.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -52,7 +52,7 @@ error[E0308]: mismatched types
|
LL | id_i16(a64);
| ^^^ expected i16, found i64
help: you can convert an `i64` to `i16` or panic if it the converted value wouldn't fit
help: you can convert an `i64` to `i16` and panic if the converted value wouldn't fit
|
LL | id_i16(a64.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -80,7 +80,7 @@ error[E0308]: mismatched types
|
LL | id_i32(a64);
| ^^^ expected i32, found i64
help: you can convert an `i64` to `i32` or panic if it the converted value wouldn't fit
help: you can convert an `i64` to `i32` and panic if the converted value wouldn't fit
|
LL | id_i32(a64.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -117,7 +117,7 @@ error[E0308]: mismatched types
|
LL | id_i8(c16);
| ^^^ expected i8, found i16
help: you can convert an `i16` to `i8` or panic if it the converted value wouldn't fit
help: you can convert an `i16` to `i8` and panic if the converted value wouldn't fit
|
LL | id_i8(c16.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -127,7 +127,7 @@ error[E0308]: mismatched types
|
LL | id_i8(c32);
| ^^^ expected i8, found i32
help: you can convert an `i32` to `i8` or panic if it the converted value wouldn't fit
help: you can convert an `i32` to `i8` and panic if the converted value wouldn't fit
|
LL | id_i8(c32.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -137,7 +137,7 @@ error[E0308]: mismatched types
|
LL | id_i8(c64);
| ^^^ expected i8, found i64
help: you can convert an `i64` to `i8` or panic if it the converted value wouldn't fit
help: you can convert an `i64` to `i8` and panic if the converted value wouldn't fit
|
LL | id_i8(c64.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -156,7 +156,7 @@ error[E0308]: mismatched types
|
LL | id_i16(c32);
| ^^^ expected i16, found i32
help: you can convert an `i32` to `i16` or panic if it the converted value wouldn't fit
help: you can convert an `i32` to `i16` and panic if the converted value wouldn't fit
|
LL | id_i16(c32.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -166,7 +166,7 @@ error[E0308]: mismatched types
|
LL | id_i16(c64);
| ^^^ expected i16, found i64
help: you can convert an `i64` to `i16` or panic if it the converted value wouldn't fit
help: you can convert an `i64` to `i16` and panic if the converted value wouldn't fit
|
LL | id_i16(c64.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -194,7 +194,7 @@ error[E0308]: mismatched types
|
LL | id_i32(c64);
| ^^^ expected i32, found i64
help: you can convert an `i64` to `i32` or panic if it the converted value wouldn't fit
help: you can convert an `i64` to `i32` and panic if the converted value wouldn't fit
|
LL | id_i32(c64.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -231,7 +231,7 @@ error[E0308]: mismatched types
|
LL | id_u8(b16);
| ^^^ expected u8, found u16
help: you can convert an `u16` to `u8` or panic if it the converted value wouldn't fit
help: you can convert an `u16` to `u8` and panic if the converted value wouldn't fit
|
LL | id_u8(b16.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -241,7 +241,7 @@ error[E0308]: mismatched types
|
LL | id_u8(b32);
| ^^^ expected u8, found u32
help: you can convert an `u32` to `u8` or panic if it the converted value wouldn't fit
help: you can convert an `u32` to `u8` and panic if the converted value wouldn't fit
|
LL | id_u8(b32.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -251,7 +251,7 @@ error[E0308]: mismatched types
|
LL | id_u8(b64);
| ^^^ expected u8, found u64
help: you can convert an `u64` to `u8` or panic if it the converted value wouldn't fit
help: you can convert an `u64` to `u8` and panic if the converted value wouldn't fit
|
LL | id_u8(b64.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -270,7 +270,7 @@ error[E0308]: mismatched types
|
LL | id_u16(b32);
| ^^^ expected u16, found u32
help: you can convert an `u32` to `u16` or panic if it the converted value wouldn't fit
help: you can convert an `u32` to `u16` and panic if the converted value wouldn't fit
|
LL | id_u16(b32.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -280,7 +280,7 @@ error[E0308]: mismatched types
|
LL | id_u16(b64);
| ^^^ expected u16, found u64
help: you can convert an `u64` to `u16` or panic if it the converted value wouldn't fit
help: you can convert an `u64` to `u16` and panic if the converted value wouldn't fit
|
LL | id_u16(b64.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -308,7 +308,7 @@ error[E0308]: mismatched types
|
LL | id_u32(b64);
| ^^^ expected u32, found u64
help: you can convert an `u64` to `u32` or panic if it the converted value wouldn't fit
help: you can convert an `u64` to `u32` and panic if the converted value wouldn't fit
|
LL | id_u32(b64.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -3,7 +3,7 @@ error[E0308]: mismatched types
|
LL | foo(1*(1 as isize));
| ^^^^^^^^^^^^^^ expected i16, found isize
help: you can convert an `isize` to `i16` or panic if it the converted value wouldn't fit
help: you can convert an `isize` to `i16` and panic if the converted value wouldn't fit
|
LL | foo((1*(1 as isize)).try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -13,7 +13,7 @@ error[E0308]: mismatched types
|
LL | bar(1*(1 as usize));
| ^^^^^^^^^^^^^^ expected u32, found usize
help: you can convert an `usize` to `u32` or panic if it the converted value wouldn't fit
help: you can convert an `usize` to `u32` and panic if the converted value wouldn't fit
|
LL | bar((1*(1 as usize)).try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -3,7 +3,7 @@ error[E0308]: mismatched types
|
LL | X = Trait::Number,
| ^^^^^^^^^^^^^ expected isize, found i32
help: you can convert an `i32` to `isize` or panic if it the converted value wouldn't fit
help: you can convert an `i32` to `isize` and panic if the converted value wouldn't fit
|
LL | X = Trait::Number.try_into().unwrap(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -11,7 +11,7 @@ error[E0308]: mismatched types
|
LL | let y: usize = x.foo();
| ^^^^^^^ expected usize, found isize
help: you can convert an `isize` to `usize` or panic if it the converted value wouldn't fit
help: you can convert an `isize` to `usize` and panic if the converted value wouldn't fit
|
LL | let y: usize = x.foo().try_into().unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -6,7 +6,7 @@ LL | $arr.len() * size_of($arr[0]));
...
LL | write!(hello);
| -------------- in this macro invocation
help: you can convert an `usize` to `u64` or panic if it the converted value wouldn't fit
help: you can convert an `usize` to `u64` and panic if the converted value wouldn't fit
|
LL | ($arr.len() * size_of($arr[0])).try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -37,7 +37,7 @@ error[E0308]: mismatched types
|
LL | let d: i8 = c;
| ^ expected i8, found i32
help: you can convert an `i32` to `i8` or panic if it the converted value wouldn't fit
help: you can convert an `i32` to `i8` and panic if the converted value wouldn't fit
|
LL | let d: i8 = c.try_into().unwrap();
| ^^^^^^^^^^^^^^^^^^^^^

View File

@ -3,7 +3,7 @@ error[E0308]: mismatched types
|
LL | test(array.len());
| ^^^^^^^^^^^ expected u32, found usize
help: you can convert an `usize` to `u32` or panic if it the converted value wouldn't fit
help: you can convert an `usize` to `u32` and panic if the converted value wouldn't fit
|
LL | test(array.len().try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -3,7 +3,7 @@ error[E0308]: mismatched types
|
LL | let x: u16 = foo();
| ^^^^^ expected u16, found i32
help: you can convert an `i32` to `u16` or panic if it the converted value wouldn't fit
help: you can convert an `i32` to `u16` and panic if the converted value wouldn't fit
|
LL | let x: u16 = foo().try_into().unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -13,7 +13,7 @@ error[E0308]: mismatched types
|
LL | let y: i64 = x + x;
| ^^^^^ expected i64, found u16
help: you can convert an `u16` to `i64` or panic if it the converted value wouldn't fit
help: you can convert an `u16` to `i64` and panic if the converted value wouldn't fit
|
LL | let y: i64 = (x + x).try_into().unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -23,7 +23,7 @@ error[E0308]: mismatched types
|
LL | let z: i32 = x + x;
| ^^^^^ expected i32, found u16
help: you can convert an `u16` to `i32` or panic if it the converted value wouldn't fit
help: you can convert an `u16` to `i32` and panic if the converted value wouldn't fit
|
LL | let z: i32 = (x + x).try_into().unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -3,7 +3,7 @@ error[E0308]: mismatched types
|
LL | foo::<usize>(x_u64);
| ^^^^^ expected usize, found u64
help: you can convert an `u64` to `usize` or panic if it the converted value wouldn't fit
help: you can convert an `u64` to `usize` and panic if the converted value wouldn't fit
|
LL | foo::<usize>(x_u64.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -13,7 +13,7 @@ error[E0308]: mismatched types
|
LL | foo::<usize>(x_u32);
| ^^^^^ expected usize, found u32
help: you can convert an `u32` to `usize` or panic if it the converted value wouldn't fit
help: you can convert an `u32` to `usize` and panic if the converted value wouldn't fit
|
LL | foo::<usize>(x_u32.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -23,7 +23,7 @@ error[E0308]: mismatched types
|
LL | foo::<usize>(x_u16);
| ^^^^^ expected usize, found u16
help: you can convert an `u16` to `usize` or panic if it the converted value wouldn't fit
help: you can convert an `u16` to `usize` and panic if the converted value wouldn't fit
|
LL | foo::<usize>(x_u16.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -33,7 +33,7 @@ error[E0308]: mismatched types
|
LL | foo::<usize>(x_u8);
| ^^^^ expected usize, found u8
help: you can convert an `u8` to `usize` or panic if it the converted value wouldn't fit
help: you can convert an `u8` to `usize` and panic if the converted value wouldn't fit
|
LL | foo::<usize>(x_u8.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^
@ -43,7 +43,7 @@ error[E0308]: mismatched types
|
LL | foo::<usize>(x_isize);
| ^^^^^^^ expected usize, found isize
help: you can convert an `isize` to `usize` or panic if it the converted value wouldn't fit
help: you can convert an `isize` to `usize` and panic if the converted value wouldn't fit
|
LL | foo::<usize>(x_isize.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -53,7 +53,7 @@ error[E0308]: mismatched types
|
LL | foo::<usize>(x_i64);
| ^^^^^ expected usize, found i64
help: you can convert an `i64` to `usize` or panic if it the converted value wouldn't fit
help: you can convert an `i64` to `usize` and panic if the converted value wouldn't fit
|
LL | foo::<usize>(x_i64.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -63,7 +63,7 @@ error[E0308]: mismatched types
|
LL | foo::<usize>(x_i32);
| ^^^^^ expected usize, found i32
help: you can convert an `i32` to `usize` or panic if it the converted value wouldn't fit
help: you can convert an `i32` to `usize` and panic if the converted value wouldn't fit
|
LL | foo::<usize>(x_i32.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -73,7 +73,7 @@ error[E0308]: mismatched types
|
LL | foo::<usize>(x_i16);
| ^^^^^ expected usize, found i16
help: you can convert an `i16` to `usize` or panic if it the converted value wouldn't fit
help: you can convert an `i16` to `usize` and panic if the converted value wouldn't fit
|
LL | foo::<usize>(x_i16.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -83,7 +83,7 @@ error[E0308]: mismatched types
|
LL | foo::<usize>(x_i8);
| ^^^^ expected usize, found i8
help: you can convert an `i8` to `usize` or panic if it the converted value wouldn't fit
help: you can convert an `i8` to `usize` and panic if the converted value wouldn't fit
|
LL | foo::<usize>(x_i8.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^
@ -93,7 +93,7 @@ error[E0308]: mismatched types
|
LL | foo::<isize>(x_usize);
| ^^^^^^^ expected isize, found usize
help: you can convert an `usize` to `isize` or panic if it the converted value wouldn't fit
help: you can convert an `usize` to `isize` and panic if the converted value wouldn't fit
|
LL | foo::<isize>(x_usize.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -103,7 +103,7 @@ error[E0308]: mismatched types
|
LL | foo::<isize>(x_u64);
| ^^^^^ expected isize, found u64
help: you can convert an `u64` to `isize` or panic if it the converted value wouldn't fit
help: you can convert an `u64` to `isize` and panic if the converted value wouldn't fit
|
LL | foo::<isize>(x_u64.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -113,7 +113,7 @@ error[E0308]: mismatched types
|
LL | foo::<isize>(x_u32);
| ^^^^^ expected isize, found u32
help: you can convert an `u32` to `isize` or panic if it the converted value wouldn't fit
help: you can convert an `u32` to `isize` and panic if the converted value wouldn't fit
|
LL | foo::<isize>(x_u32.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -123,7 +123,7 @@ error[E0308]: mismatched types
|
LL | foo::<isize>(x_u16);
| ^^^^^ expected isize, found u16
help: you can convert an `u16` to `isize` or panic if it the converted value wouldn't fit
help: you can convert an `u16` to `isize` and panic if the converted value wouldn't fit
|
LL | foo::<isize>(x_u16.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -133,7 +133,7 @@ error[E0308]: mismatched types
|
LL | foo::<isize>(x_u8);
| ^^^^ expected isize, found u8
help: you can convert an `u8` to `isize` or panic if it the converted value wouldn't fit
help: you can convert an `u8` to `isize` and panic if the converted value wouldn't fit
|
LL | foo::<isize>(x_u8.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^
@ -143,7 +143,7 @@ error[E0308]: mismatched types
|
LL | foo::<isize>(x_i64);
| ^^^^^ expected isize, found i64
help: you can convert an `i64` to `isize` or panic if it the converted value wouldn't fit
help: you can convert an `i64` to `isize` and panic if the converted value wouldn't fit
|
LL | foo::<isize>(x_i64.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -153,7 +153,7 @@ error[E0308]: mismatched types
|
LL | foo::<isize>(x_i32);
| ^^^^^ expected isize, found i32
help: you can convert an `i32` to `isize` or panic if it the converted value wouldn't fit
help: you can convert an `i32` to `isize` and panic if the converted value wouldn't fit
|
LL | foo::<isize>(x_i32.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -163,7 +163,7 @@ error[E0308]: mismatched types
|
LL | foo::<isize>(x_i16);
| ^^^^^ expected isize, found i16
help: you can convert an `i16` to `isize` or panic if it the converted value wouldn't fit
help: you can convert an `i16` to `isize` and panic if the converted value wouldn't fit
|
LL | foo::<isize>(x_i16.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -173,7 +173,7 @@ error[E0308]: mismatched types
|
LL | foo::<isize>(x_i8);
| ^^^^ expected isize, found i8
help: you can convert an `i8` to `isize` or panic if it the converted value wouldn't fit
help: you can convert an `i8` to `isize` and panic if the converted value wouldn't fit
|
LL | foo::<isize>(x_i8.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^
@ -183,7 +183,7 @@ error[E0308]: mismatched types
|
LL | foo::<u64>(x_usize);
| ^^^^^^^ expected u64, found usize
help: you can convert an `usize` to `u64` or panic if it the converted value wouldn't fit
help: you can convert an `usize` to `u64` and panic if the converted value wouldn't fit
|
LL | foo::<u64>(x_usize.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -220,7 +220,7 @@ error[E0308]: mismatched types
|
LL | foo::<u64>(x_isize);
| ^^^^^^^ expected u64, found isize
help: you can convert an `isize` to `u64` or panic if it the converted value wouldn't fit
help: you can convert an `isize` to `u64` and panic if the converted value wouldn't fit
|
LL | foo::<u64>(x_isize.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -230,7 +230,7 @@ error[E0308]: mismatched types
|
LL | foo::<u64>(x_i64);
| ^^^^^ expected u64, found i64
help: you can convert an `i64` to `u64` or panic if it the converted value wouldn't fit
help: you can convert an `i64` to `u64` and panic if the converted value wouldn't fit
|
LL | foo::<u64>(x_i64.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -240,7 +240,7 @@ error[E0308]: mismatched types
|
LL | foo::<u64>(x_i32);
| ^^^^^ expected u64, found i32
help: you can convert an `i32` to `u64` or panic if it the converted value wouldn't fit
help: you can convert an `i32` to `u64` and panic if the converted value wouldn't fit
|
LL | foo::<u64>(x_i32.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -250,7 +250,7 @@ error[E0308]: mismatched types
|
LL | foo::<u64>(x_i16);
| ^^^^^ expected u64, found i16
help: you can convert an `i16` to `u64` or panic if it the converted value wouldn't fit
help: you can convert an `i16` to `u64` and panic if the converted value wouldn't fit
|
LL | foo::<u64>(x_i16.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -260,7 +260,7 @@ error[E0308]: mismatched types
|
LL | foo::<u64>(x_i8);
| ^^^^ expected u64, found i8
help: you can convert an `i8` to `u64` or panic if it the converted value wouldn't fit
help: you can convert an `i8` to `u64` and panic if the converted value wouldn't fit
|
LL | foo::<u64>(x_i8.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^
@ -270,7 +270,7 @@ error[E0308]: mismatched types
|
LL | foo::<i64>(x_usize);
| ^^^^^^^ expected i64, found usize
help: you can convert an `usize` to `i64` or panic if it the converted value wouldn't fit
help: you can convert an `usize` to `i64` and panic if the converted value wouldn't fit
|
LL | foo::<i64>(x_usize.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -280,7 +280,7 @@ error[E0308]: mismatched types
|
LL | foo::<i64>(x_u64);
| ^^^^^ expected i64, found u64
help: you can convert an `u64` to `i64` or panic if it the converted value wouldn't fit
help: you can convert an `u64` to `i64` and panic if the converted value wouldn't fit
|
LL | foo::<i64>(x_u64.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -290,7 +290,7 @@ error[E0308]: mismatched types
|
LL | foo::<i64>(x_u32);
| ^^^^^ expected i64, found u32
help: you can convert an `u32` to `i64` or panic if it the converted value wouldn't fit
help: you can convert an `u32` to `i64` and panic if the converted value wouldn't fit
|
LL | foo::<i64>(x_u32.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -300,7 +300,7 @@ error[E0308]: mismatched types
|
LL | foo::<i64>(x_u16);
| ^^^^^ expected i64, found u16
help: you can convert an `u16` to `i64` or panic if it the converted value wouldn't fit
help: you can convert an `u16` to `i64` and panic if the converted value wouldn't fit
|
LL | foo::<i64>(x_u16.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -310,7 +310,7 @@ error[E0308]: mismatched types
|
LL | foo::<i64>(x_u8);
| ^^^^ expected i64, found u8
help: you can convert an `u8` to `i64` or panic if it the converted value wouldn't fit
help: you can convert an `u8` to `i64` and panic if the converted value wouldn't fit
|
LL | foo::<i64>(x_u8.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^
@ -320,7 +320,7 @@ error[E0308]: mismatched types
|
LL | foo::<i64>(x_isize);
| ^^^^^^^ expected i64, found isize
help: you can convert an `isize` to `i64` or panic if it the converted value wouldn't fit
help: you can convert an `isize` to `i64` and panic if the converted value wouldn't fit
|
LL | foo::<i64>(x_isize.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -357,7 +357,7 @@ error[E0308]: mismatched types
|
LL | foo::<u32>(x_usize);
| ^^^^^^^ expected u32, found usize
help: you can convert an `usize` to `u32` or panic if it the converted value wouldn't fit
help: you can convert an `usize` to `u32` and panic if the converted value wouldn't fit
|
LL | foo::<u32>(x_usize.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -367,7 +367,7 @@ error[E0308]: mismatched types
|
LL | foo::<u32>(x_u64);
| ^^^^^ expected u32, found u64
help: you can convert an `u64` to `u32` or panic if it the converted value wouldn't fit
help: you can convert an `u64` to `u32` and panic if the converted value wouldn't fit
|
LL | foo::<u32>(x_u64.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -395,7 +395,7 @@ error[E0308]: mismatched types
|
LL | foo::<u32>(x_isize);
| ^^^^^^^ expected u32, found isize
help: you can convert an `isize` to `u32` or panic if it the converted value wouldn't fit
help: you can convert an `isize` to `u32` and panic if the converted value wouldn't fit
|
LL | foo::<u32>(x_isize.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -405,7 +405,7 @@ error[E0308]: mismatched types
|
LL | foo::<u32>(x_i64);
| ^^^^^ expected u32, found i64
help: you can convert an `i64` to `u32` or panic if it the converted value wouldn't fit
help: you can convert an `i64` to `u32` and panic if the converted value wouldn't fit
|
LL | foo::<u32>(x_i64.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -415,7 +415,7 @@ error[E0308]: mismatched types
|
LL | foo::<u32>(x_i32);
| ^^^^^ expected u32, found i32
help: you can convert an `i32` to `u32` or panic if it the converted value wouldn't fit
help: you can convert an `i32` to `u32` and panic if the converted value wouldn't fit
|
LL | foo::<u32>(x_i32.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -425,7 +425,7 @@ error[E0308]: mismatched types
|
LL | foo::<u32>(x_i16);
| ^^^^^ expected u32, found i16
help: you can convert an `i16` to `u32` or panic if it the converted value wouldn't fit
help: you can convert an `i16` to `u32` and panic if the converted value wouldn't fit
|
LL | foo::<u32>(x_i16.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -435,7 +435,7 @@ error[E0308]: mismatched types
|
LL | foo::<u32>(x_i8);
| ^^^^ expected u32, found i8
help: you can convert an `i8` to `u32` or panic if it the converted value wouldn't fit
help: you can convert an `i8` to `u32` and panic if the converted value wouldn't fit
|
LL | foo::<u32>(x_i8.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^
@ -445,7 +445,7 @@ error[E0308]: mismatched types
|
LL | foo::<i32>(x_usize);
| ^^^^^^^ expected i32, found usize
help: you can convert an `usize` to `i32` or panic if it the converted value wouldn't fit
help: you can convert an `usize` to `i32` and panic if the converted value wouldn't fit
|
LL | foo::<i32>(x_usize.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -455,7 +455,7 @@ error[E0308]: mismatched types
|
LL | foo::<i32>(x_u64);
| ^^^^^ expected i32, found u64
help: you can convert an `u64` to `i32` or panic if it the converted value wouldn't fit
help: you can convert an `u64` to `i32` and panic if the converted value wouldn't fit
|
LL | foo::<i32>(x_u64.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -465,7 +465,7 @@ error[E0308]: mismatched types
|
LL | foo::<i32>(x_u32);
| ^^^^^ expected i32, found u32
help: you can convert an `u32` to `i32` or panic if it the converted value wouldn't fit
help: you can convert an `u32` to `i32` and panic if the converted value wouldn't fit
|
LL | foo::<i32>(x_u32.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -475,7 +475,7 @@ error[E0308]: mismatched types
|
LL | foo::<i32>(x_u16);
| ^^^^^ expected i32, found u16
help: you can convert an `u16` to `i32` or panic if it the converted value wouldn't fit
help: you can convert an `u16` to `i32` and panic if the converted value wouldn't fit
|
LL | foo::<i32>(x_u16.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -485,7 +485,7 @@ error[E0308]: mismatched types
|
LL | foo::<i32>(x_u8);
| ^^^^ expected i32, found u8
help: you can convert an `u8` to `i32` or panic if it the converted value wouldn't fit
help: you can convert an `u8` to `i32` and panic if the converted value wouldn't fit
|
LL | foo::<i32>(x_u8.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^
@ -495,7 +495,7 @@ error[E0308]: mismatched types
|
LL | foo::<i32>(x_isize);
| ^^^^^^^ expected i32, found isize
help: you can convert an `isize` to `i32` or panic if it the converted value wouldn't fit
help: you can convert an `isize` to `i32` and panic if the converted value wouldn't fit
|
LL | foo::<i32>(x_isize.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -505,7 +505,7 @@ error[E0308]: mismatched types
|
LL | foo::<i32>(x_i64);
| ^^^^^ expected i32, found i64
help: you can convert an `i64` to `i32` or panic if it the converted value wouldn't fit
help: you can convert an `i64` to `i32` and panic if the converted value wouldn't fit
|
LL | foo::<i32>(x_i64.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -533,7 +533,7 @@ error[E0308]: mismatched types
|
LL | foo::<u16>(x_usize);
| ^^^^^^^ expected u16, found usize
help: you can convert an `usize` to `u16` or panic if it the converted value wouldn't fit
help: you can convert an `usize` to `u16` and panic if the converted value wouldn't fit
|
LL | foo::<u16>(x_usize.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -543,7 +543,7 @@ error[E0308]: mismatched types
|
LL | foo::<u16>(x_u64);
| ^^^^^ expected u16, found u64
help: you can convert an `u64` to `u16` or panic if it the converted value wouldn't fit
help: you can convert an `u64` to `u16` and panic if the converted value wouldn't fit
|
LL | foo::<u16>(x_u64.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -553,7 +553,7 @@ error[E0308]: mismatched types
|
LL | foo::<u16>(x_u32);
| ^^^^^ expected u16, found u32
help: you can convert an `u32` to `u16` or panic if it the converted value wouldn't fit
help: you can convert an `u32` to `u16` and panic if the converted value wouldn't fit
|
LL | foo::<u16>(x_u32.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -572,7 +572,7 @@ error[E0308]: mismatched types
|
LL | foo::<u16>(x_isize);
| ^^^^^^^ expected u16, found isize
help: you can convert an `isize` to `u16` or panic if it the converted value wouldn't fit
help: you can convert an `isize` to `u16` and panic if the converted value wouldn't fit
|
LL | foo::<u16>(x_isize.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -582,7 +582,7 @@ error[E0308]: mismatched types
|
LL | foo::<u16>(x_i64);
| ^^^^^ expected u16, found i64
help: you can convert an `i64` to `u16` or panic if it the converted value wouldn't fit
help: you can convert an `i64` to `u16` and panic if the converted value wouldn't fit
|
LL | foo::<u16>(x_i64.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -592,7 +592,7 @@ error[E0308]: mismatched types
|
LL | foo::<u16>(x_i32);
| ^^^^^ expected u16, found i32
help: you can convert an `i32` to `u16` or panic if it the converted value wouldn't fit
help: you can convert an `i32` to `u16` and panic if the converted value wouldn't fit
|
LL | foo::<u16>(x_i32.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -602,7 +602,7 @@ error[E0308]: mismatched types
|
LL | foo::<u16>(x_i16);
| ^^^^^ expected u16, found i16
help: you can convert an `i16` to `u16` or panic if it the converted value wouldn't fit
help: you can convert an `i16` to `u16` and panic if the converted value wouldn't fit
|
LL | foo::<u16>(x_i16.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -612,7 +612,7 @@ error[E0308]: mismatched types
|
LL | foo::<u16>(x_i8);
| ^^^^ expected u16, found i8
help: you can convert an `i8` to `u16` or panic if it the converted value wouldn't fit
help: you can convert an `i8` to `u16` and panic if the converted value wouldn't fit
|
LL | foo::<u16>(x_i8.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^
@ -622,7 +622,7 @@ error[E0308]: mismatched types
|
LL | foo::<i16>(x_usize);
| ^^^^^^^ expected i16, found usize
help: you can convert an `usize` to `i16` or panic if it the converted value wouldn't fit
help: you can convert an `usize` to `i16` and panic if the converted value wouldn't fit
|
LL | foo::<i16>(x_usize.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -632,7 +632,7 @@ error[E0308]: mismatched types
|
LL | foo::<i16>(x_u64);
| ^^^^^ expected i16, found u64
help: you can convert an `u64` to `i16` or panic if it the converted value wouldn't fit
help: you can convert an `u64` to `i16` and panic if the converted value wouldn't fit
|
LL | foo::<i16>(x_u64.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -642,7 +642,7 @@ error[E0308]: mismatched types
|
LL | foo::<i16>(x_u32);
| ^^^^^ expected i16, found u32
help: you can convert an `u32` to `i16` or panic if it the converted value wouldn't fit
help: you can convert an `u32` to `i16` and panic if the converted value wouldn't fit
|
LL | foo::<i16>(x_u32.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -652,7 +652,7 @@ error[E0308]: mismatched types
|
LL | foo::<i16>(x_u16);
| ^^^^^ expected i16, found u16
help: you can convert an `u16` to `i16` or panic if it the converted value wouldn't fit
help: you can convert an `u16` to `i16` and panic if the converted value wouldn't fit
|
LL | foo::<i16>(x_u16.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -662,7 +662,7 @@ error[E0308]: mismatched types
|
LL | foo::<i16>(x_u8);
| ^^^^ expected i16, found u8
help: you can convert an `u8` to `i16` or panic if it the converted value wouldn't fit
help: you can convert an `u8` to `i16` and panic if the converted value wouldn't fit
|
LL | foo::<i16>(x_u8.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^
@ -672,7 +672,7 @@ error[E0308]: mismatched types
|
LL | foo::<i16>(x_isize);
| ^^^^^^^ expected i16, found isize
help: you can convert an `isize` to `i16` or panic if it the converted value wouldn't fit
help: you can convert an `isize` to `i16` and panic if the converted value wouldn't fit
|
LL | foo::<i16>(x_isize.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -682,7 +682,7 @@ error[E0308]: mismatched types
|
LL | foo::<i16>(x_i64);
| ^^^^^ expected i16, found i64
help: you can convert an `i64` to `i16` or panic if it the converted value wouldn't fit
help: you can convert an `i64` to `i16` and panic if the converted value wouldn't fit
|
LL | foo::<i16>(x_i64.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -692,7 +692,7 @@ error[E0308]: mismatched types
|
LL | foo::<i16>(x_i32);
| ^^^^^ expected i16, found i32
help: you can convert an `i32` to `i16` or panic if it the converted value wouldn't fit
help: you can convert an `i32` to `i16` and panic if the converted value wouldn't fit
|
LL | foo::<i16>(x_i32.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -711,7 +711,7 @@ error[E0308]: mismatched types
|
LL | foo::<u8>(x_usize);
| ^^^^^^^ expected u8, found usize
help: you can convert an `usize` to `u8` or panic if it the converted value wouldn't fit
help: you can convert an `usize` to `u8` and panic if the converted value wouldn't fit
|
LL | foo::<u8>(x_usize.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -721,7 +721,7 @@ error[E0308]: mismatched types
|
LL | foo::<u8>(x_u64);
| ^^^^^ expected u8, found u64
help: you can convert an `u64` to `u8` or panic if it the converted value wouldn't fit
help: you can convert an `u64` to `u8` and panic if the converted value wouldn't fit
|
LL | foo::<u8>(x_u64.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -731,7 +731,7 @@ error[E0308]: mismatched types
|
LL | foo::<u8>(x_u32);
| ^^^^^ expected u8, found u32
help: you can convert an `u32` to `u8` or panic if it the converted value wouldn't fit
help: you can convert an `u32` to `u8` and panic if the converted value wouldn't fit
|
LL | foo::<u8>(x_u32.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -741,7 +741,7 @@ error[E0308]: mismatched types
|
LL | foo::<u8>(x_u16);
| ^^^^^ expected u8, found u16
help: you can convert an `u16` to `u8` or panic if it the converted value wouldn't fit
help: you can convert an `u16` to `u8` and panic if the converted value wouldn't fit
|
LL | foo::<u8>(x_u16.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -751,7 +751,7 @@ error[E0308]: mismatched types
|
LL | foo::<u8>(x_isize);
| ^^^^^^^ expected u8, found isize
help: you can convert an `isize` to `u8` or panic if it the converted value wouldn't fit
help: you can convert an `isize` to `u8` and panic if the converted value wouldn't fit
|
LL | foo::<u8>(x_isize.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -761,7 +761,7 @@ error[E0308]: mismatched types
|
LL | foo::<u8>(x_i64);
| ^^^^^ expected u8, found i64
help: you can convert an `i64` to `u8` or panic if it the converted value wouldn't fit
help: you can convert an `i64` to `u8` and panic if the converted value wouldn't fit
|
LL | foo::<u8>(x_i64.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -771,7 +771,7 @@ error[E0308]: mismatched types
|
LL | foo::<u8>(x_i32);
| ^^^^^ expected u8, found i32
help: you can convert an `i32` to `u8` or panic if it the converted value wouldn't fit
help: you can convert an `i32` to `u8` and panic if the converted value wouldn't fit
|
LL | foo::<u8>(x_i32.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -781,7 +781,7 @@ error[E0308]: mismatched types
|
LL | foo::<u8>(x_i16);
| ^^^^^ expected u8, found i16
help: you can convert an `i16` to `u8` or panic if it the converted value wouldn't fit
help: you can convert an `i16` to `u8` and panic if the converted value wouldn't fit
|
LL | foo::<u8>(x_i16.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -791,7 +791,7 @@ error[E0308]: mismatched types
|
LL | foo::<u8>(x_i8);
| ^^^^ expected u8, found i8
help: you can convert an `i8` to `u8` or panic if it the converted value wouldn't fit
help: you can convert an `i8` to `u8` and panic if the converted value wouldn't fit
|
LL | foo::<u8>(x_i8.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^
@ -801,7 +801,7 @@ error[E0308]: mismatched types
|
LL | foo::<i8>(x_usize);
| ^^^^^^^ expected i8, found usize
help: you can convert an `usize` to `i8` or panic if it the converted value wouldn't fit
help: you can convert an `usize` to `i8` and panic if the converted value wouldn't fit
|
LL | foo::<i8>(x_usize.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -811,7 +811,7 @@ error[E0308]: mismatched types
|
LL | foo::<i8>(x_u64);
| ^^^^^ expected i8, found u64
help: you can convert an `u64` to `i8` or panic if it the converted value wouldn't fit
help: you can convert an `u64` to `i8` and panic if the converted value wouldn't fit
|
LL | foo::<i8>(x_u64.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -821,7 +821,7 @@ error[E0308]: mismatched types
|
LL | foo::<i8>(x_u32);
| ^^^^^ expected i8, found u32
help: you can convert an `u32` to `i8` or panic if it the converted value wouldn't fit
help: you can convert an `u32` to `i8` and panic if the converted value wouldn't fit
|
LL | foo::<i8>(x_u32.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -831,7 +831,7 @@ error[E0308]: mismatched types
|
LL | foo::<i8>(x_u16);
| ^^^^^ expected i8, found u16
help: you can convert an `u16` to `i8` or panic if it the converted value wouldn't fit
help: you can convert an `u16` to `i8` and panic if the converted value wouldn't fit
|
LL | foo::<i8>(x_u16.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -841,7 +841,7 @@ error[E0308]: mismatched types
|
LL | foo::<i8>(x_u8);
| ^^^^ expected i8, found u8
help: you can convert an `u8` to `i8` or panic if it the converted value wouldn't fit
help: you can convert an `u8` to `i8` and panic if the converted value wouldn't fit
|
LL | foo::<i8>(x_u8.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^
@ -851,7 +851,7 @@ error[E0308]: mismatched types
|
LL | foo::<i8>(x_isize);
| ^^^^^^^ expected i8, found isize
help: you can convert an `isize` to `i8` or panic if it the converted value wouldn't fit
help: you can convert an `isize` to `i8` and panic if the converted value wouldn't fit
|
LL | foo::<i8>(x_isize.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -861,7 +861,7 @@ error[E0308]: mismatched types
|
LL | foo::<i8>(x_i64);
| ^^^^^ expected i8, found i64
help: you can convert an `i64` to `i8` or panic if it the converted value wouldn't fit
help: you can convert an `i64` to `i8` and panic if the converted value wouldn't fit
|
LL | foo::<i8>(x_i64.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -871,7 +871,7 @@ error[E0308]: mismatched types
|
LL | foo::<i8>(x_i32);
| ^^^^^ expected i8, found i32
help: you can convert an `i32` to `i8` or panic if it the converted value wouldn't fit
help: you can convert an `i32` to `i8` and panic if the converted value wouldn't fit
|
LL | foo::<i8>(x_i32.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@ -881,7 +881,7 @@ error[E0308]: mismatched types
|
LL | foo::<i8>(x_i16);
| ^^^^^ expected i8, found i16
help: you can convert an `i16` to `i8` or panic if it the converted value wouldn't fit
help: you can convert an `i16` to `i8` and panic if the converted value wouldn't fit
|
LL | foo::<i8>(x_i16.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -42,7 +42,7 @@ error[E0308]: mismatched types
|
LL | let f = [0; -4_isize];
| ^^^^^^^^ expected usize, found isize
help: you can convert an `isize` to `usize` or panic if it the converted value wouldn't fit
help: you can convert an `isize` to `usize` and panic if the converted value wouldn't fit
|
LL | let f = [0; (-4_isize).try_into().unwrap()];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -52,7 +52,7 @@ error[E0308]: mismatched types
|
LL | let f = [0_usize; -1_isize];
| ^^^^^^^^ expected usize, found isize
help: you can convert an `isize` to `usize` or panic if it the converted value wouldn't fit
help: you can convert an `isize` to `usize` and panic if the converted value wouldn't fit
|
LL | let f = [0_usize; (-1_isize).try_into().unwrap()];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -27,7 +27,7 @@ error[E0308]: mismatched types
|
LL | let _: i32 = 22_i64 >> 1_i32;
| ^^^^^^^^^^^^^^^ expected i32, found i64
help: you can convert an `i64` to `i32` or panic if it the converted value wouldn't fit
help: you can convert an `i64` to `i32` and panic if the converted value wouldn't fit
|
LL | let _: i32 = (22_i64 >> 1_i32).try_into().unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -6,7 +6,7 @@ LL | fn global_bound_is_hidden() -> u8
...
LL | B::get_x()
| ^^^^^^^^^^ expected u8, found i32
help: you can convert an `i32` to `u8` or panic if it the converted value wouldn't fit
help: you can convert an `i32` to `u8` and panic if the converted value wouldn't fit
|
LL | B::get_x().try_into().unwrap()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -12,7 +12,7 @@ error[E0308]: mismatched types
|
LL | identity_u16(y);
| ^ expected u16, found i32
help: you can convert an `i32` to `u16` or panic if it the converted value wouldn't fit
help: you can convert an `i32` to `u16` and panic if the converted value wouldn't fit
|
LL | identity_u16(y.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^
@ -22,7 +22,7 @@ error[E0308]: mismatched types
|
LL | identity_u16(a);
| ^ expected u16, found isize
help: you can convert an `isize` to `u16` or panic if it the converted value wouldn't fit
help: you can convert an `isize` to `u16` and panic if the converted value wouldn't fit
|
LL | identity_u16(a.try_into().unwrap());
| ^^^^^^^^^^^^^^^^^^^^^