From 132a140214522246bef5da015f5cfb78da7074be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Fri, 2 Dec 2022 15:56:37 -0800 Subject: [PATCH] Point at LHS on binop type err if relevant --- compiler/rustc_hir_typeck/src/demand.rs | 12 +- ...-default_trait_method_normalization.stderr | 4 +- src/test/ui/inference/deref-suggestion.stderr | 5 +- src/test/ui/issues/issue-47486.stderr | 4 +- src/test/ui/numeric/numeric-cast-binop.stderr | 528 +++++++++++++----- .../ui/numeric/numeric-cast-no-fix.stderr | 144 +++-- src/test/ui/parser/bare-struct-body.stderr | 4 +- .../chained-comparison-suggestion.stderr | 24 +- src/test/ui/pptypedef.stderr | 8 +- .../dont-suggest-try_into-in-macros.stderr | 5 +- src/test/ui/suggestions/option-to-bool.stderr | 4 +- .../type/type-check/assignment-in-if.stderr | 8 +- .../type-params-in-different-spaces-1.stderr | 4 +- src/test/ui/wrong-mul-method-signature.stderr | 4 +- 14 files changed, 571 insertions(+), 187 deletions(-) diff --git a/compiler/rustc_hir_typeck/src/demand.rs b/compiler/rustc_hir_typeck/src/demand.rs index 24184bdbf5cdc..6763e06c0cfee 100644 --- a/compiler/rustc_hir_typeck/src/demand.rs +++ b/compiler/rustc_hir_typeck/src/demand.rs @@ -189,7 +189,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { &self, err: &mut Diagnostic, expr: &hir::Expr<'_>, - error: Option>, + error: Option>, ) { let parent = self.tcx.hir().get_parent_node(expr.hir_id); match (self.tcx.hir().find(parent), error) { @@ -286,6 +286,16 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { err.downgrade_to_delayed_bug(); } } + ( + Some(hir::Node::Expr(hir::Expr { + kind: hir::ExprKind::Binary(_, lhs, rhs), .. + })), + Some(TypeError::Sorts(ExpectedFound { expected, .. })), + ) if rhs.hir_id == expr.hir_id + && self.typeck_results.borrow().expr_ty_adjusted_opt(lhs) == Some(expected) => + { + err.span_label(lhs.span, &format!("expected because this is `{expected}`")); + } _ => {} } } diff --git a/src/test/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.stderr b/src/test/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.stderr index c90774e944f1f..029528c3a8172 100644 --- a/src/test/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.stderr +++ b/src/test/ui/const-generics/generic_const_exprs/issue-79518-default_trait_method_normalization.stderr @@ -2,7 +2,9 @@ error[E0308]: mismatched types --> $DIR/issue-79518-default_trait_method_normalization.rs:16:32 | LL | Self::AssocInstance == [(); std::mem::size_of::()]; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected associated type, found array `[(); _]` + | ------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected associated type, found array `[(); _]` + | | + | expected because this is `::Assoc` | = note: expected associated type `::Assoc` found array `[(); _]` diff --git a/src/test/ui/inference/deref-suggestion.stderr b/src/test/ui/inference/deref-suggestion.stderr index 034005697b434..3db67cdb5370a 100644 --- a/src/test/ui/inference/deref-suggestion.stderr +++ b/src/test/ui/inference/deref-suggestion.stderr @@ -87,7 +87,10 @@ error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:37:5 | LL | assert_eq!(3i32, &3i32); - | ^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `&i32` + | ^^^^^^^^^^^^^^^^^^^^^^^ + | | + | expected `i32`, found `&i32` + | expected because this is `i32` | = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/src/test/ui/issues/issue-47486.stderr b/src/test/ui/issues/issue-47486.stderr index 2bd24f08c1e51..c7e9af70e64a7 100644 --- a/src/test/ui/issues/issue-47486.stderr +++ b/src/test/ui/issues/issue-47486.stderr @@ -2,7 +2,9 @@ error[E0308]: mismatched types --> $DIR/issue-47486.rs:2:10 | LL | () < std::mem::size_of::<_>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `usize` + | -- ^^^^^^^^^^^^^^^^^^^^^^^^ expected `()`, found `usize` + | | + | expected because this is `()` error[E0282]: type annotations needed --> $DIR/issue-47486.rs:3:11 diff --git a/src/test/ui/numeric/numeric-cast-binop.stderr b/src/test/ui/numeric/numeric-cast-binop.stderr index 2f58f164985db..d5213e3f5b690 100644 --- a/src/test/ui/numeric/numeric-cast-binop.stderr +++ b/src/test/ui/numeric/numeric-cast-binop.stderr @@ -2,7 +2,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:23:16 | LL | x_u8 > x_u16; - | ^^^^^ expected `u8`, found `u16` + | ---- ^^^^^ expected `u8`, found `u16` + | | + | expected because this is `u8` | help: you can convert `x_u8` from `u8` to `u16`, matching the type of `x_u16` | @@ -13,7 +15,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:25:16 | LL | x_u8 > x_u32; - | ^^^^^ expected `u8`, found `u32` + | ---- ^^^^^ expected `u8`, found `u32` + | | + | expected because this is `u8` | help: you can convert `x_u8` from `u8` to `u32`, matching the type of `x_u32` | @@ -24,7 +28,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:27:16 | LL | x_u8 > x_u64; - | ^^^^^ expected `u8`, found `u64` + | ---- ^^^^^ expected `u8`, found `u64` + | | + | expected because this is `u8` | help: you can convert `x_u8` from `u8` to `u64`, matching the type of `x_u64` | @@ -35,7 +41,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:29:16 | LL | x_u8 > x_u128; - | ^^^^^^ expected `u8`, found `u128` + | ---- ^^^^^^ expected `u8`, found `u128` + | | + | expected because this is `u8` | help: you can convert `x_u8` from `u8` to `u128`, matching the type of `x_u128` | @@ -46,7 +54,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:31:16 | LL | x_u8 > x_usize; - | ^^^^^^^ expected `u8`, found `usize` + | ---- ^^^^^^^ expected `u8`, found `usize` + | | + | expected because this is `u8` | help: you can convert `x_u8` from `u8` to `usize`, matching the type of `x_usize` | @@ -57,7 +67,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:34:17 | LL | x_u16 > x_u8; - | ^^^^ expected `u16`, found `u8` + | ----- ^^^^ expected `u16`, found `u8` + | | + | expected because this is `u16` | help: you can convert a `u8` to a `u16` | @@ -68,7 +80,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:36:17 | LL | x_u16 > x_u32; - | ^^^^^ expected `u16`, found `u32` + | ----- ^^^^^ expected `u16`, found `u32` + | | + | expected because this is `u16` | help: you can convert `x_u16` from `u16` to `u32`, matching the type of `x_u32` | @@ -79,7 +93,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:38:17 | LL | x_u16 > x_u64; - | ^^^^^ expected `u16`, found `u64` + | ----- ^^^^^ expected `u16`, found `u64` + | | + | expected because this is `u16` | help: you can convert `x_u16` from `u16` to `u64`, matching the type of `x_u64` | @@ -90,7 +106,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:40:17 | LL | x_u16 > x_u128; - | ^^^^^^ expected `u16`, found `u128` + | ----- ^^^^^^ expected `u16`, found `u128` + | | + | expected because this is `u16` | help: you can convert `x_u16` from `u16` to `u128`, matching the type of `x_u128` | @@ -101,7 +119,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:42:17 | LL | x_u16 > x_usize; - | ^^^^^^^ expected `u16`, found `usize` + | ----- ^^^^^^^ expected `u16`, found `usize` + | | + | expected because this is `u16` | help: you can convert `x_u16` from `u16` to `usize`, matching the type of `x_usize` | @@ -112,7 +132,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:45:17 | LL | x_u32 > x_u8; - | ^^^^ expected `u32`, found `u8` + | ----- ^^^^ expected `u32`, found `u8` + | | + | expected because this is `u32` | help: you can convert a `u8` to a `u32` | @@ -123,7 +145,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:47:17 | LL | x_u32 > x_u16; - | ^^^^^ expected `u32`, found `u16` + | ----- ^^^^^ expected `u32`, found `u16` + | | + | expected because this is `u32` | help: you can convert a `u16` to a `u32` | @@ -134,7 +158,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:49:17 | LL | x_u32 > x_u64; - | ^^^^^ expected `u32`, found `u64` + | ----- ^^^^^ expected `u32`, found `u64` + | | + | expected because this is `u32` | help: you can convert `x_u32` from `u32` to `u64`, matching the type of `x_u64` | @@ -145,7 +171,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:51:17 | LL | x_u32 > x_u128; - | ^^^^^^ expected `u32`, found `u128` + | ----- ^^^^^^ expected `u32`, found `u128` + | | + | expected because this is `u32` | help: you can convert `x_u32` from `u32` to `u128`, matching the type of `x_u128` | @@ -156,7 +184,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:53:17 | LL | x_u32 > x_usize; - | ^^^^^^^ expected `u32`, found `usize` + | ----- ^^^^^^^ expected `u32`, found `usize` + | | + | expected because this is `u32` | help: you can convert a `usize` to a `u32` and panic if the converted value doesn't fit | @@ -167,7 +197,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:56:17 | LL | x_u64 > x_u8; - | ^^^^ expected `u64`, found `u8` + | ----- ^^^^ expected `u64`, found `u8` + | | + | expected because this is `u64` | help: you can convert a `u8` to a `u64` | @@ -178,7 +210,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:58:17 | LL | x_u64 > x_u16; - | ^^^^^ expected `u64`, found `u16` + | ----- ^^^^^ expected `u64`, found `u16` + | | + | expected because this is `u64` | help: you can convert a `u16` to a `u64` | @@ -189,7 +223,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:60:17 | LL | x_u64 > x_u32; - | ^^^^^ expected `u64`, found `u32` + | ----- ^^^^^ expected `u64`, found `u32` + | | + | expected because this is `u64` | help: you can convert a `u32` to a `u64` | @@ -200,7 +236,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:62:17 | LL | x_u64 > x_u128; - | ^^^^^^ expected `u64`, found `u128` + | ----- ^^^^^^ expected `u64`, found `u128` + | | + | expected because this is `u64` | help: you can convert `x_u64` from `u64` to `u128`, matching the type of `x_u128` | @@ -211,7 +249,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:64:17 | LL | x_u64 > x_usize; - | ^^^^^^^ expected `u64`, found `usize` + | ----- ^^^^^^^ expected `u64`, found `usize` + | | + | expected because this is `u64` | help: you can convert a `usize` to a `u64` and panic if the converted value doesn't fit | @@ -222,7 +262,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:67:18 | LL | x_u128 > x_u8; - | ^^^^ expected `u128`, found `u8` + | ------ ^^^^ expected `u128`, found `u8` + | | + | expected because this is `u128` | help: you can convert a `u8` to a `u128` | @@ -233,7 +275,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:69:18 | LL | x_u128 > x_u16; - | ^^^^^ expected `u128`, found `u16` + | ------ ^^^^^ expected `u128`, found `u16` + | | + | expected because this is `u128` | help: you can convert a `u16` to a `u128` | @@ -244,7 +288,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:71:18 | LL | x_u128 > x_u32; - | ^^^^^ expected `u128`, found `u32` + | ------ ^^^^^ expected `u128`, found `u32` + | | + | expected because this is `u128` | help: you can convert a `u32` to a `u128` | @@ -255,7 +301,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:73:18 | LL | x_u128 > x_u64; - | ^^^^^ expected `u128`, found `u64` + | ------ ^^^^^ expected `u128`, found `u64` + | | + | expected because this is `u128` | help: you can convert a `u64` to a `u128` | @@ -266,7 +314,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:75:18 | LL | x_u128 > x_usize; - | ^^^^^^^ expected `u128`, found `usize` + | ------ ^^^^^^^ expected `u128`, found `usize` + | | + | expected because this is `u128` | help: you can convert a `usize` to a `u128` and panic if the converted value doesn't fit | @@ -277,7 +327,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:78:19 | LL | x_usize > x_u8; - | ^^^^ expected `usize`, found `u8` + | ------- ^^^^ expected `usize`, found `u8` + | | + | expected because this is `usize` | help: you can convert a `u8` to a `usize` | @@ -288,7 +340,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:80:19 | LL | x_usize > x_u16; - | ^^^^^ expected `usize`, found `u16` + | ------- ^^^^^ expected `usize`, found `u16` + | | + | expected because this is `usize` | help: you can convert a `u16` to a `usize` | @@ -299,7 +353,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:82:19 | LL | x_usize > x_u32; - | ^^^^^ expected `usize`, found `u32` + | ------- ^^^^^ expected `usize`, found `u32` + | | + | expected because this is `usize` | help: you can convert a `u32` to a `usize` and panic if the converted value doesn't fit | @@ -310,7 +366,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:84:19 | LL | x_usize > x_u64; - | ^^^^^ expected `usize`, found `u64` + | ------- ^^^^^ expected `usize`, found `u64` + | | + | expected because this is `usize` | help: you can convert a `u64` to a `usize` and panic if the converted value doesn't fit | @@ -321,7 +379,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:86:19 | LL | x_usize > x_u128; - | ^^^^^^ expected `usize`, found `u128` + | ------- ^^^^^^ expected `usize`, found `u128` + | | + | expected because this is `usize` | help: you can convert a `u128` to a `usize` and panic if the converted value doesn't fit | @@ -332,7 +392,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:92:16 | LL | x_i8 > x_i16; - | ^^^^^ expected `i8`, found `i16` + | ---- ^^^^^ expected `i8`, found `i16` + | | + | expected because this is `i8` | help: you can convert `x_i8` from `i8` to `i16`, matching the type of `x_i16` | @@ -343,7 +405,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:94:16 | LL | x_i8 > x_i32; - | ^^^^^ expected `i8`, found `i32` + | ---- ^^^^^ expected `i8`, found `i32` + | | + | expected because this is `i8` | help: you can convert `x_i8` from `i8` to `i32`, matching the type of `x_i32` | @@ -354,7 +418,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:96:16 | LL | x_i8 > x_i64; - | ^^^^^ expected `i8`, found `i64` + | ---- ^^^^^ expected `i8`, found `i64` + | | + | expected because this is `i8` | help: you can convert `x_i8` from `i8` to `i64`, matching the type of `x_i64` | @@ -365,7 +431,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:98:16 | LL | x_i8 > x_i128; - | ^^^^^^ expected `i8`, found `i128` + | ---- ^^^^^^ expected `i8`, found `i128` + | | + | expected because this is `i8` | help: you can convert `x_i8` from `i8` to `i128`, matching the type of `x_i128` | @@ -376,7 +444,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:100:16 | LL | x_i8 > x_isize; - | ^^^^^^^ expected `i8`, found `isize` + | ---- ^^^^^^^ expected `i8`, found `isize` + | | + | expected because this is `i8` | help: you can convert `x_i8` from `i8` to `isize`, matching the type of `x_isize` | @@ -387,7 +457,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:103:17 | LL | x_i16 > x_i8; - | ^^^^ expected `i16`, found `i8` + | ----- ^^^^ expected `i16`, found `i8` + | | + | expected because this is `i16` | help: you can convert an `i8` to an `i16` | @@ -398,7 +470,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:105:17 | LL | x_i16 > x_i32; - | ^^^^^ expected `i16`, found `i32` + | ----- ^^^^^ expected `i16`, found `i32` + | | + | expected because this is `i16` | help: you can convert `x_i16` from `i16` to `i32`, matching the type of `x_i32` | @@ -409,7 +483,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:107:17 | LL | x_i16 > x_i64; - | ^^^^^ expected `i16`, found `i64` + | ----- ^^^^^ expected `i16`, found `i64` + | | + | expected because this is `i16` | help: you can convert `x_i16` from `i16` to `i64`, matching the type of `x_i64` | @@ -420,7 +496,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:109:17 | LL | x_i16 > x_i128; - | ^^^^^^ expected `i16`, found `i128` + | ----- ^^^^^^ expected `i16`, found `i128` + | | + | expected because this is `i16` | help: you can convert `x_i16` from `i16` to `i128`, matching the type of `x_i128` | @@ -431,7 +509,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:111:17 | LL | x_i16 > x_isize; - | ^^^^^^^ expected `i16`, found `isize` + | ----- ^^^^^^^ expected `i16`, found `isize` + | | + | expected because this is `i16` | help: you can convert `x_i16` from `i16` to `isize`, matching the type of `x_isize` | @@ -442,7 +522,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:114:17 | LL | x_i32 > x_i8; - | ^^^^ expected `i32`, found `i8` + | ----- ^^^^ expected `i32`, found `i8` + | | + | expected because this is `i32` | help: you can convert an `i8` to an `i32` | @@ -453,7 +535,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:116:17 | LL | x_i32 > x_i16; - | ^^^^^ expected `i32`, found `i16` + | ----- ^^^^^ expected `i32`, found `i16` + | | + | expected because this is `i32` | help: you can convert an `i16` to an `i32` | @@ -464,7 +548,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:118:17 | LL | x_i32 > x_i64; - | ^^^^^ expected `i32`, found `i64` + | ----- ^^^^^ expected `i32`, found `i64` + | | + | expected because this is `i32` | help: you can convert `x_i32` from `i32` to `i64`, matching the type of `x_i64` | @@ -475,7 +561,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:120:17 | LL | x_i32 > x_i128; - | ^^^^^^ expected `i32`, found `i128` + | ----- ^^^^^^ expected `i32`, found `i128` + | | + | expected because this is `i32` | help: you can convert `x_i32` from `i32` to `i128`, matching the type of `x_i128` | @@ -486,7 +574,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:122:17 | LL | x_i32 > x_isize; - | ^^^^^^^ expected `i32`, found `isize` + | ----- ^^^^^^^ expected `i32`, found `isize` + | | + | expected because this is `i32` | help: you can convert an `isize` to an `i32` and panic if the converted value doesn't fit | @@ -497,7 +587,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:125:17 | LL | x_i64 > x_i8; - | ^^^^ expected `i64`, found `i8` + | ----- ^^^^ expected `i64`, found `i8` + | | + | expected because this is `i64` | help: you can convert an `i8` to an `i64` | @@ -508,7 +600,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:127:17 | LL | x_i64 > x_i16; - | ^^^^^ expected `i64`, found `i16` + | ----- ^^^^^ expected `i64`, found `i16` + | | + | expected because this is `i64` | help: you can convert an `i16` to an `i64` | @@ -519,7 +613,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:129:17 | LL | x_i64 > x_i32; - | ^^^^^ expected `i64`, found `i32` + | ----- ^^^^^ expected `i64`, found `i32` + | | + | expected because this is `i64` | help: you can convert an `i32` to an `i64` | @@ -530,7 +626,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:131:17 | LL | x_i64 > x_i128; - | ^^^^^^ expected `i64`, found `i128` + | ----- ^^^^^^ expected `i64`, found `i128` + | | + | expected because this is `i64` | help: you can convert `x_i64` from `i64` to `i128`, matching the type of `x_i128` | @@ -541,7 +639,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:133:17 | LL | x_i64 > x_isize; - | ^^^^^^^ expected `i64`, found `isize` + | ----- ^^^^^^^ expected `i64`, found `isize` + | | + | expected because this is `i64` | help: you can convert an `isize` to an `i64` and panic if the converted value doesn't fit | @@ -552,7 +652,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:136:18 | LL | x_i128 > x_i8; - | ^^^^ expected `i128`, found `i8` + | ------ ^^^^ expected `i128`, found `i8` + | | + | expected because this is `i128` | help: you can convert an `i8` to an `i128` | @@ -563,7 +665,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:138:18 | LL | x_i128 > x_i16; - | ^^^^^ expected `i128`, found `i16` + | ------ ^^^^^ expected `i128`, found `i16` + | | + | expected because this is `i128` | help: you can convert an `i16` to an `i128` | @@ -574,7 +678,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:140:18 | LL | x_i128 > x_i32; - | ^^^^^ expected `i128`, found `i32` + | ------ ^^^^^ expected `i128`, found `i32` + | | + | expected because this is `i128` | help: you can convert an `i32` to an `i128` | @@ -585,7 +691,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:142:18 | LL | x_i128 > x_i64; - | ^^^^^ expected `i128`, found `i64` + | ------ ^^^^^ expected `i128`, found `i64` + | | + | expected because this is `i128` | help: you can convert an `i64` to an `i128` | @@ -596,7 +704,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:144:18 | LL | x_i128 > x_isize; - | ^^^^^^^ expected `i128`, found `isize` + | ------ ^^^^^^^ expected `i128`, found `isize` + | | + | expected because this is `i128` | help: you can convert an `isize` to an `i128` and panic if the converted value doesn't fit | @@ -607,7 +717,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:147:19 | LL | x_isize > x_i8; - | ^^^^ expected `isize`, found `i8` + | ------- ^^^^ expected `isize`, found `i8` + | | + | expected because this is `isize` | help: you can convert an `i8` to an `isize` | @@ -618,7 +730,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:149:19 | LL | x_isize > x_i16; - | ^^^^^ expected `isize`, found `i16` + | ------- ^^^^^ expected `isize`, found `i16` + | | + | expected because this is `isize` | help: you can convert an `i16` to an `isize` | @@ -629,7 +743,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:151:19 | LL | x_isize > x_i32; - | ^^^^^ expected `isize`, found `i32` + | ------- ^^^^^ expected `isize`, found `i32` + | | + | expected because this is `isize` | help: you can convert an `i32` to an `isize` and panic if the converted value doesn't fit | @@ -640,7 +756,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:153:19 | LL | x_isize > x_i64; - | ^^^^^ expected `isize`, found `i64` + | ------- ^^^^^ expected `isize`, found `i64` + | | + | expected because this is `isize` | help: you can convert an `i64` to an `isize` and panic if the converted value doesn't fit | @@ -651,7 +769,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:155:19 | LL | x_isize > x_i128; - | ^^^^^^ expected `isize`, found `i128` + | ------- ^^^^^^ expected `isize`, found `i128` + | | + | expected because this is `isize` | help: you can convert an `i128` to an `isize` and panic if the converted value doesn't fit | @@ -662,7 +782,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:161:16 | LL | x_u8 > x_i8; - | ^^^^ expected `u8`, found `i8` + | ---- ^^^^ expected `u8`, found `i8` + | | + | expected because this is `u8` | help: you can convert an `i8` to a `u8` and panic if the converted value doesn't fit | @@ -673,7 +795,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:163:16 | LL | x_u8 > x_i16; - | ^^^^^ expected `u8`, found `i16` + | ---- ^^^^^ expected `u8`, found `i16` + | | + | expected because this is `u8` | help: you can convert `x_u8` from `u8` to `i16`, matching the type of `x_i16` | @@ -684,7 +808,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:165:16 | LL | x_u8 > x_i32; - | ^^^^^ expected `u8`, found `i32` + | ---- ^^^^^ expected `u8`, found `i32` + | | + | expected because this is `u8` | help: you can convert `x_u8` from `u8` to `i32`, matching the type of `x_i32` | @@ -695,7 +821,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:167:16 | LL | x_u8 > x_i64; - | ^^^^^ expected `u8`, found `i64` + | ---- ^^^^^ expected `u8`, found `i64` + | | + | expected because this is `u8` | help: you can convert `x_u8` from `u8` to `i64`, matching the type of `x_i64` | @@ -706,7 +834,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:169:16 | LL | x_u8 > x_i128; - | ^^^^^^ expected `u8`, found `i128` + | ---- ^^^^^^ expected `u8`, found `i128` + | | + | expected because this is `u8` | help: you can convert `x_u8` from `u8` to `i128`, matching the type of `x_i128` | @@ -717,7 +847,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:171:16 | LL | x_u8 > x_isize; - | ^^^^^^^ expected `u8`, found `isize` + | ---- ^^^^^^^ expected `u8`, found `isize` + | | + | expected because this is `u8` | help: you can convert `x_u8` from `u8` to `isize`, matching the type of `x_isize` | @@ -728,7 +860,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:174:17 | LL | x_u16 > x_i8; - | ^^^^ expected `u16`, found `i8` + | ----- ^^^^ expected `u16`, found `i8` + | | + | expected because this is `u16` | help: you can convert an `i8` to a `u16` and panic if the converted value doesn't fit | @@ -739,7 +873,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:176:17 | LL | x_u16 > x_i16; - | ^^^^^ expected `u16`, found `i16` + | ----- ^^^^^ expected `u16`, found `i16` + | | + | expected because this is `u16` | help: you can convert an `i16` to a `u16` and panic if the converted value doesn't fit | @@ -750,7 +886,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:178:17 | LL | x_u16 > x_i32; - | ^^^^^ expected `u16`, found `i32` + | ----- ^^^^^ expected `u16`, found `i32` + | | + | expected because this is `u16` | help: you can convert `x_u16` from `u16` to `i32`, matching the type of `x_i32` | @@ -761,7 +899,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:180:17 | LL | x_u16 > x_i64; - | ^^^^^ expected `u16`, found `i64` + | ----- ^^^^^ expected `u16`, found `i64` + | | + | expected because this is `u16` | help: you can convert `x_u16` from `u16` to `i64`, matching the type of `x_i64` | @@ -772,7 +912,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:182:17 | LL | x_u16 > x_i128; - | ^^^^^^ expected `u16`, found `i128` + | ----- ^^^^^^ expected `u16`, found `i128` + | | + | expected because this is `u16` | help: you can convert `x_u16` from `u16` to `i128`, matching the type of `x_i128` | @@ -783,7 +925,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:184:17 | LL | x_u16 > x_isize; - | ^^^^^^^ expected `u16`, found `isize` + | ----- ^^^^^^^ expected `u16`, found `isize` + | | + | expected because this is `u16` | help: you can convert an `isize` to a `u16` and panic if the converted value doesn't fit | @@ -794,7 +938,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:187:17 | LL | x_u32 > x_i8; - | ^^^^ expected `u32`, found `i8` + | ----- ^^^^ expected `u32`, found `i8` + | | + | expected because this is `u32` | help: you can convert an `i8` to a `u32` and panic if the converted value doesn't fit | @@ -805,7 +951,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:189:17 | LL | x_u32 > x_i16; - | ^^^^^ expected `u32`, found `i16` + | ----- ^^^^^ expected `u32`, found `i16` + | | + | expected because this is `u32` | help: you can convert an `i16` to a `u32` and panic if the converted value doesn't fit | @@ -816,7 +964,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:191:17 | LL | x_u32 > x_i32; - | ^^^^^ expected `u32`, found `i32` + | ----- ^^^^^ expected `u32`, found `i32` + | | + | expected because this is `u32` | help: you can convert an `i32` to a `u32` and panic if the converted value doesn't fit | @@ -827,7 +977,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:193:17 | LL | x_u32 > x_i64; - | ^^^^^ expected `u32`, found `i64` + | ----- ^^^^^ expected `u32`, found `i64` + | | + | expected because this is `u32` | help: you can convert `x_u32` from `u32` to `i64`, matching the type of `x_i64` | @@ -838,7 +990,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:195:17 | LL | x_u32 > x_i128; - | ^^^^^^ expected `u32`, found `i128` + | ----- ^^^^^^ expected `u32`, found `i128` + | | + | expected because this is `u32` | help: you can convert `x_u32` from `u32` to `i128`, matching the type of `x_i128` | @@ -849,7 +1003,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:197:17 | LL | x_u32 > x_isize; - | ^^^^^^^ expected `u32`, found `isize` + | ----- ^^^^^^^ expected `u32`, found `isize` + | | + | expected because this is `u32` | help: you can convert an `isize` to a `u32` and panic if the converted value doesn't fit | @@ -860,7 +1016,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:200:17 | LL | x_u64 > x_i8; - | ^^^^ expected `u64`, found `i8` + | ----- ^^^^ expected `u64`, found `i8` + | | + | expected because this is `u64` | help: you can convert an `i8` to a `u64` and panic if the converted value doesn't fit | @@ -871,7 +1029,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:202:17 | LL | x_u64 > x_i16; - | ^^^^^ expected `u64`, found `i16` + | ----- ^^^^^ expected `u64`, found `i16` + | | + | expected because this is `u64` | help: you can convert an `i16` to a `u64` and panic if the converted value doesn't fit | @@ -882,7 +1042,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:204:17 | LL | x_u64 > x_i32; - | ^^^^^ expected `u64`, found `i32` + | ----- ^^^^^ expected `u64`, found `i32` + | | + | expected because this is `u64` | help: you can convert an `i32` to a `u64` and panic if the converted value doesn't fit | @@ -893,7 +1055,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:206:17 | LL | x_u64 > x_i64; - | ^^^^^ expected `u64`, found `i64` + | ----- ^^^^^ expected `u64`, found `i64` + | | + | expected because this is `u64` | help: you can convert an `i64` to a `u64` and panic if the converted value doesn't fit | @@ -904,7 +1068,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:208:17 | LL | x_u64 > x_i128; - | ^^^^^^ expected `u64`, found `i128` + | ----- ^^^^^^ expected `u64`, found `i128` + | | + | expected because this is `u64` | help: you can convert `x_u64` from `u64` to `i128`, matching the type of `x_i128` | @@ -915,7 +1081,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:210:17 | LL | x_u64 > x_isize; - | ^^^^^^^ expected `u64`, found `isize` + | ----- ^^^^^^^ expected `u64`, found `isize` + | | + | expected because this is `u64` | help: you can convert an `isize` to a `u64` and panic if the converted value doesn't fit | @@ -926,7 +1094,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:213:18 | LL | x_u128 > x_i8; - | ^^^^ expected `u128`, found `i8` + | ------ ^^^^ expected `u128`, found `i8` + | | + | expected because this is `u128` | help: you can convert an `i8` to a `u128` and panic if the converted value doesn't fit | @@ -937,7 +1107,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:215:18 | LL | x_u128 > x_i16; - | ^^^^^ expected `u128`, found `i16` + | ------ ^^^^^ expected `u128`, found `i16` + | | + | expected because this is `u128` | help: you can convert an `i16` to a `u128` and panic if the converted value doesn't fit | @@ -948,7 +1120,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:217:18 | LL | x_u128 > x_i32; - | ^^^^^ expected `u128`, found `i32` + | ------ ^^^^^ expected `u128`, found `i32` + | | + | expected because this is `u128` | help: you can convert an `i32` to a `u128` and panic if the converted value doesn't fit | @@ -959,7 +1133,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:219:18 | LL | x_u128 > x_i64; - | ^^^^^ expected `u128`, found `i64` + | ------ ^^^^^ expected `u128`, found `i64` + | | + | expected because this is `u128` | help: you can convert an `i64` to a `u128` and panic if the converted value doesn't fit | @@ -970,7 +1146,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:221:18 | LL | x_u128 > x_i128; - | ^^^^^^ expected `u128`, found `i128` + | ------ ^^^^^^ expected `u128`, found `i128` + | | + | expected because this is `u128` | help: you can convert an `i128` to a `u128` and panic if the converted value doesn't fit | @@ -981,7 +1159,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:223:18 | LL | x_u128 > x_isize; - | ^^^^^^^ expected `u128`, found `isize` + | ------ ^^^^^^^ expected `u128`, found `isize` + | | + | expected because this is `u128` | help: you can convert an `isize` to a `u128` and panic if the converted value doesn't fit | @@ -992,7 +1172,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:226:19 | LL | x_usize > x_i8; - | ^^^^ expected `usize`, found `i8` + | ------- ^^^^ expected `usize`, found `i8` + | | + | expected because this is `usize` | help: you can convert an `i8` to a `usize` and panic if the converted value doesn't fit | @@ -1003,7 +1185,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:228:19 | LL | x_usize > x_i16; - | ^^^^^ expected `usize`, found `i16` + | ------- ^^^^^ expected `usize`, found `i16` + | | + | expected because this is `usize` | help: you can convert an `i16` to a `usize` and panic if the converted value doesn't fit | @@ -1014,7 +1198,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:230:19 | LL | x_usize > x_i32; - | ^^^^^ expected `usize`, found `i32` + | ------- ^^^^^ expected `usize`, found `i32` + | | + | expected because this is `usize` | help: you can convert an `i32` to a `usize` and panic if the converted value doesn't fit | @@ -1025,7 +1211,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:232:19 | LL | x_usize > x_i64; - | ^^^^^ expected `usize`, found `i64` + | ------- ^^^^^ expected `usize`, found `i64` + | | + | expected because this is `usize` | help: you can convert an `i64` to a `usize` and panic if the converted value doesn't fit | @@ -1036,7 +1224,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:234:19 | LL | x_usize > x_i128; - | ^^^^^^ expected `usize`, found `i128` + | ------- ^^^^^^ expected `usize`, found `i128` + | | + | expected because this is `usize` | help: you can convert an `i128` to a `usize` and panic if the converted value doesn't fit | @@ -1047,7 +1237,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:236:19 | LL | x_usize > x_isize; - | ^^^^^^^ expected `usize`, found `isize` + | ------- ^^^^^^^ expected `usize`, found `isize` + | | + | expected because this is `usize` | help: you can convert an `isize` to a `usize` and panic if the converted value doesn't fit | @@ -1058,7 +1250,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:242:16 | LL | x_i8 > x_u8; - | ^^^^ expected `i8`, found `u8` + | ---- ^^^^ expected `i8`, found `u8` + | | + | expected because this is `i8` | help: you can convert a `u8` to an `i8` and panic if the converted value doesn't fit | @@ -1069,7 +1263,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:244:16 | LL | x_i8 > x_u16; - | ^^^^^ expected `i8`, found `u16` + | ---- ^^^^^ expected `i8`, found `u16` + | | + | expected because this is `i8` | help: you can convert a `u16` to an `i8` and panic if the converted value doesn't fit | @@ -1080,7 +1276,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:246:16 | LL | x_i8 > x_u32; - | ^^^^^ expected `i8`, found `u32` + | ---- ^^^^^ expected `i8`, found `u32` + | | + | expected because this is `i8` | help: you can convert a `u32` to an `i8` and panic if the converted value doesn't fit | @@ -1091,7 +1289,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:248:16 | LL | x_i8 > x_u64; - | ^^^^^ expected `i8`, found `u64` + | ---- ^^^^^ expected `i8`, found `u64` + | | + | expected because this is `i8` | help: you can convert a `u64` to an `i8` and panic if the converted value doesn't fit | @@ -1102,7 +1302,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:250:16 | LL | x_i8 > x_u128; - | ^^^^^^ expected `i8`, found `u128` + | ---- ^^^^^^ expected `i8`, found `u128` + | | + | expected because this is `i8` | help: you can convert a `u128` to an `i8` and panic if the converted value doesn't fit | @@ -1113,7 +1315,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:252:16 | LL | x_i8 > x_usize; - | ^^^^^^^ expected `i8`, found `usize` + | ---- ^^^^^^^ expected `i8`, found `usize` + | | + | expected because this is `i8` | help: you can convert a `usize` to an `i8` and panic if the converted value doesn't fit | @@ -1124,7 +1328,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:255:17 | LL | x_i16 > x_u8; - | ^^^^ expected `i16`, found `u8` + | ----- ^^^^ expected `i16`, found `u8` + | | + | expected because this is `i16` | help: you can convert a `u8` to an `i16` | @@ -1135,7 +1341,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:257:17 | LL | x_i16 > x_u16; - | ^^^^^ expected `i16`, found `u16` + | ----- ^^^^^ expected `i16`, found `u16` + | | + | expected because this is `i16` | help: you can convert a `u16` to an `i16` and panic if the converted value doesn't fit | @@ -1146,7 +1354,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:259:17 | LL | x_i16 > x_u32; - | ^^^^^ expected `i16`, found `u32` + | ----- ^^^^^ expected `i16`, found `u32` + | | + | expected because this is `i16` | help: you can convert a `u32` to an `i16` and panic if the converted value doesn't fit | @@ -1157,7 +1367,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:261:17 | LL | x_i16 > x_u64; - | ^^^^^ expected `i16`, found `u64` + | ----- ^^^^^ expected `i16`, found `u64` + | | + | expected because this is `i16` | help: you can convert a `u64` to an `i16` and panic if the converted value doesn't fit | @@ -1168,7 +1380,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:263:17 | LL | x_i16 > x_u128; - | ^^^^^^ expected `i16`, found `u128` + | ----- ^^^^^^ expected `i16`, found `u128` + | | + | expected because this is `i16` | help: you can convert a `u128` to an `i16` and panic if the converted value doesn't fit | @@ -1179,7 +1393,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:265:17 | LL | x_i16 > x_usize; - | ^^^^^^^ expected `i16`, found `usize` + | ----- ^^^^^^^ expected `i16`, found `usize` + | | + | expected because this is `i16` | help: you can convert a `usize` to an `i16` and panic if the converted value doesn't fit | @@ -1190,7 +1406,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:268:17 | LL | x_i32 > x_u8; - | ^^^^ expected `i32`, found `u8` + | ----- ^^^^ expected `i32`, found `u8` + | | + | expected because this is `i32` | help: you can convert a `u8` to an `i32` | @@ -1201,7 +1419,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:270:17 | LL | x_i32 > x_u16; - | ^^^^^ expected `i32`, found `u16` + | ----- ^^^^^ expected `i32`, found `u16` + | | + | expected because this is `i32` | help: you can convert a `u16` to an `i32` | @@ -1212,7 +1432,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:272:17 | LL | x_i32 > x_u32; - | ^^^^^ expected `i32`, found `u32` + | ----- ^^^^^ expected `i32`, found `u32` + | | + | expected because this is `i32` | help: you can convert a `u32` to an `i32` and panic if the converted value doesn't fit | @@ -1223,7 +1445,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:274:17 | LL | x_i32 > x_u64; - | ^^^^^ expected `i32`, found `u64` + | ----- ^^^^^ expected `i32`, found `u64` + | | + | expected because this is `i32` | help: you can convert a `u64` to an `i32` and panic if the converted value doesn't fit | @@ -1234,7 +1458,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:276:17 | LL | x_i32 > x_u128; - | ^^^^^^ expected `i32`, found `u128` + | ----- ^^^^^^ expected `i32`, found `u128` + | | + | expected because this is `i32` | help: you can convert a `u128` to an `i32` and panic if the converted value doesn't fit | @@ -1245,7 +1471,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:278:17 | LL | x_i32 > x_usize; - | ^^^^^^^ expected `i32`, found `usize` + | ----- ^^^^^^^ expected `i32`, found `usize` + | | + | expected because this is `i32` | help: you can convert a `usize` to an `i32` and panic if the converted value doesn't fit | @@ -1256,7 +1484,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:281:17 | LL | x_i64 > x_u8; - | ^^^^ expected `i64`, found `u8` + | ----- ^^^^ expected `i64`, found `u8` + | | + | expected because this is `i64` | help: you can convert a `u8` to an `i64` | @@ -1267,7 +1497,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:283:17 | LL | x_i64 > x_u16; - | ^^^^^ expected `i64`, found `u16` + | ----- ^^^^^ expected `i64`, found `u16` + | | + | expected because this is `i64` | help: you can convert a `u16` to an `i64` | @@ -1278,7 +1510,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:285:17 | LL | x_i64 > x_u32; - | ^^^^^ expected `i64`, found `u32` + | ----- ^^^^^ expected `i64`, found `u32` + | | + | expected because this is `i64` | help: you can convert a `u32` to an `i64` | @@ -1289,7 +1523,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:287:17 | LL | x_i64 > x_u64; - | ^^^^^ expected `i64`, found `u64` + | ----- ^^^^^ expected `i64`, found `u64` + | | + | expected because this is `i64` | help: you can convert a `u64` to an `i64` and panic if the converted value doesn't fit | @@ -1300,7 +1536,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:289:17 | LL | x_i64 > x_u128; - | ^^^^^^ expected `i64`, found `u128` + | ----- ^^^^^^ expected `i64`, found `u128` + | | + | expected because this is `i64` | help: you can convert a `u128` to an `i64` and panic if the converted value doesn't fit | @@ -1311,7 +1549,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:291:17 | LL | x_i64 > x_usize; - | ^^^^^^^ expected `i64`, found `usize` + | ----- ^^^^^^^ expected `i64`, found `usize` + | | + | expected because this is `i64` | help: you can convert a `usize` to an `i64` and panic if the converted value doesn't fit | @@ -1322,7 +1562,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:294:18 | LL | x_i128 > x_u8; - | ^^^^ expected `i128`, found `u8` + | ------ ^^^^ expected `i128`, found `u8` + | | + | expected because this is `i128` | help: you can convert a `u8` to an `i128` | @@ -1333,7 +1575,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:296:18 | LL | x_i128 > x_u16; - | ^^^^^ expected `i128`, found `u16` + | ------ ^^^^^ expected `i128`, found `u16` + | | + | expected because this is `i128` | help: you can convert a `u16` to an `i128` | @@ -1344,7 +1588,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:298:18 | LL | x_i128 > x_u32; - | ^^^^^ expected `i128`, found `u32` + | ------ ^^^^^ expected `i128`, found `u32` + | | + | expected because this is `i128` | help: you can convert a `u32` to an `i128` | @@ -1355,7 +1601,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:300:18 | LL | x_i128 > x_u64; - | ^^^^^ expected `i128`, found `u64` + | ------ ^^^^^ expected `i128`, found `u64` + | | + | expected because this is `i128` | help: you can convert a `u64` to an `i128` | @@ -1366,7 +1614,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:302:18 | LL | x_i128 > x_u128; - | ^^^^^^ expected `i128`, found `u128` + | ------ ^^^^^^ expected `i128`, found `u128` + | | + | expected because this is `i128` | help: you can convert a `u128` to an `i128` and panic if the converted value doesn't fit | @@ -1377,7 +1627,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:304:18 | LL | x_i128 > x_usize; - | ^^^^^^^ expected `i128`, found `usize` + | ------ ^^^^^^^ expected `i128`, found `usize` + | | + | expected because this is `i128` | help: you can convert a `usize` to an `i128` and panic if the converted value doesn't fit | @@ -1388,7 +1640,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:307:19 | LL | x_isize > x_u8; - | ^^^^ expected `isize`, found `u8` + | ------- ^^^^ expected `isize`, found `u8` + | | + | expected because this is `isize` | help: you can convert a `u8` to an `isize` | @@ -1399,7 +1653,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:309:19 | LL | x_isize > x_u16; - | ^^^^^ expected `isize`, found `u16` + | ------- ^^^^^ expected `isize`, found `u16` + | | + | expected because this is `isize` | help: you can convert a `u16` to an `isize` and panic if the converted value doesn't fit | @@ -1410,7 +1666,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:311:19 | LL | x_isize > x_u32; - | ^^^^^ expected `isize`, found `u32` + | ------- ^^^^^ expected `isize`, found `u32` + | | + | expected because this is `isize` | help: you can convert a `u32` to an `isize` and panic if the converted value doesn't fit | @@ -1421,7 +1679,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:313:19 | LL | x_isize > x_u64; - | ^^^^^ expected `isize`, found `u64` + | ------- ^^^^^ expected `isize`, found `u64` + | | + | expected because this is `isize` | help: you can convert a `u64` to an `isize` and panic if the converted value doesn't fit | @@ -1432,7 +1692,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:315:19 | LL | x_isize > x_u128; - | ^^^^^^ expected `isize`, found `u128` + | ------- ^^^^^^ expected `isize`, found `u128` + | | + | expected because this is `isize` | help: you can convert a `u128` to an `isize` and panic if the converted value doesn't fit | @@ -1443,7 +1705,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-binop.rs:317:19 | LL | x_isize > x_usize; - | ^^^^^^^ expected `isize`, found `usize` + | ------- ^^^^^^^ expected `isize`, found `usize` + | | + | expected because this is `isize` | help: you can convert a `usize` to an `isize` and panic if the converted value doesn't fit | diff --git a/src/test/ui/numeric/numeric-cast-no-fix.stderr b/src/test/ui/numeric/numeric-cast-no-fix.stderr index e4843206de1dd..c244e479d24c6 100644 --- a/src/test/ui/numeric/numeric-cast-no-fix.stderr +++ b/src/test/ui/numeric/numeric-cast-no-fix.stderr @@ -2,7 +2,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:10:15 | LL | x_usize > -1_isize; - | ^^^^^^^^ expected `usize`, found `isize` + | ------- ^^^^^^^^ expected `usize`, found `isize` + | | + | expected because this is `usize` | = note: `-1_isize` cannot fit into type `usize` @@ -10,7 +12,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:12:14 | LL | x_u128 > -1_isize; - | ^^^^^^^^ expected `u128`, found `isize` + | ------ ^^^^^^^^ expected `u128`, found `isize` + | | + | expected because this is `u128` | = note: `-1_isize` cannot fit into type `u128` @@ -18,7 +22,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:14:13 | LL | x_u64 > -1_isize; - | ^^^^^^^^ expected `u64`, found `isize` + | ----- ^^^^^^^^ expected `u64`, found `isize` + | | + | expected because this is `u64` | = note: `-1_isize` cannot fit into type `u64` @@ -26,7 +32,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:16:13 | LL | x_u32 > -1_isize; - | ^^^^^^^^ expected `u32`, found `isize` + | ----- ^^^^^^^^ expected `u32`, found `isize` + | | + | expected because this is `u32` | = note: `-1_isize` cannot fit into type `u32` @@ -34,7 +42,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:18:13 | LL | x_u16 > -1_isize; - | ^^^^^^^^ expected `u16`, found `isize` + | ----- ^^^^^^^^ expected `u16`, found `isize` + | | + | expected because this is `u16` | = note: `-1_isize` cannot fit into type `u16` @@ -42,7 +52,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:20:12 | LL | x_u8 > -1_isize; - | ^^^^^^^^ expected `u8`, found `isize` + | ---- ^^^^^^^^ expected `u8`, found `isize` + | | + | expected because this is `u8` | help: you can convert `x_u8` from `u8` to `isize`, matching the type of `-1_isize` | @@ -53,7 +65,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:23:15 | LL | x_usize > -1_i128; - | ^^^^^^^ expected `usize`, found `i128` + | ------- ^^^^^^^ expected `usize`, found `i128` + | | + | expected because this is `usize` | = note: `-1_i128` cannot fit into type `usize` @@ -61,7 +75,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:25:14 | LL | x_u128 > -1_i128; - | ^^^^^^^ expected `u128`, found `i128` + | ------ ^^^^^^^ expected `u128`, found `i128` + | | + | expected because this is `u128` | = note: `-1_i128` cannot fit into type `u128` @@ -69,7 +85,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:27:13 | LL | x_u64 > -1_i128; - | ^^^^^^^ expected `u64`, found `i128` + | ----- ^^^^^^^ expected `u64`, found `i128` + | | + | expected because this is `u64` | help: you can convert `x_u64` from `u64` to `i128`, matching the type of `-1_i128` | @@ -80,7 +98,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:29:13 | LL | x_u32 > -1_i128; - | ^^^^^^^ expected `u32`, found `i128` + | ----- ^^^^^^^ expected `u32`, found `i128` + | | + | expected because this is `u32` | help: you can convert `x_u32` from `u32` to `i128`, matching the type of `-1_i128` | @@ -91,7 +111,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:31:13 | LL | x_u16 > -1_i128; - | ^^^^^^^ expected `u16`, found `i128` + | ----- ^^^^^^^ expected `u16`, found `i128` + | | + | expected because this is `u16` | help: you can convert `x_u16` from `u16` to `i128`, matching the type of `-1_i128` | @@ -102,7 +124,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:33:12 | LL | x_u8 > -1_i128; - | ^^^^^^^ expected `u8`, found `i128` + | ---- ^^^^^^^ expected `u8`, found `i128` + | | + | expected because this is `u8` | help: you can convert `x_u8` from `u8` to `i128`, matching the type of `-1_i128` | @@ -113,7 +137,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:36:15 | LL | x_usize > -1_i64; - | ^^^^^^ expected `usize`, found `i64` + | ------- ^^^^^^ expected `usize`, found `i64` + | | + | expected because this is `usize` | = note: `-1_i64` cannot fit into type `usize` @@ -121,7 +147,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:38:14 | LL | x_u128 > -1_i64; - | ^^^^^^ expected `u128`, found `i64` + | ------ ^^^^^^ expected `u128`, found `i64` + | | + | expected because this is `u128` | = note: `-1_i64` cannot fit into type `u128` @@ -129,7 +157,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:40:13 | LL | x_u64 > -1_i64; - | ^^^^^^ expected `u64`, found `i64` + | ----- ^^^^^^ expected `u64`, found `i64` + | | + | expected because this is `u64` | = note: `-1_i64` cannot fit into type `u64` @@ -137,7 +167,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:42:13 | LL | x_u32 > -1_i64; - | ^^^^^^ expected `u32`, found `i64` + | ----- ^^^^^^ expected `u32`, found `i64` + | | + | expected because this is `u32` | help: you can convert `x_u32` from `u32` to `i64`, matching the type of `-1_i64` | @@ -148,7 +180,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:44:13 | LL | x_u16 > -1_i64; - | ^^^^^^ expected `u16`, found `i64` + | ----- ^^^^^^ expected `u16`, found `i64` + | | + | expected because this is `u16` | help: you can convert `x_u16` from `u16` to `i64`, matching the type of `-1_i64` | @@ -159,7 +193,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:46:12 | LL | x_u8 > -1_i64; - | ^^^^^^ expected `u8`, found `i64` + | ---- ^^^^^^ expected `u8`, found `i64` + | | + | expected because this is `u8` | help: you can convert `x_u8` from `u8` to `i64`, matching the type of `-1_i64` | @@ -170,7 +206,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:49:15 | LL | x_usize > -1_i32; - | ^^^^^^ expected `usize`, found `i32` + | ------- ^^^^^^ expected `usize`, found `i32` + | | + | expected because this is `usize` | = note: `-1_i32` cannot fit into type `usize` @@ -178,7 +216,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:51:14 | LL | x_u128 > -1_i32; - | ^^^^^^ expected `u128`, found `i32` + | ------ ^^^^^^ expected `u128`, found `i32` + | | + | expected because this is `u128` | = note: `-1_i32` cannot fit into type `u128` @@ -186,7 +226,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:53:13 | LL | x_u64 > -1_i32; - | ^^^^^^ expected `u64`, found `i32` + | ----- ^^^^^^ expected `u64`, found `i32` + | | + | expected because this is `u64` | = note: `-1_i32` cannot fit into type `u64` @@ -194,7 +236,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:55:13 | LL | x_u32 > -1_i32; - | ^^^^^^ expected `u32`, found `i32` + | ----- ^^^^^^ expected `u32`, found `i32` + | | + | expected because this is `u32` | = note: `-1_i32` cannot fit into type `u32` @@ -202,7 +246,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:57:13 | LL | x_u16 > -1_i32; - | ^^^^^^ expected `u16`, found `i32` + | ----- ^^^^^^ expected `u16`, found `i32` + | | + | expected because this is `u16` | help: you can convert `x_u16` from `u16` to `i32`, matching the type of `-1_i32` | @@ -213,7 +259,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:59:12 | LL | x_u8 > -1_i32; - | ^^^^^^ expected `u8`, found `i32` + | ---- ^^^^^^ expected `u8`, found `i32` + | | + | expected because this is `u8` | help: you can convert `x_u8` from `u8` to `i32`, matching the type of `-1_i32` | @@ -224,7 +272,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:62:15 | LL | x_usize > -1_i16; - | ^^^^^^ expected `usize`, found `i16` + | ------- ^^^^^^ expected `usize`, found `i16` + | | + | expected because this is `usize` | = note: `-1_i16` cannot fit into type `usize` @@ -232,7 +282,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:64:14 | LL | x_u128 > -1_i16; - | ^^^^^^ expected `u128`, found `i16` + | ------ ^^^^^^ expected `u128`, found `i16` + | | + | expected because this is `u128` | = note: `-1_i16` cannot fit into type `u128` @@ -240,7 +292,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:66:13 | LL | x_u64 > -1_i16; - | ^^^^^^ expected `u64`, found `i16` + | ----- ^^^^^^ expected `u64`, found `i16` + | | + | expected because this is `u64` | = note: `-1_i16` cannot fit into type `u64` @@ -248,7 +302,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:68:13 | LL | x_u32 > -1_i16; - | ^^^^^^ expected `u32`, found `i16` + | ----- ^^^^^^ expected `u32`, found `i16` + | | + | expected because this is `u32` | = note: `-1_i16` cannot fit into type `u32` @@ -256,7 +312,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:70:13 | LL | x_u16 > -1_i16; - | ^^^^^^ expected `u16`, found `i16` + | ----- ^^^^^^ expected `u16`, found `i16` + | | + | expected because this is `u16` | = note: `-1_i16` cannot fit into type `u16` @@ -264,7 +322,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:72:12 | LL | x_u8 > -1_i16; - | ^^^^^^ expected `u8`, found `i16` + | ---- ^^^^^^ expected `u8`, found `i16` + | | + | expected because this is `u8` | help: you can convert `x_u8` from `u8` to `i16`, matching the type of `-1_i16` | @@ -275,7 +335,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:75:15 | LL | x_usize > -1_i8; - | ^^^^^ expected `usize`, found `i8` + | ------- ^^^^^ expected `usize`, found `i8` + | | + | expected because this is `usize` | = note: `-1_i8` cannot fit into type `usize` @@ -283,7 +345,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:77:14 | LL | x_u128 > -1_i8; - | ^^^^^ expected `u128`, found `i8` + | ------ ^^^^^ expected `u128`, found `i8` + | | + | expected because this is `u128` | = note: `-1_i8` cannot fit into type `u128` @@ -291,7 +355,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:79:13 | LL | x_u64 > -1_i8; - | ^^^^^ expected `u64`, found `i8` + | ----- ^^^^^ expected `u64`, found `i8` + | | + | expected because this is `u64` | = note: `-1_i8` cannot fit into type `u64` @@ -299,7 +365,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:81:13 | LL | x_u32 > -1_i8; - | ^^^^^ expected `u32`, found `i8` + | ----- ^^^^^ expected `u32`, found `i8` + | | + | expected because this is `u32` | = note: `-1_i8` cannot fit into type `u32` @@ -307,7 +375,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:83:13 | LL | x_u16 > -1_i8; - | ^^^^^ expected `u16`, found `i8` + | ----- ^^^^^ expected `u16`, found `i8` + | | + | expected because this is `u16` | = note: `-1_i8` cannot fit into type `u16` @@ -315,7 +385,9 @@ error[E0308]: mismatched types --> $DIR/numeric-cast-no-fix.rs:85:12 | LL | x_u8 > -1_i8; - | ^^^^^ expected `u8`, found `i8` + | ---- ^^^^^ expected `u8`, found `i8` + | | + | expected because this is `u8` | = note: `-1_i8` cannot fit into type `u8` diff --git a/src/test/ui/parser/bare-struct-body.stderr b/src/test/ui/parser/bare-struct-body.stderr index c77992b2c3406..7d17ea59647ec 100644 --- a/src/test/ui/parser/bare-struct-body.stderr +++ b/src/test/ui/parser/bare-struct-body.stderr @@ -34,7 +34,9 @@ error[E0308]: mismatched types --> $DIR/bare-struct-body.rs:11:14 | LL | x.val == 42; - | ^^ expected `()`, found integer + | ----- ^^ expected `()`, found integer + | | + | expected because this is `()` error: aborting due to 3 previous errors diff --git a/src/test/ui/parser/chained-comparison-suggestion.stderr b/src/test/ui/parser/chained-comparison-suggestion.stderr index 694b0b6eb028f..ae243816d7c2d 100644 --- a/src/test/ui/parser/chained-comparison-suggestion.stderr +++ b/src/test/ui/parser/chained-comparison-suggestion.stderr @@ -123,37 +123,49 @@ error[E0308]: mismatched types --> $DIR/chained-comparison-suggestion.rs:4:14 | LL | 1 < 2 <= 3; - | ^ expected `bool`, found integer + | ----- ^ expected `bool`, found integer + | | + | expected because this is `bool` error[E0308]: mismatched types --> $DIR/chained-comparison-suggestion.rs:13:14 | LL | 1 <= 2 < 3; - | ^ expected `bool`, found integer + | ------ ^ expected `bool`, found integer + | | + | expected because this is `bool` error[E0308]: mismatched types --> $DIR/chained-comparison-suggestion.rs:18:15 | LL | 1 <= 2 <= 3; - | ^ expected `bool`, found integer + | ------ ^ expected `bool`, found integer + | | + | expected because this is `bool` error[E0308]: mismatched types --> $DIR/chained-comparison-suggestion.rs:23:14 | LL | 1 > 2 >= 3; - | ^ expected `bool`, found integer + | ----- ^ expected `bool`, found integer + | | + | expected because this is `bool` error[E0308]: mismatched types --> $DIR/chained-comparison-suggestion.rs:36:15 | LL | 1 >= 2 >= 3; - | ^ expected `bool`, found integer + | ------ ^ expected `bool`, found integer + | | + | expected because this is `bool` error[E0308]: mismatched types --> $DIR/chained-comparison-suggestion.rs:49:15 | LL | 1 == 2 == 3; - | ^ expected `bool`, found integer + | ------ ^ expected `bool`, found integer + | | + | expected because this is `bool` error: aborting due to 17 previous errors diff --git a/src/test/ui/pptypedef.stderr b/src/test/ui/pptypedef.stderr index 49895f3db4dff..08b90b365e326 100644 --- a/src/test/ui/pptypedef.stderr +++ b/src/test/ui/pptypedef.stderr @@ -2,7 +2,9 @@ error[E0308]: mismatched types --> $DIR/pptypedef.rs:4:37 | LL | let_in(3u32, |i| { assert!(i == 3i32); }); - | ^^^^ expected `u32`, found `i32` + | - ^^^^ expected `u32`, found `i32` + | | + | expected because this is `u32` | help: change the type of the numeric literal from `i32` to `u32` | @@ -13,7 +15,9 @@ error[E0308]: mismatched types --> $DIR/pptypedef.rs:8:37 | LL | let_in(3i32, |i| { assert!(i == 3u32); }); - | ^^^^ expected `i32`, found `u32` + | - ^^^^ expected `i32`, found `u32` + | | + | expected because this is `i32` | help: change the type of the numeric literal from `u32` to `i32` | diff --git a/src/test/ui/suggestions/dont-suggest-try_into-in-macros.stderr b/src/test/ui/suggestions/dont-suggest-try_into-in-macros.stderr index 4e21d36014c90..bc6342004f4db 100644 --- a/src/test/ui/suggestions/dont-suggest-try_into-in-macros.stderr +++ b/src/test/ui/suggestions/dont-suggest-try_into-in-macros.stderr @@ -2,7 +2,10 @@ error[E0308]: mismatched types --> $DIR/dont-suggest-try_into-in-macros.rs:2:5 | LL | assert_eq!(10u64, 10usize); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u64`, found `usize` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ + | | + | expected `u64`, found `usize` + | expected because this is `u64` | = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/src/test/ui/suggestions/option-to-bool.stderr b/src/test/ui/suggestions/option-to-bool.stderr index 57a934b83420c..4050c7be82a0a 100644 --- a/src/test/ui/suggestions/option-to-bool.stderr +++ b/src/test/ui/suggestions/option-to-bool.stderr @@ -2,7 +2,9 @@ error[E0308]: mismatched types --> $DIR/option-to-bool.rs:4:16 | LL | if true && x {} - | ^ expected `bool`, found enum `Option` + | ---- ^ expected `bool`, found enum `Option` + | | + | expected because this is `bool` | = note: expected type `bool` found enum `Option` diff --git a/src/test/ui/type/type-check/assignment-in-if.stderr b/src/test/ui/type/type-check/assignment-in-if.stderr index 8ab08e25e3092..9f4558adab150 100644 --- a/src/test/ui/type/type-check/assignment-in-if.stderr +++ b/src/test/ui/type/type-check/assignment-in-if.stderr @@ -68,7 +68,9 @@ error[E0308]: mismatched types --> $DIR/assignment-in-if.rs:44:18 | LL | if x == x && x = x && x == x { - | ^ expected `bool`, found `usize` + | ------ ^ expected `bool`, found `usize` + | | + | expected because this is `bool` error[E0308]: mismatched types --> $DIR/assignment-in-if.rs:44:22 @@ -91,7 +93,9 @@ error[E0308]: mismatched types --> $DIR/assignment-in-if.rs:51:28 | LL | if x == x && x == x && x = x { - | ^ expected `bool`, found `usize` + | ---------------- ^ expected `bool`, found `usize` + | | + | expected because this is `bool` error[E0308]: mismatched types --> $DIR/assignment-in-if.rs:51:8 diff --git a/src/test/ui/type/type-params-in-different-spaces-1.stderr b/src/test/ui/type/type-params-in-different-spaces-1.stderr index 4e73e10a30143..7529f25bd8e4b 100644 --- a/src/test/ui/type/type-params-in-different-spaces-1.stderr +++ b/src/test/ui/type/type-params-in-different-spaces-1.stderr @@ -6,7 +6,9 @@ LL | trait BrokenAdd: Copy + Add { LL | fn broken_add(&self, rhs: T) -> Self { | - found type parameter LL | *self + rhs - | ^^^ expected type parameter `Self`, found type parameter `T` + | ----- ^^^ expected type parameter `Self`, found type parameter `T` + | | + | expected because this is `Self` | = note: expected type parameter `Self` found type parameter `T` diff --git a/src/test/ui/wrong-mul-method-signature.stderr b/src/test/ui/wrong-mul-method-signature.stderr index 9f8896f01ee06..8338f61b22a75 100644 --- a/src/test/ui/wrong-mul-method-signature.stderr +++ b/src/test/ui/wrong-mul-method-signature.stderr @@ -38,7 +38,9 @@ error[E0308]: mismatched types --> $DIR/wrong-mul-method-signature.rs:63:45 | LL | let x: Vec2 = Vec2 { x: 1.0, y: 2.0 } * 2.0; // trait had reversed order - | ^^^ expected struct `Vec2`, found floating-point number + | ----------------------- ^^^ expected struct `Vec2`, found floating-point number + | | + | expected because this is `Vec2` error[E0308]: mismatched types --> $DIR/wrong-mul-method-signature.rs:63:19