diff --git a/src/test/ui/integer-literal-suffix-inference.stderr b/src/test/ui/integer-literal-suffix-inference.stderr index bfb47515823a3..2e5019ee6091c 100644 --- a/src/test/ui/integer-literal-suffix-inference.stderr +++ b/src/test/ui/integer-literal-suffix-inference.stderr @@ -8,6 +8,8 @@ help: you can convert an `i16` to an `i8` and panic if the converted value doesn | LL | id_i8(a16.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:41:11 @@ -19,6 +21,8 @@ help: you can convert an `i32` to an `i8` and panic if the converted value doesn | LL | id_i8(a32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:44:11 @@ -30,6 +34,8 @@ help: you can convert an `i64` to an `i8` and panic if the converted value doesn | LL | id_i8(a64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:47:11 @@ -41,6 +47,8 @@ help: you can convert an `isize` to an `i8` and panic if the converted value doe | LL | id_i8(asize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:51:12 @@ -61,6 +69,8 @@ help: you can convert an `i32` to an `i16` and panic if the converted value does | LL | id_i16(a32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:58:12 @@ -72,6 +82,8 @@ help: you can convert an `i64` to an `i16` and panic if the converted value does | LL | id_i16(a64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:61:12 @@ -83,6 +95,8 @@ help: you can convert an `isize` to an `i16` and panic if the converted value do | LL | id_i16(asize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:65:12 @@ -112,6 +126,8 @@ help: you can convert an `i64` to an `i32` and panic if the converted value does | LL | id_i32(a64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:75:12 @@ -123,6 +139,8 @@ help: you can convert an `isize` to an `i32` and panic if the converted value do | LL | id_i32(asize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:79:12 @@ -161,6 +179,8 @@ help: you can convert an `isize` to an `i64` and panic if the converted value do | LL | id_i64(asize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:93:14 @@ -190,6 +210,8 @@ help: you can convert an `i32` to an `isize` and panic if the converted value do | LL | id_isize(a32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:102:14 @@ -201,6 +223,8 @@ help: you can convert an `i64` to an `isize` and panic if the converted value do | LL | id_isize(a64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:108:11 @@ -212,6 +236,8 @@ help: you can convert an `i16` to an `i8` and panic if the converted value doesn | LL | id_i8(c16.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:111:11 @@ -223,6 +249,8 @@ help: you can convert an `i32` to an `i8` and panic if the converted value doesn | LL | id_i8(c32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:114:11 @@ -234,6 +262,8 @@ help: you can convert an `i64` to an `i8` and panic if the converted value doesn | LL | id_i8(c64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:118:12 @@ -254,6 +284,8 @@ help: you can convert an `i32` to an `i16` and panic if the converted value does | LL | id_i16(c32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:125:12 @@ -265,6 +297,8 @@ help: you can convert an `i64` to an `i16` and panic if the converted value does | LL | id_i16(c64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:129:12 @@ -294,6 +328,8 @@ help: you can convert an `i64` to an `i32` and panic if the converted value does | LL | id_i32(c64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:140:12 @@ -332,6 +368,8 @@ help: you can convert a `u16` to a `u8` and panic if the converted value doesn't | LL | id_u8(b16.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:155:11 @@ -343,6 +381,8 @@ help: you can convert a `u32` to a `u8` and panic if the converted value doesn't | LL | id_u8(b32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:158:11 @@ -354,6 +394,8 @@ help: you can convert a `u64` to a `u8` and panic if the converted value doesn't | LL | id_u8(b64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:161:11 @@ -365,6 +407,8 @@ help: you can convert a `usize` to a `u8` and panic if the converted value doesn | LL | id_u8(bsize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:165:12 @@ -385,6 +429,8 @@ help: you can convert a `u32` to a `u16` and panic if the converted value doesn' | LL | id_u16(b32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:172:12 @@ -396,6 +442,8 @@ help: you can convert a `u64` to a `u16` and panic if the converted value doesn' | LL | id_u16(b64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:175:12 @@ -436,6 +484,8 @@ help: you can convert a `u64` to a `u32` and panic if the converted value doesn' | LL | id_u32(b64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:189:12 @@ -447,6 +497,8 @@ help: you can convert a `usize` to a `u32` and panic if the converted value does | LL | id_u32(bsize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:193:12 @@ -485,6 +537,8 @@ help: you can convert a `usize` to a `u64` and panic if the converted value does | LL | id_u64(bsize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:207:14 @@ -514,6 +568,8 @@ help: you can convert a `u32` to a `usize` and panic if the converted value does | LL | id_usize(b32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/integer-literal-suffix-inference.rs:216:14 @@ -525,6 +581,8 @@ help: you can convert a `u64` to a `usize` and panic if the converted value does | LL | id_usize(b64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error: aborting due to 52 previous errors diff --git a/src/test/ui/issues/issue-13359.stderr b/src/test/ui/issues/issue-13359.stderr index 115b471e96b46..d433a281e0c37 100644 --- a/src/test/ui/issues/issue-13359.stderr +++ b/src/test/ui/issues/issue-13359.stderr @@ -8,6 +8,8 @@ help: you can convert an `isize` to an `i16` and panic if the converted value do | LL | foo((1*(1 as isize)).try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/issue-13359.rs:10:9 @@ -19,6 +21,8 @@ help: you can convert a `usize` to a `u32` and panic if the converted value does | LL | bar((1*(1 as usize)).try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error: aborting due to 2 previous errors diff --git a/src/test/ui/methods/method-ambig-one-trait-unknown-int-type.stderr b/src/test/ui/methods/method-ambig-one-trait-unknown-int-type.stderr index 82660a7c41693..97bb2e15b1133 100644 --- a/src/test/ui/methods/method-ambig-one-trait-unknown-int-type.stderr +++ b/src/test/ui/methods/method-ambig-one-trait-unknown-int-type.stderr @@ -18,6 +18,8 @@ help: you can convert an `isize` to a `usize` and panic if the converted value d | LL | let y: usize = x.foo().try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error: aborting due to 2 previous errors diff --git a/src/test/ui/numeric/const-scope.stderr b/src/test/ui/numeric/const-scope.stderr index 5a275d5d089b1..59d0de2ccf9a5 100644 --- a/src/test/ui/numeric/const-scope.stderr +++ b/src/test/ui/numeric/const-scope.stderr @@ -61,6 +61,8 @@ help: you can convert an `i32` to an `i8` and panic if the converted value doesn | LL | let d: i8 = c.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error: aborting due to 6 previous errors diff --git a/src/test/ui/numeric/numeric-cast-2.stderr b/src/test/ui/numeric/numeric-cast-2.stderr index 858990fe59bd5..39b3441e26e1f 100644 --- a/src/test/ui/numeric/numeric-cast-2.stderr +++ b/src/test/ui/numeric/numeric-cast-2.stderr @@ -10,6 +10,8 @@ help: you can convert an `i32` to a `u16` and panic if the converted value doesn | LL | let x: u16 = foo().try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-2.rs:7:18 diff --git a/src/test/ui/numeric/numeric-cast-binop.stderr b/src/test/ui/numeric/numeric-cast-binop.stderr index cb051aa123021..ad182246eb25c 100644 --- a/src/test/ui/numeric/numeric-cast-binop.stderr +++ b/src/test/ui/numeric/numeric-cast-binop.stderr @@ -156,6 +156,8 @@ help: you can convert a `usize` to a `u32` and panic if the converted value does | LL | x_u32 > x_usize.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:56:17 @@ -205,6 +207,8 @@ help: you can convert a `usize` to a `u64` and panic if the converted value does | LL | x_u64 > x_usize.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:67:18 @@ -252,6 +256,8 @@ help: you can convert a `usize` to a `u128` and panic if the converted value doe | LL | x_u128 > x_usize.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:78:19 @@ -281,6 +287,8 @@ help: you can convert a `u32` to a `usize` and panic if the converted value does | LL | x_usize > x_u32.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:84:19 @@ -292,6 +300,8 @@ help: you can convert a `u64` to a `usize` and panic if the converted value does | LL | x_usize > x_u64.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:86:19 @@ -303,6 +313,8 @@ help: you can convert a `u128` to a `usize` and panic if the converted value doe | LL | x_usize > x_u128.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:92:16 @@ -462,6 +474,8 @@ help: you can convert an `isize` to an `i32` and panic if the converted value do | LL | x_i32 > x_isize.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:125:17 @@ -511,6 +525,8 @@ help: you can convert an `isize` to an `i64` and panic if the converted value do | LL | x_i64 > x_isize.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:136:18 @@ -558,6 +574,8 @@ help: you can convert an `isize` to an `i128` and panic if the converted value d | LL | x_i128 > x_isize.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:147:19 @@ -587,6 +605,8 @@ help: you can convert an `i32` to an `isize` and panic if the converted value do | LL | x_isize > x_i32.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:153:19 @@ -598,6 +618,8 @@ help: you can convert an `i64` to an `isize` and panic if the converted value do | LL | x_isize > x_i64.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:155:19 @@ -609,6 +631,8 @@ help: you can convert an `i128` to an `isize` and panic if the converted value d | LL | x_isize > x_i128.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:161:16 @@ -620,6 +644,8 @@ help: you can convert an `i8` to a `u8` and panic if the converted value doesn't | LL | x_u8 > x_i8.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:163:16 @@ -686,6 +712,8 @@ help: you can convert an `i8` to a `u16` and panic if the converted value doesn' | LL | x_u16 > x_i8.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:176:17 @@ -697,6 +725,8 @@ help: you can convert an `i16` to a `u16` and panic if the converted value doesn | LL | x_u16 > x_i16.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:178:17 @@ -741,6 +771,8 @@ help: you can convert an `isize` to a `u16` and panic if the converted value doe | LL | x_u16 > x_isize.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:187:17 @@ -752,6 +784,8 @@ help: you can convert an `i8` to a `u32` and panic if the converted value doesn' | LL | x_u32 > x_i8.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:189:17 @@ -763,6 +797,8 @@ help: you can convert an `i16` to a `u32` and panic if the converted value doesn | LL | x_u32 > x_i16.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:191:17 @@ -774,6 +810,8 @@ help: you can convert an `i32` to a `u32` and panic if the converted value doesn | LL | x_u32 > x_i32.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:193:17 @@ -807,6 +845,8 @@ help: you can convert an `isize` to a `u32` and panic if the converted value doe | LL | x_u32 > x_isize.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:200:17 @@ -818,6 +858,8 @@ help: you can convert an `i8` to a `u64` and panic if the converted value doesn' | LL | x_u64 > x_i8.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:202:17 @@ -829,6 +871,8 @@ help: you can convert an `i16` to a `u64` and panic if the converted value doesn | LL | x_u64 > x_i16.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:204:17 @@ -840,6 +884,8 @@ help: you can convert an `i32` to a `u64` and panic if the converted value doesn | LL | x_u64 > x_i32.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:206:17 @@ -851,6 +897,8 @@ help: you can convert an `i64` to a `u64` and panic if the converted value doesn | LL | x_u64 > x_i64.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:208:17 @@ -873,6 +921,8 @@ help: you can convert an `isize` to a `u64` and panic if the converted value doe | LL | x_u64 > x_isize.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:213:18 @@ -884,6 +934,8 @@ help: you can convert an `i8` to a `u128` and panic if the converted value doesn | LL | x_u128 > x_i8.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:215:18 @@ -895,6 +947,8 @@ help: you can convert an `i16` to a `u128` and panic if the converted value does | LL | x_u128 > x_i16.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:217:18 @@ -906,6 +960,8 @@ help: you can convert an `i32` to a `u128` and panic if the converted value does | LL | x_u128 > x_i32.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:219:18 @@ -917,6 +973,8 @@ help: you can convert an `i64` to a `u128` and panic if the converted value does | LL | x_u128 > x_i64.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:221:18 @@ -928,6 +986,8 @@ help: you can convert an `i128` to a `u128` and panic if the converted value doe | LL | x_u128 > x_i128.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:223:18 @@ -939,6 +999,8 @@ help: you can convert an `isize` to a `u128` and panic if the converted value do | LL | x_u128 > x_isize.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:226:19 @@ -950,6 +1012,8 @@ help: you can convert an `i8` to a `usize` and panic if the converted value does | LL | x_usize > x_i8.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:228:19 @@ -961,6 +1025,8 @@ help: you can convert an `i16` to a `usize` and panic if the converted value doe | LL | x_usize > x_i16.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:230:19 @@ -972,6 +1038,8 @@ help: you can convert an `i32` to a `usize` and panic if the converted value doe | LL | x_usize > x_i32.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:232:19 @@ -983,6 +1051,8 @@ help: you can convert an `i64` to a `usize` and panic if the converted value doe | LL | x_usize > x_i64.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:234:19 @@ -994,6 +1064,8 @@ help: you can convert an `i128` to a `usize` and panic if the converted value do | LL | x_usize > x_i128.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:236:19 @@ -1005,6 +1077,8 @@ help: you can convert an `isize` to a `usize` and panic if the converted value d | LL | x_usize > x_isize.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:242:16 @@ -1016,6 +1090,8 @@ help: you can convert a `u8` to an `i8` and panic if the converted value doesn't | LL | x_i8 > x_u8.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:244:16 @@ -1027,6 +1103,8 @@ help: you can convert a `u16` to an `i8` and panic if the converted value doesn' | LL | x_i8 > x_u16.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:246:16 @@ -1038,6 +1116,8 @@ help: you can convert a `u32` to an `i8` and panic if the converted value doesn' | LL | x_i8 > x_u32.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:248:16 @@ -1049,6 +1129,8 @@ help: you can convert a `u64` to an `i8` and panic if the converted value doesn' | LL | x_i8 > x_u64.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:250:16 @@ -1060,6 +1142,8 @@ help: you can convert a `u128` to an `i8` and panic if the converted value doesn | LL | x_i8 > x_u128.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:252:16 @@ -1071,6 +1155,8 @@ help: you can convert a `usize` to an `i8` and panic if the converted value does | LL | x_i8 > x_usize.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:255:17 @@ -1091,6 +1177,8 @@ help: you can convert a `u16` to an `i16` and panic if the converted value doesn | LL | x_i16 > x_u16.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:259:17 @@ -1102,6 +1190,8 @@ help: you can convert a `u32` to an `i16` and panic if the converted value doesn | LL | x_i16 > x_u32.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:261:17 @@ -1113,6 +1203,8 @@ help: you can convert a `u64` to an `i16` and panic if the converted value doesn | LL | x_i16 > x_u64.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:263:17 @@ -1124,6 +1216,8 @@ help: you can convert a `u128` to an `i16` and panic if the converted value does | LL | x_i16 > x_u128.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:265:17 @@ -1135,6 +1229,8 @@ help: you can convert a `usize` to an `i16` and panic if the converted value doe | LL | x_i16 > x_usize.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:268:17 @@ -1164,6 +1260,8 @@ help: you can convert a `u32` to an `i32` and panic if the converted value doesn | LL | x_i32 > x_u32.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:274:17 @@ -1175,6 +1273,8 @@ help: you can convert a `u64` to an `i32` and panic if the converted value doesn | LL | x_i32 > x_u64.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:276:17 @@ -1186,6 +1286,8 @@ help: you can convert a `u128` to an `i32` and panic if the converted value does | LL | x_i32 > x_u128.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:278:17 @@ -1197,6 +1299,8 @@ help: you can convert a `usize` to an `i32` and panic if the converted value doe | LL | x_i32 > x_usize.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:281:17 @@ -1235,6 +1339,8 @@ help: you can convert a `u64` to an `i64` and panic if the converted value doesn | LL | x_i64 > x_u64.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:289:17 @@ -1246,6 +1352,8 @@ help: you can convert a `u128` to an `i64` and panic if the converted value does | LL | x_i64 > x_u128.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:291:17 @@ -1257,6 +1365,8 @@ help: you can convert a `usize` to an `i64` and panic if the converted value doe | LL | x_i64 > x_usize.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:294:18 @@ -1304,6 +1414,8 @@ help: you can convert a `u128` to an `i128` and panic if the converted value doe | LL | x_i128 > x_u128.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:304:18 @@ -1315,6 +1427,8 @@ help: you can convert a `usize` to an `i128` and panic if the converted value do | LL | x_i128 > x_usize.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:307:19 @@ -1335,6 +1449,8 @@ help: you can convert a `u16` to an `isize` and panic if the converted value doe | LL | x_isize > x_u16.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:311:19 @@ -1346,7 +1462,8 @@ help: you can convert a `u32` to an `isize` and panic if the converted value doe | LL | x_isize > x_u32.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ - + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:313:19 | @@ -1357,6 +1474,8 @@ help: you can convert a `u64` to an `isize` and panic if the converted value doe | LL | x_isize > x_u64.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:315:19 @@ -1368,6 +1487,8 @@ help: you can convert a `u128` to an `isize` and panic if the converted value do | LL | x_isize > x_u128.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:317:19 @@ -1379,6 +1500,8 @@ help: you can convert a `usize` to an `isize` and panic if the converted value d | LL | x_isize > x_usize.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error: aborting due to 132 previous errors diff --git a/src/test/ui/numeric/numeric-cast.stderr b/src/test/ui/numeric/numeric-cast.stderr index ffd6368bac15f..2f29556742f9b 100644 --- a/src/test/ui/numeric/numeric-cast.stderr +++ b/src/test/ui/numeric/numeric-cast.stderr @@ -8,6 +8,8 @@ help: you can convert a `u64` to a `usize` and panic if the converted value does | LL | foo::(x_u64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:25:18 @@ -19,6 +21,8 @@ help: you can convert a `u32` to a `usize` and panic if the converted value does | LL | foo::(x_u32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:27:18 @@ -48,6 +52,8 @@ help: you can convert an `isize` to a `usize` and panic if the converted value d | LL | foo::(x_isize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:33:18 @@ -59,6 +65,8 @@ help: you can convert an `i64` to a `usize` and panic if the converted value doe | LL | foo::(x_i64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:35:18 @@ -70,6 +78,8 @@ help: you can convert an `i32` to a `usize` and panic if the converted value doe | LL | foo::(x_i32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:37:18 @@ -81,6 +91,8 @@ help: you can convert an `i16` to a `usize` and panic if the converted value doe | LL | foo::(x_i16.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:39:18 @@ -92,6 +104,8 @@ help: you can convert an `i8` to a `usize` and panic if the converted value does | LL | foo::(x_i8.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:44:18 @@ -103,6 +117,8 @@ help: you can convert a `usize` to an `isize` and panic if the converted value d | LL | foo::(x_usize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:46:18 @@ -114,6 +130,8 @@ help: you can convert a `u64` to an `isize` and panic if the converted value doe | LL | foo::(x_u64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:48:18 @@ -125,6 +143,8 @@ help: you can convert a `u32` to an `isize` and panic if the converted value doe | LL | foo::(x_u32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:50:18 @@ -136,6 +156,8 @@ help: you can convert a `u16` to an `isize` and panic if the converted value doe | LL | foo::(x_u16.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:52:18 @@ -156,6 +178,8 @@ help: you can convert an `i64` to an `isize` and panic if the converted value do | LL | foo::(x_i64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:57:18 @@ -167,6 +191,8 @@ help: you can convert an `i32` to an `isize` and panic if the converted value do | LL | foo::(x_i32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:59:18 @@ -196,6 +222,8 @@ help: you can convert a `usize` to a `u64` and panic if the converted value does | LL | foo::(x_usize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:69:16 @@ -234,6 +262,8 @@ help: you can convert an `isize` to a `u64` and panic if the converted value doe | LL | foo::(x_isize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:77:16 @@ -245,6 +275,8 @@ help: you can convert an `i64` to a `u64` and panic if the converted value doesn | LL | foo::(x_i64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:79:16 @@ -256,6 +288,8 @@ help: you can convert an `i32` to a `u64` and panic if the converted value doesn | LL | foo::(x_i32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:81:16 @@ -267,6 +301,8 @@ help: you can convert an `i16` to a `u64` and panic if the converted value doesn | LL | foo::(x_i16.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:83:16 @@ -278,6 +314,8 @@ help: you can convert an `i8` to a `u64` and panic if the converted value doesn' | LL | foo::(x_i8.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:88:16 @@ -289,6 +327,8 @@ help: you can convert a `usize` to an `i64` and panic if the converted value doe | LL | foo::(x_usize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:90:16 @@ -300,6 +340,8 @@ help: you can convert a `u64` to an `i64` and panic if the converted value doesn | LL | foo::(x_u64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:92:16 @@ -338,6 +380,8 @@ help: you can convert an `isize` to an `i64` and panic if the converted value do | LL | foo::(x_isize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:101:16 @@ -376,6 +420,8 @@ help: you can convert a `usize` to a `u32` and panic if the converted value does | LL | foo::(x_usize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:112:16 @@ -387,6 +433,8 @@ help: you can convert a `u64` to a `u32` and panic if the converted value doesn' | LL | foo::(x_u64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:115:16 @@ -416,6 +464,8 @@ help: you can convert an `isize` to a `u32` and panic if the converted value doe | LL | foo::(x_isize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:121:16 @@ -427,6 +477,8 @@ help: you can convert an `i64` to a `u32` and panic if the converted value doesn | LL | foo::(x_i64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:123:16 @@ -438,6 +490,8 @@ help: you can convert an `i32` to a `u32` and panic if the converted value doesn | LL | foo::(x_i32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:125:16 @@ -449,6 +503,8 @@ help: you can convert an `i16` to a `u32` and panic if the converted value doesn | LL | foo::(x_i16.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:127:16 @@ -460,6 +516,8 @@ help: you can convert an `i8` to a `u32` and panic if the converted value doesn' | LL | foo::(x_i8.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:132:16 @@ -471,6 +529,8 @@ help: you can convert a `usize` to an `i32` and panic if the converted value doe | LL | foo::(x_usize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:134:16 @@ -482,6 +542,8 @@ help: you can convert a `u64` to an `i32` and panic if the converted value doesn | LL | foo::(x_u64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:136:16 @@ -493,6 +555,8 @@ help: you can convert a `u32` to an `i32` and panic if the converted value doesn | LL | foo::(x_u32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:138:16 @@ -522,6 +586,8 @@ help: you can convert an `isize` to an `i32` and panic if the converted value do | LL | foo::(x_isize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:144:16 @@ -533,6 +599,8 @@ help: you can convert an `i64` to an `i32` and panic if the converted value does | LL | foo::(x_i64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:147:16 @@ -562,6 +630,8 @@ help: you can convert a `usize` to a `u16` and panic if the converted value does | LL | foo::(x_usize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:156:16 @@ -573,6 +643,8 @@ help: you can convert a `u64` to a `u16` and panic if the converted value doesn' | LL | foo::(x_u64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:158:16 @@ -584,7 +656,8 @@ help: you can convert a `u32` to a `u16` and panic if the converted value doesn' | LL | foo::(x_u32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ - + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:161:16 | @@ -604,6 +677,8 @@ help: you can convert an `isize` to a `u16` and panic if the converted value doe | LL | foo::(x_isize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:165:16 @@ -615,6 +690,8 @@ help: you can convert an `i64` to a `u16` and panic if the converted value doesn | LL | foo::(x_i64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:167:16 @@ -626,6 +703,8 @@ help: you can convert an `i32` to a `u16` and panic if the converted value doesn | LL | foo::(x_i32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:169:16 @@ -637,6 +716,8 @@ help: you can convert an `i16` to a `u16` and panic if the converted value doesn | LL | foo::(x_i16.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:171:16 @@ -648,6 +729,8 @@ help: you can convert an `i8` to a `u16` and panic if the converted value doesn' | LL | foo::(x_i8.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:176:16 @@ -659,6 +742,8 @@ help: you can convert a `usize` to an `i16` and panic if the converted value doe | LL | foo::(x_usize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:178:16 @@ -670,6 +755,8 @@ help: you can convert a `u64` to an `i16` and panic if the converted value doesn | LL | foo::(x_u64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:180:16 @@ -681,6 +768,8 @@ help: you can convert a `u32` to an `i16` and panic if the converted value doesn | LL | foo::(x_u32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:182:16 @@ -692,6 +781,8 @@ help: you can convert a `u16` to an `i16` and panic if the converted value doesn | LL | foo::(x_u16.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:184:16 @@ -712,6 +803,8 @@ help: you can convert an `isize` to an `i16` and panic if the converted value do | LL | foo::(x_isize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:188:16 @@ -723,6 +816,8 @@ help: you can convert an `i64` to an `i16` and panic if the converted value does | LL | foo::(x_i64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:190:16 @@ -734,6 +829,8 @@ help: you can convert an `i32` to an `i16` and panic if the converted value does | LL | foo::(x_i32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:193:16 @@ -754,6 +851,8 @@ help: you can convert a `usize` to a `u8` and panic if the converted value doesn | LL | foo::(x_usize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:200:15 @@ -765,6 +864,8 @@ help: you can convert a `u64` to a `u8` and panic if the converted value doesn't | LL | foo::(x_u64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:202:15 @@ -776,6 +877,8 @@ help: you can convert a `u32` to a `u8` and panic if the converted value doesn't | LL | foo::(x_u32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:204:15 @@ -787,6 +890,8 @@ help: you can convert a `u16` to a `u8` and panic if the converted value doesn't | LL | foo::(x_u16.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:207:15 @@ -798,6 +903,8 @@ help: you can convert an `isize` to a `u8` and panic if the converted value does | LL | foo::(x_isize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:209:15 @@ -809,6 +916,8 @@ help: you can convert an `i64` to a `u8` and panic if the converted value doesn' | LL | foo::(x_i64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:211:15 @@ -820,6 +929,8 @@ help: you can convert an `i32` to a `u8` and panic if the converted value doesn' | LL | foo::(x_i32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:213:15 @@ -831,6 +942,8 @@ help: you can convert an `i16` to a `u8` and panic if the converted value doesn' | LL | foo::(x_i16.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:215:15 @@ -842,6 +955,8 @@ help: you can convert an `i8` to a `u8` and panic if the converted value doesn't | LL | foo::(x_i8.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:220:15 @@ -853,6 +968,8 @@ help: you can convert a `usize` to an `i8` and panic if the converted value does | LL | foo::(x_usize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:222:15 @@ -864,6 +981,8 @@ help: you can convert a `u64` to an `i8` and panic if the converted value doesn' | LL | foo::(x_u64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:224:15 @@ -875,6 +994,8 @@ help: you can convert a `u32` to an `i8` and panic if the converted value doesn' | LL | foo::(x_u32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:226:15 @@ -886,6 +1007,8 @@ help: you can convert a `u16` to an `i8` and panic if the converted value doesn' | LL | foo::(x_u16.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:228:15 @@ -897,6 +1020,8 @@ help: you can convert a `u8` to an `i8` and panic if the converted value doesn't | LL | foo::(x_u8.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:230:15 @@ -908,6 +1033,8 @@ help: you can convert an `isize` to an `i8` and panic if the converted value doe | LL | foo::(x_isize.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:232:15 @@ -919,6 +1046,8 @@ help: you can convert an `i64` to an `i8` and panic if the converted value doesn | LL | foo::(x_i64.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:234:15 @@ -930,6 +1059,8 @@ help: you can convert an `i32` to an `i8` and panic if the converted value doesn | LL | foo::(x_i32.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:236:15 @@ -941,6 +1072,8 @@ help: you can convert an `i16` to an `i8` and panic if the converted value doesn | LL | foo::(x_i16.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/numeric-cast.rs:242:16 diff --git a/src/test/ui/shift-various-bad-types.stderr b/src/test/ui/shift-various-bad-types.stderr index 63b70f7fcd95c..e141cd8cbff0f 100644 --- a/src/test/ui/shift-various-bad-types.stderr +++ b/src/test/ui/shift-various-bad-types.stderr @@ -30,10 +30,11 @@ LL | let _: i32 = 22_i64 >> 1_i32; | | | expected due to this | -help: you can convert an `i64` to an `i32` and panic if the converted value doesn't fit +help: you can convert an `i64` to an `i32` and panic if the converted value doesn't fit by adding `use std::convert::TryInto;` | LL | let _: i32 = (22_i64 >> 1_i32).try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | error: aborting due to 4 previous errors diff --git a/src/test/ui/tutorial-suffix-inference-test.stderr b/src/test/ui/tutorial-suffix-inference-test.stderr index f9974acfb7071..8982f4a16f3a2 100644 --- a/src/test/ui/tutorial-suffix-inference-test.stderr +++ b/src/test/ui/tutorial-suffix-inference-test.stderr @@ -17,6 +17,8 @@ help: you can convert an `i32` to a `u16` and panic if the converted value doesn | LL | identity_u16(y.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error[E0308]: mismatched types --> $DIR/tutorial-suffix-inference-test.rs:21:18 @@ -28,6 +30,8 @@ help: you can convert an `isize` to a `u16` and panic if the converted value doe | LL | identity_u16(a.try_into().unwrap()); | ^^^^^^^^^^^^^^^^^^^^^ + | + = note: you have import `std::convert::TryInto;` before using `try_into()` error: aborting due to 3 previous errors