diff --git a/src/librustc/infer/error_reporting/mod.rs b/src/librustc/infer/error_reporting/mod.rs index caf9f7288b9..cccdcc68a57 100644 --- a/src/librustc/infer/error_reporting/mod.rs +++ b/src/librustc/infer/error_reporting/mod.rs @@ -1163,8 +1163,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { Some(values) => { let (is_simple_error, exp_found) = match values { ValuePairs::Types(exp_found) => { - let is_simple_err = - exp_found.expected.is_primitive() && exp_found.found.is_primitive(); + let is_simple_err = exp_found.expected.is_simple_text() + && exp_found.found.is_simple_text(); (is_simple_err, Some(exp_found)) } @@ -1201,8 +1201,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { .unwrap_or("type".into()); let found_label = exp_found.map(|ef| ef.found.prefix_string()) .unwrap_or("type".into()); - match (terr, is_simple_error, expected == found) { - (&TypeError::Sorts(ref values), false, extra) => { + match (&terr, expected == found) { + (TypeError::Sorts(values), extra) => { let sort_string = |ty: Ty<'tcx>| match (extra, &ty.kind) { (true, ty::Opaque(def_id, _)) => format!( " (opaque type at {})", @@ -1212,26 +1212,43 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { (true, _) => format!(" ({})", ty.sort_string(self.tcx)), (false, _) => "".to_string(), }; - diag.note_expected_found_extra( - &expected_label, - expected, - &found_label, - found, - &sort_string(values.expected), - &sort_string(values.found), - ); + if !(values.expected.is_simple_text() && values.found.is_simple_text()) || ( + exp_found.map_or(false, |ef| { + // This happens when the type error is a subset of the expectation, + // like when you have two references but one is `usize` and the other + // is `f32`. In those cases we still want to show the `note`. If the + // value from `ef` is `Infer(_)`, then we ignore it. + if !ef.expected.is_ty_infer() { + ef.expected != values.expected + } else if !ef.found.is_ty_infer() { + ef.found != values.found + } else { + false + } + }) + ) { + diag.note_expected_found_extra( + &expected_label, + expected, + &found_label, + found, + &sort_string(values.expected), + &sort_string(values.found), + ); + } } - (TypeError::ObjectUnsafeCoercion(_), ..) => { + (TypeError::ObjectUnsafeCoercion(_), _) => { diag.note_unsuccessfull_coercion(found, expected); } - (_, false, _) => { + (_, _) => { debug!( "note_type_err: exp_found={:?}, expected={:?} found={:?}", exp_found, expected, found ); - diag.note_expected_found(&expected_label, expected, &found_label, found); + if !is_simple_error || terr.must_include_note() { + diag.note_expected_found(&expected_label, expected, &found_label, found); + } } - _ => (), } } if let Some(exp_found) = exp_found { diff --git a/src/librustc/ty/error.rs b/src/librustc/ty/error.rs index 09a833baca9..feb53539a2e 100644 --- a/src/librustc/ty/error.rs +++ b/src/librustc/ty/error.rs @@ -64,8 +64,11 @@ pub enum UnconstrainedNumeric { impl<'tcx> fmt::Display for TypeError<'tcx> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { use self::TypeError::*; - fn report_maybe_different(f: &mut fmt::Formatter<'_>, - expected: &str, found: &str) -> fmt::Result { + fn report_maybe_different( + f: &mut fmt::Formatter<'_>, + expected: &str, + found: &str, + ) -> fmt::Result { // A naive approach to making sure that we're not reporting silly errors such as: // (expected closure, found closure). if expected == found { @@ -183,39 +186,70 @@ impl<'tcx> fmt::Display for TypeError<'tcx> { } } +impl<'tcx> TypeError<'tcx> { + pub fn must_include_note(&self) -> bool { + use self::TypeError::*; + match self { + CyclicTy(_) | + UnsafetyMismatch(_) | + Mismatch | + AbiMismatch(_) | + FixedArraySize(_) | + Sorts(_) | + IntMismatch(_) | + FloatMismatch(_) | + VariadicMismatch(_) => false, + + Mutability | + TupleSize(_) | + ArgCount | + RegionsDoesNotOutlive(..) | + RegionsInsufficientlyPolymorphic(..) | + RegionsOverlyPolymorphic(..) | + RegionsPlaceholderMismatch | + Traits(_) | + ProjectionMismatched(_) | + ProjectionBoundsLength(_) | + ExistentialMismatch(_) | + ConstMismatch(_) | + IntrinsicCast | + ObjectUnsafeCoercion(_) => true, + } + } +} + impl<'tcx> ty::TyS<'tcx> { pub fn sort_string(&self, tcx: TyCtxt<'_>) -> Cow<'static, str> { match self.kind { ty::Bool | ty::Char | ty::Int(_) | - ty::Uint(_) | ty::Float(_) | ty::Str | ty::Never => self.to_string().into(), - ty::Tuple(ref tys) if tys.is_empty() => self.to_string().into(), + ty::Uint(_) | ty::Float(_) | ty::Str | ty::Never => format!("{}", self).into(), + ty::Tuple(ref tys) if tys.is_empty() => format!("{}", self).into(), ty::Adt(def, _) => format!("{} `{}`", def.descr(), tcx.def_path_str(def.did)).into(), ty::Foreign(def_id) => format!("extern type `{}`", tcx.def_path_str(def_id)).into(), - ty::Array(_, n) => { + ty::Array(t, n) => { let n = tcx.lift(&n).unwrap(); match n.try_eval_usize(tcx, ty::ParamEnv::empty()) { - Some(n) => { - format!("array of {} element{}", n, pluralize!(n)).into() - } + _ if t.is_simple_ty() => format!("array `{}`", self).into(), + Some(n) => format!("array of {} element{} ", n, pluralize!(n)).into(), None => "array".into(), } } + ty::Slice(ty) if ty.is_simple_ty() => format!("slice `{}`", self).into(), ty::Slice(_) => "slice".into(), ty::RawPtr(_) => "*-ptr".into(), - ty::Ref(region, ty, mutbl) => { + ty::Ref(_, ty, mutbl) => { let tymut = ty::TypeAndMut { ty, mutbl }; let tymut_string = tymut.to_string(); - if tymut_string == "_" || //unknown type name, - tymut_string.len() > 10 || //name longer than saying "reference", - region.to_string() != "'_" //... or a complex type - { - format!("{}reference", match mutbl { - hir::Mutability::Mutable => "mutable ", - _ => "" - }).into() - } else { + if tymut_string != "_" && ( + ty.is_simple_text() || tymut_string.len() < "mutable reference".len() + ) { format!("&{}", tymut_string).into() + } else { // Unknown type name, it's long or has type arguments + match mutbl { + hir::Mutability::Mutable => "mutable reference", + _ => "reference", + }.into() } } ty::FnDef(..) => "fn item".into(), @@ -248,7 +282,6 @@ impl<'tcx> ty::TyS<'tcx> { } pub fn prefix_string(&self) -> Cow<'static, str> { - debug!("prefix_string {:?} {} {:?}", self, self, self.kind); match self.kind { ty::Infer(_) | ty::Error | ty::Bool | ty::Char | ty::Int(_) | ty::Uint(_) | ty::Float(_) | ty::Str | ty::Never => "type".into(), diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index 031d6f09b44..5fc2812fd97 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -555,16 +555,29 @@ impl<'tcx> Hash for TyS<'tcx> { impl<'tcx> TyS<'tcx> { pub fn is_primitive_ty(&self) -> bool { match self.kind { - Bool | - Char | - Int(_) | - Uint(_) | - Float(_) | - Infer(InferTy::IntVar(_)) | - Infer(InferTy::FloatVar(_)) | - Infer(InferTy::FreshIntTy(_)) | - Infer(InferTy::FreshFloatTy(_)) => true, - Ref(_, x, _) => x.is_primitive_ty(), + Bool | Char | Str | Int(_) | Uint(_) | Float(_) | + Infer(InferTy::IntVar(_)) | Infer(InferTy::FloatVar(_)) | + Infer(InferTy::FreshIntTy(_)) | Infer(InferTy::FreshFloatTy(_)) => true, + _ => false, + } + } + + pub fn is_simple_ty(&self) -> bool { + match self.kind { + Bool | Char | Str | Int(_) | Uint(_) | Float(_) | + Infer(InferTy::IntVar(_)) | Infer(InferTy::FloatVar(_)) | + Infer(InferTy::FreshIntTy(_)) | Infer(InferTy::FreshFloatTy(_)) => true, + Ref(_, x, _) | Array(x, _) | Slice(x) => x.peel_refs().is_simple_ty(), + Tuple(tys) if tys.is_empty() => true, + _ => false, + } + } + + pub fn is_simple_text(&self) -> bool { + match self.kind { + Adt(_, substs) => substs.types().next().is_none(), + Ref(_, ty, _) => ty.is_simple_text(), + _ if self.is_simple_ty() => true, _ => false, } } diff --git a/src/test/rustdoc-ui/failed-doctest-missing-codes.stdout b/src/test/rustdoc-ui/failed-doctest-missing-codes.stdout index a8753d14de2..42dc56c44ce 100644 --- a/src/test/rustdoc-ui/failed-doctest-missing-codes.stdout +++ b/src/test/rustdoc-ui/failed-doctest-missing-codes.stdout @@ -10,9 +10,6 @@ error[E0308]: mismatched types | LL | let x: () = 5i32; | ^^^^ expected (), found i32 - | - = note: expected type `()` - found type `i32` error: aborting due to previous error diff --git a/src/test/ui/arg-type-mismatch.stderr b/src/test/ui/arg-type-mismatch.stderr index 95aa36ebb89..321a07c4a66 100644 --- a/src/test/ui/arg-type-mismatch.stderr +++ b/src/test/ui/arg-type-mismatch.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | fn main() { let i: (); i = f(()); } | ^^ expected isize, found () - | - = note: expected type `isize` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/array-not-vector.rs b/src/test/ui/array-not-vector.rs index 838951c7c1d..504874f2ce3 100644 --- a/src/test/ui/array-not-vector.rs +++ b/src/test/ui/array-not-vector.rs @@ -1,9 +1,7 @@ fn main() { let _x: i32 = [1, 2, 3]; //~^ ERROR mismatched types - //~| expected type `i32` - //~| found array `[{integer}; 3]` - //~| expected i32, found array of 3 elements + //~| expected i32, found array let x: &[i32] = &[1, 2, 3]; let _y: &i32 = x; diff --git a/src/test/ui/array-not-vector.stderr b/src/test/ui/array-not-vector.stderr index 2a2fbe6660a..fd02307ffd3 100644 --- a/src/test/ui/array-not-vector.stderr +++ b/src/test/ui/array-not-vector.stderr @@ -2,16 +2,13 @@ error[E0308]: mismatched types --> $DIR/array-not-vector.rs:2:19 | LL | let _x: i32 = [1, 2, 3]; - | ^^^^^^^^^ expected i32, found array of 3 elements - | - = note: expected type `i32` - found array `[{integer}; 3]` + | ^^^^^^^^^ expected i32, found array `[{integer}; 3]` error[E0308]: mismatched types - --> $DIR/array-not-vector.rs:9:20 + --> $DIR/array-not-vector.rs:7:20 | LL | let _y: &i32 = x; - | ^ expected i32, found slice + | ^ expected i32, found slice `[i32]` | = note: expected reference `&i32` found reference `&[i32]` diff --git a/src/test/ui/associated-const/associated-const-generic-obligations.stderr b/src/test/ui/associated-const/associated-const-generic-obligations.stderr index 6a48bbabe10..f2312cbaa06 100644 --- a/src/test/ui/associated-const/associated-const-generic-obligations.stderr +++ b/src/test/ui/associated-const/associated-const-generic-obligations.stderr @@ -5,7 +5,7 @@ LL | const FROM: Self::Out; | --------- type in trait ... LL | const FROM: &'static str = "foo"; - | ^^^^^^^^^^^^ expected associated type, found reference + | ^^^^^^^^^^^^ expected associated type, found &str | = note: expected associated type `::Out` found reference `&'static str` diff --git a/src/test/ui/associated-type/associated-type-projection-from-supertrait.stderr b/src/test/ui/associated-type/associated-type-projection-from-supertrait.stderr index 483c7e7707e..07f207627f4 100644 --- a/src/test/ui/associated-type/associated-type-projection-from-supertrait.stderr +++ b/src/test/ui/associated-type/associated-type-projection-from-supertrait.stderr @@ -3,36 +3,24 @@ error[E0308]: mismatched types | LL | fn b() { dent(ModelT, Blue); } | ^^^^ expected struct `Black`, found struct `Blue` - | - = note: expected struct `Black` - found struct `Blue` error[E0308]: mismatched types --> $DIR/associated-type-projection-from-supertrait.rs:28:23 | LL | fn c() { dent(ModelU, Black); } | ^^^^^ expected struct `Blue`, found struct `Black` - | - = note: expected struct `Blue` - found struct `Black` error[E0308]: mismatched types --> $DIR/associated-type-projection-from-supertrait.rs:32:28 | LL | fn f() { ModelT.chip_paint(Blue); } | ^^^^ expected struct `Black`, found struct `Blue` - | - = note: expected struct `Black` - found struct `Blue` error[E0308]: mismatched types --> $DIR/associated-type-projection-from-supertrait.rs:33:28 | LL | fn g() { ModelU.chip_paint(Black); } | ^^^^^ expected struct `Blue`, found struct `Black` - | - = note: expected struct `Blue` - found struct `Black` error: aborting due to 4 previous errors diff --git a/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr b/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr index 6443de58781..86e651b53f0 100644 --- a/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr +++ b/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr @@ -6,9 +6,6 @@ LL | fn blue_car>(c: C) { ... LL | fn b() { blue_car(ModelT); } | ^^^^^^^^ expected struct `Blue`, found struct `Black` - | - = note: expected struct `Blue` - found struct `Black` error[E0271]: type mismatch resolving `::Color == Black` --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:32:10 @@ -18,9 +15,6 @@ LL | fn black_car>(c: C) { ... LL | fn c() { black_car(ModelU); } | ^^^^^^^^^ expected struct `Black`, found struct `Blue` - | - = note: expected struct `Black` - found struct `Blue` error: aborting due to 2 previous errors diff --git a/src/test/ui/associated-types/associated-types-eq-3.stderr b/src/test/ui/associated-types/associated-types-eq-3.stderr index 88910f6de2a..060e2c8a2cc 100644 --- a/src/test/ui/associated-types/associated-types-eq-3.stderr +++ b/src/test/ui/associated-types/associated-types-eq-3.stderr @@ -17,9 +17,6 @@ LL | fn foo1>(x: I) { ... LL | foo1(a); | ^^^^ expected struct `Bar`, found usize - | - = note: expected struct `Bar` - found type `usize` error[E0271]: type mismatch resolving `::A == Bar` --> $DIR/associated-types-eq-3.rs:41:9 @@ -27,8 +24,6 @@ error[E0271]: type mismatch resolving `::A == Bar` LL | baz(&a); | ^^ expected struct `Bar`, found usize | - = note: expected struct `Bar` - found type `usize` = note: required for the cast to the object type `dyn Foo` error: aborting due to 3 previous errors diff --git a/src/test/ui/associated-types/associated-types-overridden-binding-2.stderr b/src/test/ui/associated-types/associated-types-overridden-binding-2.stderr index 02a6ac12dd9..4ec1fd810aa 100644 --- a/src/test/ui/associated-types/associated-types-overridden-binding-2.stderr +++ b/src/test/ui/associated-types/associated-types-overridden-binding-2.stderr @@ -4,8 +4,6 @@ error[E0271]: type mismatch resolving ` as std::iter::It LL | let _: &dyn I32Iterator = &vec![42].into_iter(); | ^^^^^^^^^^^^^^^^^^^^^ expected i32, found u32 | - = note: expected type `i32` - found type `u32` = note: required for the cast to the object type `dyn std::iter::Iterator` error: aborting due to previous error diff --git a/src/test/ui/associated-types/issue-44153.stderr b/src/test/ui/associated-types/issue-44153.stderr index 7751d20f352..f9b1373820f 100644 --- a/src/test/ui/associated-types/issue-44153.stderr +++ b/src/test/ui/associated-types/issue-44153.stderr @@ -7,8 +7,6 @@ LL | fn visit() {} LL | <() as Visit>::visit(); | ^^^^^^^^^^^^^^^^^^^^ expected (), found &() | - = note: expected unit type `()` - found reference `&()` = note: required because of the requirements on the impl of `Visit` for `()` error: aborting due to previous error diff --git a/src/test/ui/associated-types/point-at-type-on-obligation-failure.stderr b/src/test/ui/associated-types/point-at-type-on-obligation-failure.stderr index ceb811f7e01..9b4defaa0bd 100644 --- a/src/test/ui/associated-types/point-at-type-on-obligation-failure.stderr +++ b/src/test/ui/associated-types/point-at-type-on-obligation-failure.stderr @@ -8,9 +8,6 @@ LL | impl Bar for Foo { | ---------------- in this `impl` item LL | type Ok = (); | ^^^^^^^^^^^^^ expected u32, found () - | - = note: expected type `u32` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/async-await/async-block-control-flow-static-semantics.stderr b/src/test/ui/async-await/async-block-control-flow-static-semantics.stderr index 832f00642e3..212558cf932 100644 --- a/src/test/ui/async-await/async-block-control-flow-static-semantics.stderr +++ b/src/test/ui/async-await/async-block-control-flow-static-semantics.stderr @@ -25,9 +25,6 @@ LL | fn return_targets_async_block_not_fn() -> u8 { | --------------------------------- ^^ expected u8, found () | | | implicitly returns `()` as its body has no tail or `return` expression - | - = note: expected type `u8` - found unit type `()` error[E0271]: type mismatch resolving `::Output == ()` --> $DIR/async-block-control-flow-static-semantics.rs:18:39 @@ -35,8 +32,6 @@ error[E0271]: type mismatch resolving ` = █ | ^^^^^^ expected (), found u8 | - = note: expected unit type `()` - found type `u8` = note: required for the cast to the object type `dyn std::future::Future` error[E0308]: mismatched types @@ -51,9 +46,6 @@ LL | | return 0u8; LL | | LL | | } | |_^ expected u8, found () - | - = note: expected type `u8` - found unit type `()` error[E0271]: type mismatch resolving `::Output == ()` --> $DIR/async-block-control-flow-static-semantics.rs:27:39 @@ -61,8 +53,6 @@ error[E0271]: type mismatch resolving ` = █ | ^^^^^^ expected (), found u8 | - = note: expected unit type `()` - found type `u8` = note: required for the cast to the object type `dyn std::future::Future` error[E0308]: mismatched types diff --git a/src/test/ui/bad/bad-const-type.rs b/src/test/ui/bad/bad-const-type.rs index aacc796e2a8..ce9ea7bc9ed 100644 --- a/src/test/ui/bad/bad-const-type.rs +++ b/src/test/ui/bad/bad-const-type.rs @@ -1,6 +1,4 @@ static i: String = 10; //~^ ERROR mismatched types //~| expected struct `std::string::String`, found integer -//~| expected struct `std::string::String` -//~| found type `{integer}` fn main() { println!("{}", i); } diff --git a/src/test/ui/bad/bad-const-type.stderr b/src/test/ui/bad/bad-const-type.stderr index d3da6bd7718..f667779fab5 100644 --- a/src/test/ui/bad/bad-const-type.stderr +++ b/src/test/ui/bad/bad-const-type.stderr @@ -6,9 +6,6 @@ LL | static i: String = 10; | | | expected struct `std::string::String`, found integer | help: try using a conversion method: `10.to_string()` - | - = note: expected struct `std::string::String` - found type `{integer}` error: aborting due to previous error diff --git a/src/test/ui/binop/binop-logic-int.stderr b/src/test/ui/binop/binop-logic-int.stderr index b699b390b8b..06b7fcbe9b6 100644 --- a/src/test/ui/binop/binop-logic-int.stderr +++ b/src/test/ui/binop/binop-logic-int.stderr @@ -3,18 +3,12 @@ error[E0308]: mismatched types | LL | fn main() { let x = 1 && 2; } | ^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error[E0308]: mismatched types --> $DIR/binop-logic-int.rs:1:26 | LL | fn main() { let x = 1 && 2; } | ^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error: aborting due to 2 previous errors diff --git a/src/test/ui/blind/blind-item-block-middle.stderr b/src/test/ui/blind/blind-item-block-middle.stderr index 8e6e754df5b..264e7fc8e73 100644 --- a/src/test/ui/blind/blind-item-block-middle.stderr +++ b/src/test/ui/blind/blind-item-block-middle.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | let bar = 5; | ^^^ expected integer, found struct `foo::bar` - | - = note: expected type `{integer}` - found struct `foo::bar` error: aborting due to previous error diff --git a/src/test/ui/block-expression-remove-semicolon.stderr b/src/test/ui/block-expression-remove-semicolon.stderr index 29a53bed7d7..cc515f4bf45 100644 --- a/src/test/ui/block-expression-remove-semicolon.stderr +++ b/src/test/ui/block-expression-remove-semicolon.stderr @@ -8,9 +8,6 @@ LL | | foo(); | | - help: consider removing this semicolon LL | | }; | |_____^ expected i32, found () - | - = note: expected type `i32` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/block-result/block-must-not-have-result-do.stderr b/src/test/ui/block-result/block-must-not-have-result-do.stderr index 11f9db6937e..a303f5d29d0 100644 --- a/src/test/ui/block-result/block-must-not-have-result-do.stderr +++ b/src/test/ui/block-result/block-must-not-have-result-do.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | true | ^^^^ expected (), found bool - | - = note: expected unit type `()` - found type `bool` error: aborting due to previous error diff --git a/src/test/ui/block-result/block-must-not-have-result-res.stderr b/src/test/ui/block-result/block-must-not-have-result-res.stderr index ba80ce2d6b1..aabc7604f90 100644 --- a/src/test/ui/block-result/block-must-not-have-result-res.stderr +++ b/src/test/ui/block-result/block-must-not-have-result-res.stderr @@ -5,9 +5,6 @@ LL | fn drop(&mut self) { | - expected `()` because of default return type LL | true | ^^^^ expected (), found bool - | - = note: expected unit type `()` - found type `bool` error: aborting due to previous error diff --git a/src/test/ui/block-result/block-must-not-have-result-while.rs b/src/test/ui/block-result/block-must-not-have-result-while.rs index 42b439cd320..f9372593729 100644 --- a/src/test/ui/block-result/block-must-not-have-result-while.rs +++ b/src/test/ui/block-result/block-must-not-have-result-while.rs @@ -1,8 +1,6 @@ fn main() { while true { //~ WARN denote infinite loops with true //~ ERROR mismatched types - //~| expected unit type `()` - //~| found type `bool` //~| expected (), found bool } } diff --git a/src/test/ui/block-result/block-must-not-have-result-while.stderr b/src/test/ui/block-result/block-must-not-have-result-while.stderr index d19ae3af657..72063ad1731 100644 --- a/src/test/ui/block-result/block-must-not-have-result-while.stderr +++ b/src/test/ui/block-result/block-must-not-have-result-while.stderr @@ -11,9 +11,6 @@ error[E0308]: mismatched types | LL | true | ^^^^ expected (), found bool - | - = note: expected unit type `()` - found type `bool` error: aborting due to previous error diff --git a/src/test/ui/block-result/consider-removing-last-semi.stderr b/src/test/ui/block-result/consider-removing-last-semi.stderr index 76643b49bc0..fed98f91246 100644 --- a/src/test/ui/block-result/consider-removing-last-semi.stderr +++ b/src/test/ui/block-result/consider-removing-last-semi.stderr @@ -8,9 +8,6 @@ LL | fn f() -> String { LL | 0u8; LL | "bla".to_string(); | - help: consider removing this semicolon - | - = note: expected struct `std::string::String` - found unit type `()` error[E0308]: mismatched types --> $DIR/consider-removing-last-semi.rs:6:11 @@ -22,9 +19,6 @@ LL | fn g() -> String { LL | "this won't work".to_string(); LL | "removeme".to_string(); | - help: consider removing this semicolon - | - = note: expected struct `std::string::String` - found unit type `()` error: aborting due to 2 previous errors diff --git a/src/test/ui/block-result/issue-11714.stderr b/src/test/ui/block-result/issue-11714.stderr index 54c1bb220a9..5cd2726b8dd 100644 --- a/src/test/ui/block-result/issue-11714.stderr +++ b/src/test/ui/block-result/issue-11714.stderr @@ -8,9 +8,6 @@ LL | fn blah() -> i32 { ... LL | ; | - help: consider removing this semicolon - | - = note: expected type `i32` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/block-result/issue-13428.stderr b/src/test/ui/block-result/issue-13428.stderr index b1f2ca63451..24e942619f0 100644 --- a/src/test/ui/block-result/issue-13428.stderr +++ b/src/test/ui/block-result/issue-13428.stderr @@ -8,9 +8,6 @@ LL | fn foo() -> String { ... LL | ; | - help: consider removing this semicolon - | - = note: expected struct `std::string::String` - found unit type `()` error[E0308]: mismatched types --> $DIR/issue-13428.rs:11:13 @@ -22,9 +19,6 @@ LL | fn bar() -> String { LL | "foobar".to_string() LL | ; | - help: consider removing this semicolon - | - = note: expected struct `std::string::String` - found unit type `()` error: aborting due to 2 previous errors diff --git a/src/test/ui/block-result/issue-13624.rs b/src/test/ui/block-result/issue-13624.rs index ca457aa907d..ed0b3021746 100644 --- a/src/test/ui/block-result/issue-13624.rs +++ b/src/test/ui/block-result/issue-13624.rs @@ -7,8 +7,6 @@ mod a { Enum::EnumStructVariant { x: 1, y: 2, z: 3 } //~^ ERROR mismatched types //~| expected (), found enum `a::Enum` - //~| expected unit type `()` - //~| found enum `a::Enum` } } @@ -22,8 +20,6 @@ mod b { a::Enum::EnumStructVariant { x, y, z } => { //~^ ERROR mismatched types //~| expected (), found enum `a::Enum` - //~| expected unit type `()` - //~| found enum `a::Enum` } } } diff --git a/src/test/ui/block-result/issue-13624.stderr b/src/test/ui/block-result/issue-13624.stderr index 6e2b2812c72..2404d06ae86 100644 --- a/src/test/ui/block-result/issue-13624.stderr +++ b/src/test/ui/block-result/issue-13624.stderr @@ -5,20 +5,14 @@ LL | pub fn get_enum_struct_variant() -> () { | -- expected `()` because of return type LL | Enum::EnumStructVariant { x: 1, y: 2, z: 3 } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found enum `a::Enum` - | - = note: expected unit type `()` - found enum `a::Enum` error[E0308]: mismatched types - --> $DIR/issue-13624.rs:22:9 + --> $DIR/issue-13624.rs:20:9 | LL | match enum_struct_variant { | ------------------- this match expression has type `()` LL | a::Enum::EnumStructVariant { x, y, z } => { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found enum `a::Enum` - | - = note: expected unit type `()` - found enum `a::Enum` error: aborting due to 2 previous errors diff --git a/src/test/ui/block-result/issue-22645.stderr b/src/test/ui/block-result/issue-22645.stderr index 5df71e8374b..cc1b4a217ce 100644 --- a/src/test/ui/block-result/issue-22645.stderr +++ b/src/test/ui/block-result/issue-22645.stderr @@ -16,9 +16,6 @@ LL | fn main() { LL | let b = Bob + 3.5; LL | b + 3 | ^^^^^ expected (), found struct `Bob` - | - = note: expected unit type `()` - found struct `Bob` error: aborting due to 2 previous errors diff --git a/src/test/ui/block-result/unexpected-return-on-unit.stderr b/src/test/ui/block-result/unexpected-return-on-unit.stderr index 3eae3e75422..170d11373dd 100644 --- a/src/test/ui/block-result/unexpected-return-on-unit.stderr +++ b/src/test/ui/block-result/unexpected-return-on-unit.stderr @@ -4,8 +4,6 @@ error[E0308]: mismatched types LL | foo() | ^^^^^ expected (), found usize | - = note: expected unit type `()` - found type `usize` help: try adding a semicolon | LL | foo(); diff --git a/src/test/ui/chalkify/type_inference.stderr b/src/test/ui/chalkify/type_inference.stderr index c6bc306e45a..fdc79ec29f3 100644 --- a/src/test/ui/chalkify/type_inference.stderr +++ b/src/test/ui/chalkify/type_inference.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | only_foo(x); | ^ expected i32, found floating-point number - | - = note: expected type `i32` - found type `{float}` error[E0277]: the trait bound `{float}: Bar` is not satisfied --> $DIR/type_inference.rs:25:5 diff --git a/src/test/ui/codemap_tests/tab.stderr b/src/test/ui/codemap_tests/tab.stderr index ea3ded67c0a..3ee10cd4cb8 100644 --- a/src/test/ui/codemap_tests/tab.stderr +++ b/src/test/ui/codemap_tests/tab.stderr @@ -10,10 +10,7 @@ error[E0308]: mismatched types LL | fn foo() { | - help: try adding a return type: `-> &'static str` LL | "bar boo" - | ^^^^^^^^^^^^^^^^^^^^ expected (), found reference - | - = note: expected unit type `()` - found reference `&'static str` + | ^^^^^^^^^^^^^^^^^^^^ expected (), found &str error: aborting due to 2 previous errors diff --git a/src/test/ui/coercion/coerce-expect-unsized-ascribed.stderr b/src/test/ui/coercion/coerce-expect-unsized-ascribed.stderr index acbc8339b19..db8ecb818c9 100644 --- a/src/test/ui/coercion/coerce-expect-unsized-ascribed.stderr +++ b/src/test/ui/coercion/coerce-expect-unsized-ascribed.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:9:13 | LL | let _ = box { [1, 2, 3] }: Box<[i32]>; - | ^^^^^^^^^^^^^^^^^ expected slice, found array of 3 elements + | ^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]` | = note: expected struct `std::boxed::Box<[i32]>` found struct `std::boxed::Box<[i32; 3]>` @@ -11,7 +11,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:10:13 | LL | let _ = box if true { [1, 2, 3] } else { [1, 3, 4] }: Box<[i32]>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice, found array of 3 elements + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]` | = note: expected struct `std::boxed::Box<[i32]>` found struct `std::boxed::Box<[i32; 3]>` @@ -20,7 +20,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:11:13 | LL | let _ = box match true { true => [1, 2, 3], false => [1, 3, 4] }: Box<[i32]>; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice, found array of 3 elements + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]` | = note: expected struct `std::boxed::Box<[i32]>` found struct `std::boxed::Box<[i32; 3]>` @@ -56,7 +56,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:17:13 | LL | let _ = &{ [1, 2, 3] }: &[i32]; - | ^^^^^^^^^^^^^^ expected slice, found array of 3 elements + | ^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]` | = note: expected reference `&[i32]` found reference `&[i32; 3]` @@ -65,7 +65,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:18:13 | LL | let _ = &if true { [1, 2, 3] } else { [1, 3, 4] }: &[i32]; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice, found array of 3 elements + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]` | = note: expected reference `&[i32]` found reference `&[i32; 3]` @@ -74,7 +74,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:19:13 | LL | let _ = &match true { true => [1, 2, 3], false => [1, 3, 4] }: &[i32]; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice, found array of 3 elements + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]` | = note: expected reference `&[i32]` found reference `&[i32; 3]` @@ -110,7 +110,7 @@ error[E0308]: mismatched types --> $DIR/coerce-expect-unsized-ascribed.rs:25:13 | LL | let _ = Box::new([1, 2, 3]): Box<[i32]>; - | ^^^^^^^^^^^^^^^^^^^ expected slice, found array of 3 elements + | ^^^^^^^^^^^^^^^^^^^ expected slice `[i32]`, found array `[i32; 3]` | = note: expected struct `std::boxed::Box<[i32]>` found struct `std::boxed::Box<[i32; 3]>` diff --git a/src/test/ui/coercion/coercion-missing-tail-expected-type.stderr b/src/test/ui/coercion/coercion-missing-tail-expected-type.stderr index 1122901a17e..7811df45259 100644 --- a/src/test/ui/coercion/coercion-missing-tail-expected-type.stderr +++ b/src/test/ui/coercion/coercion-missing-tail-expected-type.stderr @@ -7,9 +7,6 @@ LL | fn plus_one(x: i32) -> i32 { | implicitly returns `()` as its body has no tail or `return` expression LL | x + 1; | - help: consider removing this semicolon - | - = note: expected type `i32` - found unit type `()` error[E0308]: mismatched types --> $DIR/coercion-missing-tail-expected-type.rs:7:13 diff --git a/src/test/ui/coercion/coercion-slice.rs b/src/test/ui/coercion/coercion-slice.rs index fbfe1984b9f..1d54d35f649 100644 --- a/src/test/ui/coercion/coercion-slice.rs +++ b/src/test/ui/coercion/coercion-slice.rs @@ -3,6 +3,5 @@ fn main() { let _: &[i32] = [0]; //~^ ERROR mismatched types - //~| expected reference `&[i32]` - //~| expected &[i32], found array of 1 element + //~| expected &[i32], found array `[{integer}; 1]` } diff --git a/src/test/ui/coercion/coercion-slice.stderr b/src/test/ui/coercion/coercion-slice.stderr index 55523933f54..34caaed9de4 100644 --- a/src/test/ui/coercion/coercion-slice.stderr +++ b/src/test/ui/coercion/coercion-slice.stderr @@ -4,11 +4,8 @@ error[E0308]: mismatched types LL | let _: &[i32] = [0]; | ^^^ | | - | expected &[i32], found array of 1 element + | expected &[i32], found array `[{integer}; 1]` | help: consider borrowing here: `&[0]` - | - = note: expected reference `&[i32]` - found array `[{integer}; 1]` error: aborting due to previous error diff --git a/src/test/ui/const-generics/const-argument-cross-crate-mismatch.stderr b/src/test/ui/const-generics/const-argument-cross-crate-mismatch.stderr index 8461755dbfe..aefd514f7a6 100644 --- a/src/test/ui/const-generics/const-argument-cross-crate-mismatch.stderr +++ b/src/test/ui/const-generics/const-argument-cross-crate-mismatch.stderr @@ -3,18 +3,12 @@ error[E0308]: mismatched types | LL | let _ = const_generic_lib::function(const_generic_lib::Struct([0u8, 1u8])); | ^^^^^^^^^^ expected an array with a fixed size of 3 elements, found one with 2 elements - | - = note: expected array `[u8; 3]` - found array `[u8; 2]` error[E0308]: mismatched types --> $DIR/const-argument-cross-crate-mismatch.rs:8:65 | LL | let _: const_generic_lib::Alias = const_generic_lib::Struct([0u8, 1u8, 2u8]); | ^^^^^^^^^^^^^^^ expected an array with a fixed size of 2 elements, found one with 3 elements - | - = note: expected array `[u8; 2]` - found array `[u8; 3]` error: aborting due to 2 previous errors diff --git a/src/test/ui/consts/const-array-oob-arith.stderr b/src/test/ui/consts/const-array-oob-arith.stderr index f4a4c091e78..eae93b72ddc 100644 --- a/src/test/ui/consts/const-array-oob-arith.stderr +++ b/src/test/ui/consts/const-array-oob-arith.stderr @@ -3,18 +3,12 @@ error[E0308]: mismatched types | LL | const BLUB: [i32; (ARR[0] - 40) as usize] = [5]; | ^^^ expected an array with a fixed size of 2 elements, found one with 1 element - | - = note: expected array `[i32; 2]` - found array `[i32; 1]` error[E0308]: mismatched types --> $DIR/const-array-oob-arith.rs:10:44 | LL | const BOO: [i32; (ARR[0] - 41) as usize] = [5, 99]; | ^^^^^^^ expected an array with a fixed size of 1 element, found one with 2 elements - | - = note: expected array `[i32; 1]` - found array `[i32; 2]` error: aborting due to 2 previous errors diff --git a/src/test/ui/consts/const-eval/const-eval-span.rs b/src/test/ui/consts/const-eval/const-eval-span.rs index 279fe7fb7fe..682c7a1d65f 100644 --- a/src/test/ui/consts/const-eval/const-eval-span.rs +++ b/src/test/ui/consts/const-eval/const-eval-span.rs @@ -9,7 +9,6 @@ enum E { V = CONSTANT, //~^ ERROR mismatched types //~| expected isize, found struct `S` - //~| found struct `S` } fn main() {} diff --git a/src/test/ui/consts/const-eval/const-eval-span.stderr b/src/test/ui/consts/const-eval/const-eval-span.stderr index 5b046e266a2..3436802f8a9 100644 --- a/src/test/ui/consts/const-eval/const-eval-span.stderr +++ b/src/test/ui/consts/const-eval/const-eval-span.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | V = CONSTANT, | ^^^^^^^^ expected isize, found struct `S` - | - = note: expected type `isize` - found struct `S` error: aborting due to previous error diff --git a/src/test/ui/consts/const-integer-bool-ops.stderr b/src/test/ui/consts/const-integer-bool-ops.stderr index 7fd973786d1..8b5f3440964 100644 --- a/src/test/ui/consts/const-integer-bool-ops.stderr +++ b/src/test/ui/consts/const-integer-bool-ops.stderr @@ -3,18 +3,12 @@ error[E0308]: mismatched types | LL | const X: usize = 42 && 39; | ^^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:1:24 | LL | const X: usize = 42 && 39; | ^^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:1:18 @@ -33,18 +27,12 @@ error[E0308]: mismatched types | LL | const X1: usize = 42 || 39; | ^^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:11:25 | LL | const X1: usize = 42 || 39; | ^^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:11:19 @@ -63,18 +51,12 @@ error[E0308]: mismatched types | LL | const X2: usize = -42 || -39; | ^^^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:21:26 | LL | const X2: usize = -42 || -39; | ^^^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:21:19 @@ -93,18 +75,12 @@ error[E0308]: mismatched types | LL | const X3: usize = -42 && -39; | ^^^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:31:26 | LL | const X3: usize = -42 && -39; | ^^^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error[E0308]: mismatched types --> $DIR/const-integer-bool-ops.rs:31:19 diff --git a/src/test/ui/conversion-methods.stderr b/src/test/ui/conversion-methods.stderr index 11384d92cb8..ff5529a8408 100644 --- a/src/test/ui/conversion-methods.stderr +++ b/src/test/ui/conversion-methods.stderr @@ -4,11 +4,8 @@ error[E0308]: mismatched types LL | let _tis_an_instants_play: String = "'Tis a fond Ambush—"; | ^^^^^^^^^^^^^^^^^^^^^ | | - | expected struct `std::string::String`, found reference + | expected struct `std::string::String`, found &str | help: try using a conversion method: `"'Tis a fond Ambush—".to_string()` - | - = note: expected struct `std::string::String` - found reference `&'static str` error[E0308]: mismatched types --> $DIR/conversion-methods.rs:6:40 @@ -16,11 +13,8 @@ error[E0308]: mismatched types LL | let _just_to_make_bliss: PathBuf = Path::new("/ern/her/own/surprise"); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | - | expected struct `std::path::PathBuf`, found reference + | expected struct `std::path::PathBuf`, found &std::path::Path | help: try using a conversion method: `Path::new("/ern/her/own/surprise").to_path_buf()` - | - = note: expected struct `std::path::PathBuf` - found reference `&std::path::Path` error[E0308]: mismatched types --> $DIR/conversion-methods.rs:9:40 @@ -30,9 +24,6 @@ LL | let _but_should_the_play: String = 2; // Perhaps surprisingly, we sugge | | | expected struct `std::string::String`, found integer | help: try using a conversion method: `2.to_string()` - | - = note: expected struct `std::string::String` - found type `{integer}` error[E0308]: mismatched types --> $DIR/conversion-methods.rs:12:47 @@ -40,7 +31,7 @@ error[E0308]: mismatched types LL | let _prove_piercing_earnest: Vec = &[1, 2, 3]; | ^^^^^^^^^^ | | - | expected struct `std::vec::Vec`, found reference + | expected struct `std::vec::Vec`, found &[{integer}; 3] | help: try using a conversion method: `(&[1, 2, 3]).to_vec()` | = note: expected struct `std::vec::Vec` diff --git a/src/test/ui/deref-suggestion.stderr b/src/test/ui/deref-suggestion.stderr index 53bc3212a7f..433bab77189 100644 --- a/src/test/ui/deref-suggestion.stderr +++ b/src/test/ui/deref-suggestion.stderr @@ -4,11 +4,8 @@ error[E0308]: mismatched types LL | foo(s); | ^ | | - | expected struct `std::string::String`, found reference + | expected struct `std::string::String`, found &std::string::String | help: try using a conversion method: `s.to_string()` - | - = note: expected struct `std::string::String` - found reference `&std::string::String` error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:14:10 @@ -18,9 +15,6 @@ LL | foo3(u); | | | expected u32, found &u32 | help: consider dereferencing the borrow: `*u` - | - = note: expected type `u32` - found reference `&u32` error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:30:9 @@ -28,11 +22,8 @@ error[E0308]: mismatched types LL | foo(&"aaa".to_owned()); | ^^^^^^^^^^^^^^^^^ | | - | expected struct `std::string::String`, found reference + | expected struct `std::string::String`, found &std::string::String | help: consider removing the borrow: `"aaa".to_owned()` - | - = note: expected struct `std::string::String` - found reference `&std::string::String` error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:32:9 @@ -40,11 +31,8 @@ error[E0308]: mismatched types LL | foo(&mut "aaa".to_owned()); | ^^^^^^^^^^^^^^^^^^^^^ | | - | expected struct `std::string::String`, found mutable reference + | expected struct `std::string::String`, found &mut std::string::String | help: consider removing the borrow: `"aaa".to_owned()` - | - = note: expected struct `std::string::String` - found mutable reference `&mut std::string::String` error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:2:20 @@ -54,9 +42,6 @@ LL | ($x:expr) => { &$x } ... LL | foo3(borrow!(0)); | ---------- in this macro invocation - | - = note: expected type `u32` - found reference `&{integer}` error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:36:5 @@ -64,8 +49,6 @@ error[E0308]: mismatched types LL | assert_eq!(3i32, &3i32); | ^^^^^^^^^^^^^^^^^^^^^^^^ expected i32, found &i32 | - = note: expected type `i32` - found reference `&i32` = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error[E0308]: mismatched types @@ -76,9 +59,6 @@ LL | let s = S { u }; | | | expected &u32, found integer | help: consider borrowing here: `u: &u` - | - = note: expected reference `&u32` - found type `{integer}` error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:41:20 @@ -88,9 +68,6 @@ LL | let s = S { u: u }; | | | expected &u32, found integer | help: consider borrowing here: `&u` - | - = note: expected reference `&u32` - found type `{integer}` error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:44:17 @@ -100,9 +77,6 @@ LL | let r = R { i }; | | | expected u32, found &{integer} | help: consider dereferencing the borrow: `i: *i` - | - = note: expected type `u32` - found reference `&{integer}` error[E0308]: mismatched types --> $DIR/deref-suggestion.rs:46:20 @@ -112,9 +86,6 @@ LL | let r = R { i: i }; | | | expected u32, found &{integer} | help: consider dereferencing the borrow: `*i` - | - = note: expected type `u32` - found reference `&{integer}` error: aborting due to 10 previous errors diff --git a/src/test/ui/did_you_mean/issue-42764.stderr b/src/test/ui/did_you_mean/issue-42764.stderr index bd913649dd0..5fd3676d361 100644 --- a/src/test/ui/did_you_mean/issue-42764.stderr +++ b/src/test/ui/did_you_mean/issue-42764.stderr @@ -18,9 +18,6 @@ error[E0308]: mismatched types | LL | let _c = Context { wrapper: Payload{} }; | ^^^^^^^^^ expected struct `Wrapper`, found struct `Payload` - | - = note: expected struct `Wrapper` - found struct `Payload` error: aborting due to 2 previous errors diff --git a/src/test/ui/did_you_mean/issue-53280-expected-float-found-integer-literal.stderr b/src/test/ui/did_you_mean/issue-53280-expected-float-found-integer-literal.stderr index 301704ec0c7..76641b1120a 100644 --- a/src/test/ui/did_you_mean/issue-53280-expected-float-found-integer-literal.stderr +++ b/src/test/ui/did_you_mean/issue-53280-expected-float-found-integer-literal.stderr @@ -6,9 +6,6 @@ LL | let sixteen: f32 = 16; | | | expected f32, found integer | help: use a float literal: `16.0` - | - = note: expected type `f32` - found type `{integer}` error[E0308]: mismatched types --> $DIR/issue-53280-expected-float-found-integer-literal.rs:5:38 @@ -18,9 +15,6 @@ LL | let a_million_and_seventy: f64 = 1_000_070; | | | expected f64, found integer | help: use a float literal: `1_000_070.0` - | - = note: expected type `f64` - found type `{integer}` error[E0308]: mismatched types --> $DIR/issue-53280-expected-float-found-integer-literal.rs:8:30 @@ -30,27 +24,18 @@ LL | let negative_nine: f32 = -9; | | | expected f32, found integer | help: use a float literal: `-9.0` - | - = note: expected type `f32` - found type `{integer}` error[E0308]: mismatched types --> $DIR/issue-53280-expected-float-found-integer-literal.rs:15:30 | LL | let sixteen_again: f64 = 0x10; | ^^^^ expected f64, found integer - | - = note: expected type `f64` - found type `{integer}` error[E0308]: mismatched types --> $DIR/issue-53280-expected-float-found-integer-literal.rs:17:30 | LL | let and_once_more: f32 = 0o20; | ^^^^ expected f32, found integer - | - = note: expected type `f32` - found type `{integer}` error: aborting due to 5 previous errors diff --git a/src/test/ui/diverging-fn-tail-35849.stderr b/src/test/ui/diverging-fn-tail-35849.stderr index ebca760e235..3f3ef666f66 100644 --- a/src/test/ui/diverging-fn-tail-35849.stderr +++ b/src/test/ui/diverging-fn-tail-35849.stderr @@ -5,7 +5,7 @@ LL | fn assert_sizeof() -> ! { | - expected `!` because of return type LL | unsafe { LL | ::std::mem::transmute::(panic!()) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected !, found array of 8 elements + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected !, found array `[u8; 8]` | = note: expected type `!` found array `[u8; 8]` diff --git a/src/test/ui/dst/dst-bad-coerce1.stderr b/src/test/ui/dst/dst-bad-coerce1.stderr index 7e9d127a9af..3eb16663e13 100644 --- a/src/test/ui/dst/dst-bad-coerce1.stderr +++ b/src/test/ui/dst/dst-bad-coerce1.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/dst-bad-coerce1.rs:16:29 | LL | let f3: &Fat<[usize]> = f2; - | ^^ expected slice, found array of 3 elements + | ^^ expected slice `[usize]`, found array `[isize; 3]` | = note: expected reference `&Fat<[usize]>` found reference `&Fat<[isize; 3]>` @@ -19,7 +19,7 @@ error[E0308]: mismatched types --> $DIR/dst-bad-coerce1.rs:28:27 | LL | let f3: &([usize],) = f2; - | ^^ expected slice, found array of 3 elements + | ^^ expected slice `[usize]`, found array `[isize; 3]` | = note: expected reference `&([usize],)` found reference `&([isize; 3],)` diff --git a/src/test/ui/dst/dst-bad-coerce4.rs b/src/test/ui/dst/dst-bad-coerce4.rs index d1c590347ed..f63da60d281 100644 --- a/src/test/ui/dst/dst-bad-coerce4.rs +++ b/src/test/ui/dst/dst-bad-coerce4.rs @@ -11,15 +11,15 @@ pub fn main() { let f1: &Fat<[isize]> = &Fat { ptr: [1, 2, 3] }; let f2: &Fat<[isize; 3]> = f1; //~^ ERROR mismatched types + //~| expected array `[isize; 3]`, found slice `[isize]` //~| expected reference `&Fat<[isize; 3]>` //~| found reference `&Fat<[isize]>` - //~| expected array of 3 elements, found slice // Tuple with a vec of isizes. let f1: &([isize],) = &([1, 2, 3],); let f2: &([isize; 3],) = f1; //~^ ERROR mismatched types + //~| expected array `[isize; 3]`, found slice `[isize]` //~| expected reference `&([isize; 3],)` //~| found reference `&([isize],)` - //~| expected array of 3 elements, found slice } diff --git a/src/test/ui/dst/dst-bad-coerce4.stderr b/src/test/ui/dst/dst-bad-coerce4.stderr index fad34633da5..e85d354e468 100644 --- a/src/test/ui/dst/dst-bad-coerce4.stderr +++ b/src/test/ui/dst/dst-bad-coerce4.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/dst-bad-coerce4.rs:12:32 | LL | let f2: &Fat<[isize; 3]> = f1; - | ^^ expected array of 3 elements, found slice + | ^^ expected array `[isize; 3]`, found slice `[isize]` | = note: expected reference `&Fat<[isize; 3]>` found reference `&Fat<[isize]>` @@ -11,7 +11,7 @@ error[E0308]: mismatched types --> $DIR/dst-bad-coerce4.rs:20:30 | LL | let f2: &([isize; 3],) = f1; - | ^^ expected array of 3 elements, found slice + | ^^ expected array `[isize; 3]`, found slice `[isize]` | = note: expected reference `&([isize; 3],)` found reference `&([isize],)` diff --git a/src/test/ui/error-codes/E0070.stderr b/src/test/ui/error-codes/E0070.stderr index c77a337012d..779b6ea924c 100644 --- a/src/test/ui/error-codes/E0070.stderr +++ b/src/test/ui/error-codes/E0070.stderr @@ -15,9 +15,6 @@ error[E0308]: mismatched types | LL | some_other_func() = 4; | ^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error[E0070]: invalid left-hand side expression --> $DIR/E0070.rs:8:5 diff --git a/src/test/ui/error-codes/E0271.stderr b/src/test/ui/error-codes/E0271.stderr index 2f9191b4326..3ed2f6f0d23 100644 --- a/src/test/ui/error-codes/E0271.stderr +++ b/src/test/ui/error-codes/E0271.stderr @@ -5,10 +5,7 @@ LL | fn foo(t: T) where T: Trait { | --- ------------------ required by this bound in `foo` ... LL | foo(3_i8); - | ^^^ expected u32, found reference - | - = note: expected type `u32` - found reference `&'static str` + | ^^^ expected u32, found &str error: aborting due to previous error diff --git a/src/test/ui/estr-subtyping.stderr b/src/test/ui/estr-subtyping.stderr index 810c52a5706..108df4ae1c9 100644 --- a/src/test/ui/estr-subtyping.stderr +++ b/src/test/ui/estr-subtyping.stderr @@ -6,9 +6,6 @@ LL | wants_uniq(x); | | | expected struct `std::string::String`, found &str | help: try using a conversion method: `x.to_string()` - | - = note: expected struct `std::string::String` - found reference `&str` error: aborting due to previous error diff --git a/src/test/ui/float-literal-inference-restrictions.stderr b/src/test/ui/float-literal-inference-restrictions.stderr index 08513507ecf..ea4db564829 100644 --- a/src/test/ui/float-literal-inference-restrictions.stderr +++ b/src/test/ui/float-literal-inference-restrictions.stderr @@ -6,9 +6,6 @@ LL | let x: f32 = 1; | | | expected f32, found integer | help: use a float literal: `1.0` - | - = note: expected type `f32` - found type `{integer}` error[E0308]: mismatched types --> $DIR/float-literal-inference-restrictions.rs:3:18 diff --git a/src/test/ui/fully-qualified-type/fully-qualified-type-name2.rs b/src/test/ui/fully-qualified-type/fully-qualified-type-name2.rs index af4a633090b..94a9f4e5692 100644 --- a/src/test/ui/fully-qualified-type/fully-qualified-type-name2.rs +++ b/src/test/ui/fully-qualified-type/fully-qualified-type-name2.rs @@ -12,8 +12,6 @@ fn bar(x: x::Foo) -> y::Foo { return x; //~^ ERROR mismatched types //~| expected enum `y::Foo`, found enum `x::Foo` - //~| expected enum `y::Foo` - //~| found enum `x::Foo` } fn main() { diff --git a/src/test/ui/fully-qualified-type/fully-qualified-type-name2.stderr b/src/test/ui/fully-qualified-type/fully-qualified-type-name2.stderr index fe4579f49b9..aed7f72c660 100644 --- a/src/test/ui/fully-qualified-type/fully-qualified-type-name2.stderr +++ b/src/test/ui/fully-qualified-type/fully-qualified-type-name2.stderr @@ -5,9 +5,6 @@ LL | fn bar(x: x::Foo) -> y::Foo { | ------ expected `y::Foo` because of return type LL | return x; | ^ expected enum `y::Foo`, found enum `x::Foo` - | - = note: expected enum `y::Foo` - found enum `x::Foo` error: aborting due to previous error diff --git a/src/test/ui/hrtb/issue-62203-hrtb-ice.stderr b/src/test/ui/hrtb/issue-62203-hrtb-ice.stderr index 16847727aef..759c7302d13 100644 --- a/src/test/ui/hrtb/issue-62203-hrtb-ice.stderr +++ b/src/test/ui/hrtb/issue-62203-hrtb-ice.stderr @@ -15,8 +15,6 @@ error[E0271]: type mismatch resolving `<[closure@$DIR/issue-62203-hrtb-ice.rs:42 LL | let v = Unit2.m( | ^ expected struct `Unit4`, found struct `Unit3` | - = note: expected struct `Unit4` - found struct `Unit3` = note: required because of the requirements on the impl of `for<'r> T0<'r, (>::V,)>` for `L<[closure@$DIR/issue-62203-hrtb-ice.rs:42:17: 42:39]>` error: aborting due to 2 previous errors diff --git a/src/test/ui/if-else-type-mismatch.stderr b/src/test/ui/if-else-type-mismatch.stderr index d25eda0e980..6d36854545c 100644 --- a/src/test/ui/if-else-type-mismatch.stderr +++ b/src/test/ui/if-else-type-mismatch.stderr @@ -10,9 +10,6 @@ LL | | 2u32 | | ^^^^ expected i32, found u32 LL | | }; | |_____- if and else have incompatible types - | - = note: expected type `i32` - found type `u32` error[E0308]: if and else have incompatible types --> $DIR/if-else-type-mismatch.rs:8:38 @@ -21,9 +18,6 @@ LL | let _ = if true { 42i32 } else { 42u32 }; | ----- ^^^^^ expected i32, found u32 | | | expected because of this - | - = note: expected type `i32` - found type `u32` error[E0308]: if and else have incompatible types --> $DIR/if-else-type-mismatch.rs:13:9 @@ -40,9 +34,6 @@ LL | | 4u32 | | ^^^^ expected (), found u32 LL | | }; | |_____- if and else have incompatible types - | - = note: expected type `()` - found type `u32` error[E0308]: if and else have incompatible types --> $DIR/if-else-type-mismatch.rs:19:9 @@ -59,9 +50,6 @@ LL | | 6u32; | | expected u32, found () LL | | }; | |_____- if and else have incompatible types - | - = note: expected type `u32` - found unit type `()` error[E0308]: if and else have incompatible types --> $DIR/if-else-type-mismatch.rs:25:9 @@ -75,9 +63,6 @@ LL | | 8u32 | | ^^^^ expected (), found u32 LL | | }; | |_____- if and else have incompatible types - | - = note: expected type `()` - found type `u32` error[E0308]: if and else have incompatible types --> $DIR/if-else-type-mismatch.rs:31:9 @@ -91,9 +76,6 @@ LL | | 10u32; | | ^^^^^^ expected i32, found () LL | | }; | |_____- if and else have incompatible types - | - = note: expected type `i32` - found unit type `()` error[E0308]: if and else have incompatible types --> $DIR/if-else-type-mismatch.rs:37:9 @@ -105,9 +87,6 @@ LL | | } else { | |_____- expected because of this LL | 11u32 | ^^^^^ expected (), found u32 - | - = note: expected type `()` - found type `u32` error[E0308]: if and else have incompatible types --> $DIR/if-else-type-mismatch.rs:42:12 @@ -121,9 +100,6 @@ LL | } else { LL | | LL | | }; | |_____^ expected i32, found () - | - = note: expected type `i32` - found unit type `()` error: aborting due to 8 previous errors diff --git a/src/test/ui/if/if-branch-types.stderr b/src/test/ui/if/if-branch-types.stderr index 74b925f72ff..bfaae2d31a0 100644 --- a/src/test/ui/if/if-branch-types.stderr +++ b/src/test/ui/if/if-branch-types.stderr @@ -5,9 +5,6 @@ LL | let x = if true { 10i32 } else { 10u32 }; | ----- ^^^^^ expected i32, found u32 | | | expected because of this - | - = note: expected type `i32` - found type `u32` error: aborting due to previous error diff --git a/src/test/ui/if/if-let-arm-types.rs b/src/test/ui/if/if-let-arm-types.rs index 0f8815f0479..f120b60c611 100644 --- a/src/test/ui/if/if-let-arm-types.rs +++ b/src/test/ui/if/if-let-arm-types.rs @@ -8,5 +8,4 @@ fn main() { }; //~^^ ERROR: if and else have incompatible types //~| NOTE expected (), found integer - //~| NOTE expected type `()` } diff --git a/src/test/ui/if/if-let-arm-types.stderr b/src/test/ui/if/if-let-arm-types.stderr index ff88de20f76..088aa0e8554 100644 --- a/src/test/ui/if/if-let-arm-types.stderr +++ b/src/test/ui/if/if-let-arm-types.stderr @@ -11,9 +11,6 @@ LL | | 1 | | ^ expected (), found integer LL | | }; | |_____- if and else have incompatible types - | - = note: expected type `()` - found type `{integer}` error: aborting due to previous error diff --git a/src/test/ui/if/if-no-match-bindings.stderr b/src/test/ui/if/if-no-match-bindings.stderr index 215e236f6b0..add9ee86ac2 100644 --- a/src/test/ui/if/if-no-match-bindings.stderr +++ b/src/test/ui/if/if-no-match-bindings.stderr @@ -6,9 +6,6 @@ LL | if b_ref() {} | | | expected bool, found &bool | help: consider dereferencing the borrow: `*b_ref()` - | - = note: expected type `bool` - found reference `&bool` error[E0308]: mismatched types --> $DIR/if-no-match-bindings.rs:19:8 @@ -18,9 +15,6 @@ LL | if b_mut_ref() {} | | | expected bool, found &mut bool | help: consider dereferencing the borrow: `*b_mut_ref()` - | - = note: expected type `bool` - found mutable reference `&mut bool` error[E0308]: mismatched types --> $DIR/if-no-match-bindings.rs:20:8 @@ -30,9 +24,6 @@ LL | if &true {} | | | expected bool, found &bool | help: consider removing the borrow: `true` - | - = note: expected type `bool` - found reference `&bool` error[E0308]: mismatched types --> $DIR/if-no-match-bindings.rs:21:8 @@ -42,9 +33,6 @@ LL | if &mut true {} | | | expected bool, found &mut bool | help: consider removing the borrow: `true` - | - = note: expected type `bool` - found mutable reference `&mut bool` error[E0308]: mismatched types --> $DIR/if-no-match-bindings.rs:24:11 @@ -54,9 +42,6 @@ LL | while b_ref() {} | | | expected bool, found &bool | help: consider dereferencing the borrow: `*b_ref()` - | - = note: expected type `bool` - found reference `&bool` error[E0308]: mismatched types --> $DIR/if-no-match-bindings.rs:25:11 @@ -66,9 +51,6 @@ LL | while b_mut_ref() {} | | | expected bool, found &mut bool | help: consider dereferencing the borrow: `*b_mut_ref()` - | - = note: expected type `bool` - found mutable reference `&mut bool` error[E0308]: mismatched types --> $DIR/if-no-match-bindings.rs:26:11 @@ -78,9 +60,6 @@ LL | while &true {} | | | expected bool, found &bool | help: consider removing the borrow: `true` - | - = note: expected type `bool` - found reference `&bool` error[E0308]: mismatched types --> $DIR/if-no-match-bindings.rs:27:11 @@ -90,9 +69,6 @@ LL | while &mut true {} | | | expected bool, found &mut bool | help: consider removing the borrow: `true` - | - = note: expected type `bool` - found mutable reference `&mut bool` error: aborting due to 8 previous errors diff --git a/src/test/ui/if/if-without-else-as-fn-expr.stderr b/src/test/ui/if/if-without-else-as-fn-expr.stderr index a62a2cc1522..472c85d96fb 100644 --- a/src/test/ui/if/if-without-else-as-fn-expr.stderr +++ b/src/test/ui/if/if-without-else-as-fn-expr.stderr @@ -8,8 +8,6 @@ LL | | return 3; LL | | } | |_____^ expected usize, found () | - = note: expected type `usize` - found unit type `()` = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type @@ -24,8 +22,6 @@ LL | | return 3; LL | | }; | |_____^ expected usize, found () | - = note: expected type `usize` - found unit type `()` = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type @@ -39,8 +35,6 @@ LL | | 3 LL | | } | |_____^ expected usize, found () | - = note: expected type `usize` - found unit type `()` = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type @@ -54,8 +48,6 @@ LL | | return 3; LL | | } | |_____^ expected usize, found () | - = note: expected type `usize` - found unit type `()` = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type @@ -70,8 +62,6 @@ LL | | return 3; LL | | }; | |_____^ expected usize, found () | - = note: expected type `usize` - found unit type `()` = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type @@ -85,8 +75,6 @@ LL | | 3 LL | | } | |_____^ expected usize, found () | - = note: expected type `usize` - found unit type `()` = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type diff --git a/src/test/ui/if/if-without-else-result.rs b/src/test/ui/if/if-without-else-result.rs index 4602beb4c77..bd559733466 100644 --- a/src/test/ui/if/if-without-else-result.rs +++ b/src/test/ui/if/if-without-else-result.rs @@ -1,8 +1,6 @@ fn main() { let a = if true { true }; //~^ ERROR if may be missing an else clause [E0317] - //~| expected unit type `()` - //~| found type `bool` //~| expected (), found bool println!("{}", a); } diff --git a/src/test/ui/if/if-without-else-result.stderr b/src/test/ui/if/if-without-else-result.stderr index 7870439fee1..b2c700d3c8f 100644 --- a/src/test/ui/if/if-without-else-result.stderr +++ b/src/test/ui/if/if-without-else-result.stderr @@ -7,8 +7,6 @@ LL | let a = if true { true }; | | found here | expected (), found bool | - = note: expected unit type `()` - found type `bool` = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type diff --git a/src/test/ui/impl-trait/equality.stderr b/src/test/ui/impl-trait/equality.stderr index 7bb2d7d47a5..7349ab12cda 100644 --- a/src/test/ui/impl-trait/equality.stderr +++ b/src/test/ui/impl-trait/equality.stderr @@ -9,9 +9,6 @@ LL | return 1_i32; LL | } LL | 0_u32 | ^^^^^ expected i32, found u32 - | - = note: expected type `i32` - found type `u32` error[E0277]: cannot add `impl Foo` to `u32` --> $DIR/equality.rs:24:11 diff --git a/src/test/ui/include-macros/mismatched-types.stderr b/src/test/ui/include-macros/mismatched-types.stderr index 79f12356a6d..43d8ba1d7a3 100644 --- a/src/test/ui/include-macros/mismatched-types.stderr +++ b/src/test/ui/include-macros/mismatched-types.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/mismatched-types.rs:2:20 | LL | let b: &[u8] = include_str!("file.txt"); - | ^^^^^^^^^^^^^^^^^^^^^^^^ expected slice, found str + | ^^^^^^^^^^^^^^^^^^^^^^^^ expected slice `[u8]`, found str | = note: expected reference `&[u8]` found reference `&'static str` @@ -11,7 +11,7 @@ error[E0308]: mismatched types --> $DIR/mismatched-types.rs:3:19 | LL | let s: &str = include_bytes!("file.txt"); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected str, found array of 0 elements + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected str, found array `[u8; 0]` | = note: expected reference `&str` found reference `&'static [u8; 0]` diff --git a/src/test/ui/integral-variable-unification-error.rs b/src/test/ui/integral-variable-unification-error.rs index 3eefcdea3d9..5200b4a829d 100644 --- a/src/test/ui/integral-variable-unification-error.rs +++ b/src/test/ui/integral-variable-unification-error.rs @@ -2,7 +2,5 @@ fn main() { let mut x = 2; x = 5.0; //~^ ERROR mismatched types - //~| expected type `{integer}` - //~| found type `{float}` //~| expected integer, found floating-point number } diff --git a/src/test/ui/integral-variable-unification-error.stderr b/src/test/ui/integral-variable-unification-error.stderr index 262203b7b8e..b49bff1b0d8 100644 --- a/src/test/ui/integral-variable-unification-error.stderr +++ b/src/test/ui/integral-variable-unification-error.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | x = 5.0; | ^^^ expected integer, found floating-point number - | - = note: expected type `{integer}` - found type `{float}` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-11319.rs b/src/test/ui/issues/issue-11319.rs index 726c437355e..f40d0005161 100644 --- a/src/test/ui/issues/issue-11319.rs +++ b/src/test/ui/issues/issue-11319.rs @@ -8,7 +8,6 @@ fn main() { None => (), //~^ ERROR match arms have incompatible types //~| NOTE expected bool, found () - //~| NOTE expected type `bool` _ => true } } diff --git a/src/test/ui/issues/issue-11319.stderr b/src/test/ui/issues/issue-11319.stderr index 9abae68ed52..2ca49922d06 100644 --- a/src/test/ui/issues/issue-11319.stderr +++ b/src/test/ui/issues/issue-11319.stderr @@ -15,9 +15,6 @@ LL | | None => (), LL | | _ => true LL | | } | |_____- `match` arms have incompatible types - | - = note: expected type `bool` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-12997-2.stderr b/src/test/ui/issues/issue-12997-2.stderr index bac69075c83..102405cd0f6 100644 --- a/src/test/ui/issues/issue-12997-2.stderr +++ b/src/test/ui/issues/issue-12997-2.stderr @@ -2,10 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-12997-2.rs:8:1 | LL | fn bar(x: isize) { } - | ^^^^^^^^^^^^^^^^^^^^ expected isize, found mutable reference - | - = note: expected type `isize` - found mutable reference `&mut test::Bencher` + | ^^^^^^^^^^^^^^^^^^^^ expected isize, found &mut test::Bencher error: aborting due to previous error diff --git a/src/test/ui/issues/issue-13407.stderr b/src/test/ui/issues/issue-13407.stderr index 4c3e481564f..5a465cc533b 100644 --- a/src/test/ui/issues/issue-13407.stderr +++ b/src/test/ui/issues/issue-13407.stderr @@ -9,9 +9,6 @@ error[E0308]: mismatched types | LL | A::C = 1; | ^ expected struct `A::C`, found integer - | - = note: expected struct `A::C` - found type `{integer}` error[E0070]: invalid left-hand side expression --> $DIR/issue-13407.rs:6:5 diff --git a/src/test/ui/issues/issue-13446.stderr b/src/test/ui/issues/issue-13446.stderr index 80a32cd276a..13c35dd84f7 100644 --- a/src/test/ui/issues/issue-13446.stderr +++ b/src/test/ui/issues/issue-13446.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-13446.rs:3:26 | LL | static VEC: [u32; 256] = vec![]; - | ^^^^^^ expected array of 256 elements, found struct `std::vec::Vec` + | ^^^^^^ expected array `[u32; 256]`, found struct `std::vec::Vec` | = note: expected array `[u32; 256]` found struct `std::vec::Vec<_>` diff --git a/src/test/ui/issues/issue-14091.stderr b/src/test/ui/issues/issue-14091.stderr index 24a076624ed..bb9f843dadf 100644 --- a/src/test/ui/issues/issue-14091.stderr +++ b/src/test/ui/issues/issue-14091.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | assert!(1,1); | ^^^^^^^^^^^^^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-14541.rs b/src/test/ui/issues/issue-14541.rs index e8d44a4a9f8..555ec9f9868 100644 --- a/src/test/ui/issues/issue-14541.rs +++ b/src/test/ui/issues/issue-14541.rs @@ -5,8 +5,6 @@ fn make(v: Vec2) { let Vec3 { y: _, z: _ } = v; //~^ ERROR mismatched types //~| expected struct `Vec2`, found struct `Vec3` - //~| expected struct `Vec2` - //~| found struct `Vec3` } fn main() { } diff --git a/src/test/ui/issues/issue-14541.stderr b/src/test/ui/issues/issue-14541.stderr index e7cae883d6b..c5512e03007 100644 --- a/src/test/ui/issues/issue-14541.stderr +++ b/src/test/ui/issues/issue-14541.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | let Vec3 { y: _, z: _ } = v; | ^^^^^^^^^^^^^^^^^^^ expected struct `Vec2`, found struct `Vec3` - | - = note: expected struct `Vec2` - found struct `Vec3` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-15783.rs b/src/test/ui/issues/issue-15783.rs index 61cb0093b1c..0c1db02a8e6 100644 --- a/src/test/ui/issues/issue-15783.rs +++ b/src/test/ui/issues/issue-15783.rs @@ -9,6 +9,6 @@ fn main() { //~^ ERROR mismatched types //~| expected enum `std::option::Option<&[&str]>` //~| found enum `std::option::Option<&[&str; 1]>` - //~| expected slice, found array of 1 element + //~| expected slice `[&str]`, found array `[&str; 1]` assert_eq!(msg, 3); } diff --git a/src/test/ui/issues/issue-15783.stderr b/src/test/ui/issues/issue-15783.stderr index f60655b7a34..74a96df5b1b 100644 --- a/src/test/ui/issues/issue-15783.stderr +++ b/src/test/ui/issues/issue-15783.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-15783.rs:8:19 | LL | let msg = foo(x); - | ^ expected slice, found array of 1 element + | ^ expected slice `[&str]`, found array `[&str; 1]` | = note: expected enum `std::option::Option<&[&str]>` found enum `std::option::Option<&[&str; 1]>` diff --git a/src/test/ui/issues/issue-15896.rs b/src/test/ui/issues/issue-15896.rs index 1a0a7b4b8e6..a11c9d07f6f 100644 --- a/src/test/ui/issues/issue-15896.rs +++ b/src/test/ui/issues/issue-15896.rs @@ -11,8 +11,6 @@ fn main() { Tau{t: x}, //~^ ERROR mismatched types //~| expected enum `main::R`, found struct `main::Tau` - //~| expected enum `main::R` - //~| found struct `main::Tau` _) => x, }; } diff --git a/src/test/ui/issues/issue-15896.stderr b/src/test/ui/issues/issue-15896.stderr index a8227bb19c2..f553be9df55 100644 --- a/src/test/ui/issues/issue-15896.stderr +++ b/src/test/ui/issues/issue-15896.stderr @@ -6,9 +6,6 @@ LL | let u = match e { LL | E::B( LL | Tau{t: x}, | ^^^^^^^^^ expected enum `main::R`, found struct `main::Tau` - | - = note: expected enum `main::R` - found struct `main::Tau` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-17033.rs b/src/test/ui/issues/issue-17033.rs index c330745bc07..715892397a4 100644 --- a/src/test/ui/issues/issue-17033.rs +++ b/src/test/ui/issues/issue-17033.rs @@ -1,7 +1,5 @@ fn f<'r>(p: &'r mut fn(p: &mut ())) { (*p)(()) //~ ERROR mismatched types - //~| expected mutable reference `&mut ()` - //~| found unit type `()` //~| expected &mut (), found () } diff --git a/src/test/ui/issues/issue-17033.stderr b/src/test/ui/issues/issue-17033.stderr index 37f817c2e9b..4bdc806f717 100644 --- a/src/test/ui/issues/issue-17033.stderr +++ b/src/test/ui/issues/issue-17033.stderr @@ -6,9 +6,6 @@ LL | (*p)(()) | | | expected &mut (), found () | help: consider mutably borrowing here: `&mut ()` - | - = note: expected mutable reference `&mut ()` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-19991.rs b/src/test/ui/issues/issue-19991.rs index 1d8128ffcb9..e79a006afd9 100644 --- a/src/test/ui/issues/issue-19991.rs +++ b/src/test/ui/issues/issue-19991.rs @@ -3,8 +3,6 @@ fn main() { if let Some(homura) = Some("madoka") { //~ ERROR missing an else clause - //~| expected unit type `()` - //~| found type `{integer}` //~| expected (), found integer 765 }; diff --git a/src/test/ui/issues/issue-19991.stderr b/src/test/ui/issues/issue-19991.stderr index c808680ce61..d06c3acfd12 100644 --- a/src/test/ui/issues/issue-19991.stderr +++ b/src/test/ui/issues/issue-19991.stderr @@ -3,15 +3,11 @@ error[E0317]: if may be missing an else clause | LL | / if let Some(homura) = Some("madoka") { LL | | -LL | | -LL | | LL | | 765 | | --- found here LL | | }; | |_____^ expected (), found integer | - = note: expected unit type `()` - found type `{integer}` = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type diff --git a/src/test/ui/issues/issue-20225.rs b/src/test/ui/issues/issue-20225.rs index b15f2a631fd..0c8e6e402e2 100644 --- a/src/test/ui/issues/issue-20225.rs +++ b/src/test/ui/issues/issue-20225.rs @@ -5,13 +5,11 @@ struct Foo; impl<'a, T> Fn<(&'a T,)> for Foo { extern "rust-call" fn call(&self, (_,): (T,)) {} //~^ ERROR: has an incompatible type for trait - //~| expected reference } impl<'a, T> FnMut<(&'a T,)> for Foo { extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {} //~^ ERROR: has an incompatible type for trait - //~| expected reference } impl<'a, T> FnOnce<(&'a T,)> for Foo { @@ -19,7 +17,6 @@ impl<'a, T> FnOnce<(&'a T,)> for Foo { extern "rust-call" fn call_once(self, (_,): (T,)) {} //~^ ERROR: has an incompatible type for trait - //~| expected reference } fn main() {} diff --git a/src/test/ui/issues/issue-20225.stderr b/src/test/ui/issues/issue-20225.stderr index 63b0451e01a..baee8b96799 100644 --- a/src/test/ui/issues/issue-20225.stderr +++ b/src/test/ui/issues/issue-20225.stderr @@ -4,7 +4,7 @@ error[E0053]: method `call` has an incompatible type for trait LL | impl<'a, T> Fn<(&'a T,)> for Foo { | - this type parameter LL | extern "rust-call" fn call(&self, (_,): (T,)) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected reference, found type parameter `T` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected &T, found type parameter `T` | = note: expected fn pointer `extern "rust-call" fn(&Foo, (&'a T,))` found fn pointer `extern "rust-call" fn(&Foo, (T,))` @@ -12,12 +12,12 @@ LL | extern "rust-call" fn call(&self, (_,): (T,)) {} = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters error[E0053]: method `call_mut` has an incompatible type for trait - --> $DIR/issue-20225.rs:12:3 + --> $DIR/issue-20225.rs:11:3 | LL | impl<'a, T> FnMut<(&'a T,)> for Foo { | - this type parameter LL | extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected reference, found type parameter `T` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected &T, found type parameter `T` | = note: expected fn pointer `extern "rust-call" fn(&mut Foo, (&'a T,))` found fn pointer `extern "rust-call" fn(&mut Foo, (T,))` @@ -25,13 +25,13 @@ LL | extern "rust-call" fn call_mut(&mut self, (_,): (T,)) {} = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters error[E0053]: method `call_once` has an incompatible type for trait - --> $DIR/issue-20225.rs:20:3 + --> $DIR/issue-20225.rs:18:3 | LL | impl<'a, T> FnOnce<(&'a T,)> for Foo { | - this type parameter ... LL | extern "rust-call" fn call_once(self, (_,): (T,)) {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected reference, found type parameter `T` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected &T, found type parameter `T` | = note: expected fn pointer `extern "rust-call" fn(Foo, (&'a T,))` found fn pointer `extern "rust-call" fn(Foo, (T,))` diff --git a/src/test/ui/issues/issue-22684.stderr b/src/test/ui/issues/issue-22684.stderr index 20a0d6f4103..3c6d3df7fae 100644 --- a/src/test/ui/issues/issue-22684.stderr +++ b/src/test/ui/issues/issue-22684.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | let _: () = foo::Foo.bar(); | ^^^^^^^^^^^^^^ expected (), found bool - | - = note: expected unit type `()` - found type `bool` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-23589.stderr b/src/test/ui/issues/issue-23589.stderr index 8d58095ceff..a36b380b9c1 100644 --- a/src/test/ui/issues/issue-23589.stderr +++ b/src/test/ui/issues/issue-23589.stderr @@ -12,9 +12,6 @@ error[E0308]: mismatched types | LL | let v: Vec(&str) = vec!['1', '2']; | ^^^ expected &str, found char - | - = note: expected reference `&str` - found type `char` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-27008.rs b/src/test/ui/issues/issue-27008.rs index 3b271a2a35b..1a08647358c 100644 --- a/src/test/ui/issues/issue-27008.rs +++ b/src/test/ui/issues/issue-27008.rs @@ -4,6 +4,4 @@ fn main() { let b = [0; S]; //~^ ERROR mismatched types //~| expected usize, found struct `S` - //~| expected type `usize` - //~| found struct `S` } diff --git a/src/test/ui/issues/issue-27008.stderr b/src/test/ui/issues/issue-27008.stderr index 598ee741a5c..2c9eed0b3a5 100644 --- a/src/test/ui/issues/issue-27008.stderr +++ b/src/test/ui/issues/issue-27008.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | let b = [0; S]; | ^ expected usize, found struct `S` - | - = note: expected type `usize` - found struct `S` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-27042.stderr b/src/test/ui/issues/issue-27042.stderr index 4244f36e481..e379b23a595 100644 --- a/src/test/ui/issues/issue-27042.stderr +++ b/src/test/ui/issues/issue-27042.stderr @@ -16,9 +16,6 @@ LL | loop { break }; | | | expected i32, found () | help: give it a value of the expected type: `break 42` - | - = note: expected type `i32` - found unit type `()` error[E0308]: mismatched types --> $DIR/issue-27042.rs:8:9 @@ -27,9 +24,6 @@ LL | / 'b: LL | | LL | | while true { break }; // but here we cite the whole loop | |____________________________^ expected i32, found () - | - = note: expected type `i32` - found unit type `()` error[E0308]: mismatched types --> $DIR/issue-27042.rs:12:9 @@ -37,9 +31,6 @@ error[E0308]: mismatched types LL | / 'c: LL | | for _ in None { break }; // but here we cite the whole loop | |_______________________________^ expected i32, found () - | - = note: expected type `i32` - found unit type `()` error[E0308]: mismatched types --> $DIR/issue-27042.rs:15:9 @@ -47,9 +38,6 @@ error[E0308]: mismatched types LL | / 'd: LL | | while let Some(_) = None { break }; | |__________________________________________^ expected i32, found () - | - = note: expected type `i32` - found unit type `()` error: aborting due to 4 previous errors diff --git a/src/test/ui/issues/issue-29084.rs b/src/test/ui/issues/issue-29084.rs index 4710a594b31..c4c6b6f8183 100644 --- a/src/test/ui/issues/issue-29084.rs +++ b/src/test/ui/issues/issue-29084.rs @@ -4,8 +4,6 @@ macro_rules! foo { bar(&mut $d); //~^ ERROR mismatched types //~| expected u8, found &mut u8 - //~| expected type `u8` - //~| found mutable reference `&mut u8` }} } diff --git a/src/test/ui/issues/issue-29084.stderr b/src/test/ui/issues/issue-29084.stderr index 0a238761fc6..a91033e3360 100644 --- a/src/test/ui/issues/issue-29084.stderr +++ b/src/test/ui/issues/issue-29084.stderr @@ -6,9 +6,6 @@ LL | bar(&mut $d); ... LL | foo!(0u8); | ---------- in this macro invocation - | - = note: expected type `u8` - found mutable reference `&mut u8` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-30225.stderr b/src/test/ui/issues/issue-30225.stderr index 27a567548ba..ccd05fa6bfb 100644 --- a/src/test/ui/issues/issue-30225.stderr +++ b/src/test/ui/issues/issue-30225.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | u = v; // mark $0 and $1 in a subtype relationship | ^ expected struct `A`, found struct `B` - | - = note: expected struct `A` - found struct `B` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-33504.stderr b/src/test/ui/issues/issue-33504.stderr index 758f86d3db8..522df6a07c2 100644 --- a/src/test/ui/issues/issue-33504.stderr +++ b/src/test/ui/issues/issue-33504.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | let Test = 1; | ^^^^ expected integer, found struct `Test` - | - = note: expected type `{integer}` - found struct `Test` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-37026.stderr b/src/test/ui/issues/issue-37026.stderr index 00e44738742..5613d3f1766 100644 --- a/src/test/ui/issues/issue-37026.stderr +++ b/src/test/ui/issues/issue-37026.stderr @@ -3,18 +3,12 @@ error[E0308]: mismatched types | LL | let empty_struct::XEmpty2 = (); | ^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `empty_struct::XEmpty2` - | - = note: expected unit type `()` - found struct `empty_struct::XEmpty2` error[E0308]: mismatched types --> $DIR/issue-37026.rs:7:9 | LL | let empty_struct::XEmpty6(..) = (); | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `empty_struct::XEmpty6` - | - = note: expected unit type `()` - found struct `empty_struct::XEmpty6` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-37665.stderr b/src/test/ui/issues/issue-37665.stderr index e7eef47fd29..f872557966b 100644 --- a/src/test/ui/issues/issue-37665.stderr +++ b/src/test/ui/issues/issue-37665.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | let x: () = 0; | ^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-39970.stderr b/src/test/ui/issues/issue-39970.stderr index 7cef2e6cd4c..b758cccd8f7 100644 --- a/src/test/ui/issues/issue-39970.stderr +++ b/src/test/ui/issues/issue-39970.stderr @@ -7,8 +7,6 @@ LL | fn visit() {} LL | <() as Visit>::visit(); | ^^^^^^^^^^^^^^^^^^^^ expected &(), found () | - = note: expected reference `&()` - found unit type `()` = note: required because of the requirements on the impl of `Visit` for `()` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-41549.stderr b/src/test/ui/issues/issue-41549.stderr index c2ffc2f4ac3..6d2ef769a16 100644 --- a/src/test/ui/issues/issue-41549.stderr +++ b/src/test/ui/issues/issue-41549.stderr @@ -3,9 +3,6 @@ error[E0326]: implemented const `CONST` has an incompatible type for trait | LL | const CONST: () = (); | ^^ expected u32, found () - | - = note: expected type `u32` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-41742.stderr b/src/test/ui/issues/issue-41742.stderr index a1dae867ae6..d6e2146208e 100644 --- a/src/test/ui/issues/issue-41742.stderr +++ b/src/test/ui/issues/issue-41742.stderr @@ -2,10 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-41742.rs:24:7 | LL | H["?"].f(); - | ^^^ expected u32, found reference - | - = note: expected type `u32` - found reference `&'static str` + | ^^^ expected u32, found &str error: aborting due to previous error diff --git a/src/test/ui/issues/issue-4201.rs b/src/test/ui/issues/issue-4201.rs index d4ac39526dd..ba4e9f6fa98 100644 --- a/src/test/ui/issues/issue-4201.rs +++ b/src/test/ui/issues/issue-4201.rs @@ -3,8 +3,6 @@ fn main() { 0 } else if false { //~^ ERROR if may be missing an else clause -//~| expected unit type `()` -//~| found type `{integer}` //~| expected (), found integer 1 }; diff --git a/src/test/ui/issues/issue-4201.stderr b/src/test/ui/issues/issue-4201.stderr index 8abb7c3c9f5..5ea4fdbf7ec 100644 --- a/src/test/ui/issues/issue-4201.stderr +++ b/src/test/ui/issues/issue-4201.stderr @@ -5,15 +5,11 @@ LL | } else if false { | ____________^ LL | | LL | | -LL | | -LL | | LL | | 1 | | - found here LL | | }; | |_____^ expected (), found integer | - = note: expected unit type `()` - found type `{integer}` = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type diff --git a/src/test/ui/issues/issue-43162.stderr b/src/test/ui/issues/issue-43162.stderr index 259b47ebe7c..76696873f4e 100644 --- a/src/test/ui/issues/issue-43162.stderr +++ b/src/test/ui/issues/issue-43162.stderr @@ -20,9 +20,6 @@ LL | fn foo() -> bool { LL | LL | break true; | - help: consider removing this semicolon - | - = note: expected type `bool` - found unit type `()` error: aborting due to 3 previous errors diff --git a/src/test/ui/issues/issue-43420-no-over-suggest.stderr b/src/test/ui/issues/issue-43420-no-over-suggest.stderr index 4d61788c347..27aebc548e1 100644 --- a/src/test/ui/issues/issue-43420-no-over-suggest.stderr +++ b/src/test/ui/issues/issue-43420-no-over-suggest.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-43420-no-over-suggest.rs:8:9 | LL | foo(&a); - | ^^ expected slice, found struct `std::vec::Vec` + | ^^ expected slice `[u16]`, found struct `std::vec::Vec` | = note: expected reference `&[u16]` found reference `&std::vec::Vec` diff --git a/src/test/ui/issues/issue-44023.stderr b/src/test/ui/issues/issue-44023.stderr index c7b5f7b2040..a55bb229869 100644 --- a/src/test/ui/issues/issue-44023.stderr +++ b/src/test/ui/issues/issue-44023.stderr @@ -5,9 +5,6 @@ LL | fn საჭმელად_გემრიელი_სადილი ( ) | ------------------------ ^^^^^ expected isize, found () | | | implicitly returns `()` as its body has no tail or `return` expression - | - = note: expected type `isize` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-4517.rs b/src/test/ui/issues/issue-4517.rs index 569fdc1662a..df3da04f2e8 100644 --- a/src/test/ui/issues/issue-4517.rs +++ b/src/test/ui/issues/issue-4517.rs @@ -4,7 +4,5 @@ fn main() { let foo: [u8; 4] = [1; 4]; bar(foo); //~^ ERROR mismatched types - //~| expected type `usize` - //~| found array `[u8; 4]` - //~| expected usize, found array of 4 elements + //~| expected usize, found array `[u8; 4]` } diff --git a/src/test/ui/issues/issue-4517.stderr b/src/test/ui/issues/issue-4517.stderr index 0f45e91d6f5..6c5495484b3 100644 --- a/src/test/ui/issues/issue-4517.stderr +++ b/src/test/ui/issues/issue-4517.stderr @@ -2,10 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-4517.rs:5:9 | LL | bar(foo); - | ^^^ expected usize, found array of 4 elements - | - = note: expected type `usize` - found array `[u8; 4]` + | ^^^ expected usize, found array `[u8; 4]` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-46302.stderr b/src/test/ui/issues/issue-46302.stderr index 221d4b6d67f..073abdfefdc 100644 --- a/src/test/ui/issues/issue-46302.stderr +++ b/src/test/ui/issues/issue-46302.stderr @@ -6,9 +6,6 @@ LL | let u: &str = if true { s[..2] } else { s }; | | | expected &str, found str | help: consider borrowing here: `&s[..2]` - | - = note: expected reference `&str` - found type `str` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-46756-consider-borrowing-cast-or-binexpr.stderr b/src/test/ui/issues/issue-46756-consider-borrowing-cast-or-binexpr.stderr index dd6bef5c102..7e356ba1c11 100644 --- a/src/test/ui/issues/issue-46756-consider-borrowing-cast-or-binexpr.stderr +++ b/src/test/ui/issues/issue-46756-consider-borrowing-cast-or-binexpr.stderr @@ -6,9 +6,6 @@ LL | light_flows_our_war_of_mocking_words(behold as usize); | | | expected &usize, found usize | help: consider borrowing here: `&(behold as usize)` - | - = note: expected reference `&usize` - found type `usize` error[E0308]: mismatched types --> $DIR/issue-46756-consider-borrowing-cast-or-binexpr.rs:14:42 @@ -18,9 +15,6 @@ LL | light_flows_our_war_of_mocking_words(with_tears + 4); | | | expected &usize, found usize | help: consider borrowing here: `&(with_tears + 4)` - | - = note: expected reference `&usize` - found type `usize` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-47486.stderr b/src/test/ui/issues/issue-47486.stderr index 2b49c273330..9237b93924a 100644 --- a/src/test/ui/issues/issue-47486.stderr +++ b/src/test/ui/issues/issue-47486.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | () < std::mem::size_of::<_>(); | ^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found usize - | - = note: expected unit type `()` - found type `usize` error[E0282]: type annotations needed --> $DIR/issue-47486.rs:3:11 diff --git a/src/test/ui/issues/issue-48364.stderr b/src/test/ui/issues/issue-48364.stderr index 4e4e0e7ed94..4fc534d59c8 100644 --- a/src/test/ui/issues/issue-48364.stderr +++ b/src/test/ui/issues/issue-48364.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-48364.rs:2:21 | LL | b"".starts_with(stringify!(foo)) - | ^^^^^^^^^^^^^^^ expected slice, found str + | ^^^^^^^^^^^^^^^ expected slice `[u8]`, found str | = note: expected reference `&[u8]` found reference `&'static str` diff --git a/src/test/ui/issues/issue-50577.stderr b/src/test/ui/issues/issue-50577.stderr index bcc2fc50099..2494bf7471b 100644 --- a/src/test/ui/issues/issue-50577.stderr +++ b/src/test/ui/issues/issue-50577.stderr @@ -31,8 +31,6 @@ LL | Drop = assert_eq!(1, 1) | expected (), found isize | found here | - = note: expected unit type `()` - found type `isize` = note: `if` expressions without `else` evaluate to `()` = help: consider adding an `else` block that evaluates to the expected type = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) diff --git a/src/test/ui/issues/issue-50585.stderr b/src/test/ui/issues/issue-50585.stderr index d2a21c48a09..9f60db91731 100644 --- a/src/test/ui/issues/issue-50585.stderr +++ b/src/test/ui/issues/issue-50585.stderr @@ -9,9 +9,6 @@ error[E0308]: mismatched types | LL | |y: Vec<[(); for x in 0..2 {}]>| {}; | ^^^^^^^^^^^^^^^^ expected usize, found () - | - = note: expected type `usize` - found unit type `()` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-53348.rs b/src/test/ui/issues/issue-53348.rs index 83e5ddc4826..e453b0cfaa8 100644 --- a/src/test/ui/issues/issue-53348.rs +++ b/src/test/ui/issues/issue-53348.rs @@ -10,7 +10,6 @@ fn main() { a = *i.to_string(); //~^ ERROR mismatched types //~| NOTE expected struct `std::string::String`, found str - //~| NOTE expected struct v2.push(a); } } diff --git a/src/test/ui/issues/issue-53348.stderr b/src/test/ui/issues/issue-53348.stderr index 949d9a2f47d..2c117f52a26 100644 --- a/src/test/ui/issues/issue-53348.stderr +++ b/src/test/ui/issues/issue-53348.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | a = *i.to_string(); | ^^^^^^^^^^^^^^ expected struct `std::string::String`, found str - | - = note: expected struct `std::string::String` - found type `str` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-53692.stderr b/src/test/ui/issues/issue-53692.stderr index e3f2cb8c410..8dc5c95b9b1 100644 --- a/src/test/ui/issues/issue-53692.stderr +++ b/src/test/ui/issues/issue-53692.stderr @@ -18,9 +18,6 @@ LL | let string: String = s.clone(); | | | expected struct `std::string::String`, found &str | help: try using a conversion method: `s.to_string()` - | - = note: expected struct `std::string::String` - found reference `&str` error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-56943.stderr b/src/test/ui/issues/issue-56943.stderr index fc6370b2d31..7fd124046dc 100644 --- a/src/test/ui/issues/issue-56943.stderr +++ b/src/test/ui/issues/issue-56943.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | let _: issue_56943::S = issue_56943::S2; | ^^^^^^^^^^^^^^^ expected struct `issue_56943::S`, found struct `issue_56943::S2` - | - = note: expected struct `issue_56943::S` - found struct `issue_56943::S2` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-61106.stderr b/src/test/ui/issues/issue-61106.stderr index 8690ff4731f..c8439ee18f4 100644 --- a/src/test/ui/issues/issue-61106.stderr +++ b/src/test/ui/issues/issue-61106.stderr @@ -6,9 +6,6 @@ LL | foo(x.clone()); | | | expected &str, found struct `std::string::String` | help: consider borrowing here: `&x` - | - = note: expected reference `&str` - found struct `std::string::String` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-61882.stderr b/src/test/ui/issues/issue-61882.stderr index dbdb14d7160..86cc48aff06 100644 --- a/src/test/ui/issues/issue-61882.stderr +++ b/src/test/ui/issues/issue-61882.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | const B: A = Self(0); | ^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error[E0308]: mismatched types --> $DIR/issue-61882.rs:4:22 diff --git a/src/test/ui/issues/issue-7061.stderr b/src/test/ui/issues/issue-7061.stderr index 223cc48c7dd..b498ff0b534 100644 --- a/src/test/ui/issues/issue-7061.stderr +++ b/src/test/ui/issues/issue-7061.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/issue-7061.rs:4:46 | LL | fn foo(&'a mut self) -> Box { self } - | -------------- ^^^^ expected struct `std::boxed::Box`, found mutable reference + | -------------- ^^^^ expected struct `std::boxed::Box`, found &mut BarStruct | | | expected `std::boxed::Box` because of return type | diff --git a/src/test/ui/json-bom-plus-crlf-multifile.stderr b/src/test/ui/json-bom-plus-crlf-multifile.stderr index 5d631d576c7..c1cc57ab511 100644 --- a/src/test/ui/json-bom-plus-crlf-multifile.stderr +++ b/src/test/ui/json-bom-plus-crlf-multifile.stderr @@ -15,8 +15,7 @@ let x: i32 = \"I am not a number!\"; // | // type `i32` assigned to variable `x` ``` -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `std::string::String` - found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:17:22: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:17:22: error[E0308]: mismatched types "} {"message":"mismatched types","code":{"code":"E0308","explanation":"This error occurs when the compiler was unable to infer the concrete type of a variable. It can occur for several cases, the most common of which is a @@ -35,8 +34,7 @@ let x: i32 = \"I am not a number!\"; // | // type `i32` assigned to variable `x` ``` -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `std::string::String` - found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:19:22: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:19:22: error[E0308]: mismatched types "} {"message":"mismatched types","code":{"code":"E0308","explanation":"This error occurs when the compiler was unable to infer the concrete type of a variable. It can occur for several cases, the most common of which is a @@ -55,8 +53,7 @@ let x: i32 = \"I am not a number!\"; // | // type `i32` assigned to variable `x` ``` -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `std::string::String` - found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:23:1: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:23:1: error[E0308]: mismatched types "} {"message":"mismatched types","code":{"code":"E0308","explanation":"This error occurs when the compiler was unable to infer the concrete type of a variable. It can occur for several cases, the most common of which is a @@ -75,8 +72,7 @@ let x: i32 = \"I am not a number!\"; // | // type `i32` assigned to variable `x` ``` -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":801,"byte_end":809,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":" let s : String = (","highlight_start":22,"highlight_end":23},{"text":" ); // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `std::string::String`, found ()","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `std::string::String` -found unit type `()`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:25:22: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":801,"byte_end":809,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":" let s : String = (","highlight_start":22,"highlight_end":23},{"text":" ); // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `std::string::String`, found ()","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:25:22: error[E0308]: mismatched types "} {"message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors "} diff --git a/src/test/ui/json-bom-plus-crlf.stderr b/src/test/ui/json-bom-plus-crlf.stderr index a9c3ae4795d..581605ca5bb 100644 --- a/src/test/ui/json-bom-plus-crlf.stderr +++ b/src/test/ui/json-bom-plus-crlf.stderr @@ -15,8 +15,7 @@ let x: i32 = \"I am not a number!\"; // | // type `i32` assigned to variable `x` ``` -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `std::string::String` - found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:17:22: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":621,"byte_end":622,"line_start":17,"line_end":17,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1; // Error in the middle of line.","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:17:22: error[E0308]: mismatched types "} {"message":"mismatched types","code":{"code":"E0308","explanation":"This error occurs when the compiler was unable to infer the concrete type of a variable. It can occur for several cases, the most common of which is a @@ -35,8 +34,7 @@ let x: i32 = \"I am not a number!\"; // | // type `i32` assigned to variable `x` ``` -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `std::string::String` - found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:19:22: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":681,"byte_end":682,"line_start":19,"line_end":19,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":" let s : String = 1","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:19:22: error[E0308]: mismatched types "} {"message":"mismatched types","code":{"code":"E0308","explanation":"This error occurs when the compiler was unable to infer the concrete type of a variable. It can occur for several cases, the most common of which is a @@ -55,8 +53,7 @@ let x: i32 = \"I am not a number!\"; // | // type `i32` assigned to variable `x` ``` -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `std::string::String` - found type `{integer}`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:23:1: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":"expected struct `std::string::String`, found integer","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a conversion method","code":null,"level":"help","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":745,"byte_end":746,"line_start":23,"line_end":23,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"1; // Error after the newline.","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":"1.to_string()","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:23:1: error[E0308]: mismatched types "} {"message":"mismatched types","code":{"code":"E0308","explanation":"This error occurs when the compiler was unable to infer the concrete type of a variable. It can occur for several cases, the most common of which is a @@ -75,8 +72,7 @@ let x: i32 = \"I am not a number!\"; // | // type `i32` assigned to variable `x` ``` -"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":801,"byte_end":809,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":" let s : String = (","highlight_start":22,"highlight_end":23},{"text":" ); // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `std::string::String`, found ()","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `std::string::String` -found unit type `()`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:25:22: error[E0308]: mismatched types +"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":801,"byte_end":809,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":" let s : String = (","highlight_start":22,"highlight_end":23},{"text":" ); // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `std::string::String`, found ()","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"$DIR/json-bom-plus-crlf.rs:25:22: error[E0308]: mismatched types "} {"message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors "} diff --git a/src/test/ui/keyword/keyword-false-as-identifier.stderr b/src/test/ui/keyword/keyword-false-as-identifier.stderr index 95446045998..7774349b75a 100644 --- a/src/test/ui/keyword/keyword-false-as-identifier.stderr +++ b/src/test/ui/keyword/keyword-false-as-identifier.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | let false = 22; | ^^^^^ expected integer, found bool - | - = note: expected type `{integer}` - found type `bool` error: aborting due to previous error diff --git a/src/test/ui/keyword/keyword-true-as-identifier.stderr b/src/test/ui/keyword/keyword-true-as-identifier.stderr index 36b1d882a34..b2c2fc744c3 100644 --- a/src/test/ui/keyword/keyword-true-as-identifier.stderr +++ b/src/test/ui/keyword/keyword-true-as-identifier.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | let true = 22; | ^^^^ expected integer, found bool - | - = note: expected type `{integer}` - found type `bool` error: aborting due to previous error diff --git a/src/test/ui/liveness/liveness-closure-require-ret.stderr b/src/test/ui/liveness/liveness-closure-require-ret.stderr index 3885341e7b3..db330c2f354 100644 --- a/src/test/ui/liveness/liveness-closure-require-ret.stderr +++ b/src/test/ui/liveness/liveness-closure-require-ret.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | fn main() { println!("{}", force(|| {})); } | ^^ expected isize, found () - | - = note: expected type `isize` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/liveness/liveness-forgot-ret.stderr b/src/test/ui/liveness/liveness-forgot-ret.stderr index 201f90c6412..6b7bd1acdc7 100644 --- a/src/test/ui/liveness/liveness-forgot-ret.stderr +++ b/src/test/ui/liveness/liveness-forgot-ret.stderr @@ -5,9 +5,6 @@ LL | fn f(a: isize) -> isize { if god_exists(a) { return 5; }; } | - ^^^^^ expected isize, found () | | | implicitly returns `()` as its body has no tail or `return` expression - | - = note: expected type `isize` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/liveness/liveness-issue-2163.stderr b/src/test/ui/liveness/liveness-issue-2163.stderr index 738811adedb..7606413f15e 100644 --- a/src/test/ui/liveness/liveness-issue-2163.stderr +++ b/src/test/ui/liveness/liveness-issue-2163.stderr @@ -6,9 +6,6 @@ LL | a.iter().all(|_| -> bool { LL | | LL | | }); | |_____^ expected bool, found () - | - = note: expected type `bool` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/liveness/liveness-missing-ret2.stderr b/src/test/ui/liveness/liveness-missing-ret2.stderr index 9825ecce403..499dbf10ede 100644 --- a/src/test/ui/liveness/liveness-missing-ret2.stderr +++ b/src/test/ui/liveness/liveness-missing-ret2.stderr @@ -5,9 +5,6 @@ LL | fn f() -> isize { | - ^^^^^ expected isize, found () | | | implicitly returns `()` as its body has no tail or `return` expression - | - = note: expected type `isize` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/liveness/liveness-return-last-stmt-semi.stderr b/src/test/ui/liveness/liveness-return-last-stmt-semi.stderr index 4255f55a4ec..93249fd5aff 100644 --- a/src/test/ui/liveness/liveness-return-last-stmt-semi.stderr +++ b/src/test/ui/liveness/liveness-return-last-stmt-semi.stderr @@ -9,9 +9,6 @@ LL | macro_rules! test { () => { fn foo() -> i32 { 1; } } } ... LL | test!(); | -------- in this macro invocation - | - = note: expected type `i32` - found unit type `()` error[E0308]: mismatched types --> $DIR/liveness-return-last-stmt-semi.rs:7:19 @@ -20,9 +17,6 @@ LL | fn no_return() -> i32 {} | --------- ^^^ expected i32, found () | | | implicitly returns `()` as its body has no tail or `return` expression - | - = note: expected type `i32` - found unit type `()` error[E0308]: mismatched types --> $DIR/liveness-return-last-stmt-semi.rs:9:19 @@ -33,9 +27,6 @@ LL | fn bar(x: u32) -> u32 { | implicitly returns `()` as its body has no tail or `return` expression LL | x * 2; | - help: consider removing this semicolon - | - = note: expected type `u32` - found unit type `()` error[E0308]: mismatched types --> $DIR/liveness-return-last-stmt-semi.rs:13:19 @@ -44,9 +35,6 @@ LL | fn baz(x: u64) -> u32 { | --- ^^^ expected u32, found () | | | implicitly returns `()` as its body has no tail or `return` expression - | - = note: expected type `u32` - found unit type `()` error: aborting due to 4 previous errors diff --git a/src/test/ui/loops/loop-break-value.stderr b/src/test/ui/loops/loop-break-value.stderr index 8a049ac0023..4588b7b02bb 100644 --- a/src/test/ui/loops/loop-break-value.stderr +++ b/src/test/ui/loops/loop-break-value.stderr @@ -108,36 +108,24 @@ error[E0308]: mismatched types | LL | break 123; | ^^^ expected &str, found integer - | - = note: expected type `&str` - found type `{integer}` error[E0308]: mismatched types --> $DIR/loop-break-value.rs:16:15 | LL | break "asdf"; - | ^^^^^^ expected i32, found reference - | - = note: expected type `i32` - found reference `&'static str` + | ^^^^^^ expected i32, found &str error[E0308]: mismatched types --> $DIR/loop-break-value.rs:21:31 | LL | break 'outer_loop "nope"; - | ^^^^^^ expected i32, found reference - | - = note: expected type `i32` - found reference `&'static str` + | ^^^^^^ expected i32, found &str error[E0308]: mismatched types --> $DIR/loop-break-value.rs:73:26 | LL | break 'c 123; | ^^^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error[E0308]: mismatched types --> $DIR/loop-break-value.rs:80:15 @@ -153,9 +141,6 @@ error[E0308]: mismatched types | LL | break 2; | ^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error[E0308]: mismatched types --> $DIR/loop-break-value.rs:90:9 @@ -165,9 +150,6 @@ LL | break; | | | expected integer, found () | help: give it a value of the expected type: `break value` - | - = note: expected type `{integer}` - found unit type `()` error: aborting due to 16 previous errors diff --git a/src/test/ui/loops/loop-labeled-break-value.stderr b/src/test/ui/loops/loop-labeled-break-value.stderr index e34e7f4e956..c3d0ae28f74 100644 --- a/src/test/ui/loops/loop-labeled-break-value.stderr +++ b/src/test/ui/loops/loop-labeled-break-value.stderr @@ -6,9 +6,6 @@ LL | let _: i32 = loop { break }; | | | expected i32, found () | help: give it a value of the expected type: `break 42` - | - = note: expected type `i32` - found unit type `()` error[E0308]: mismatched types --> $DIR/loop-labeled-break-value.rs:6:37 @@ -18,9 +15,6 @@ LL | let _: i32 = 'inner: loop { break 'inner }; | | | expected i32, found () | help: give it a value of the expected type: `break 'inner 42` - | - = note: expected type `i32` - found unit type `()` error[E0308]: mismatched types --> $DIR/loop-labeled-break-value.rs:9:45 @@ -30,9 +24,6 @@ LL | let _: i32 = 'inner2: loop { loop { break 'inner2 } }; | | | expected i32, found () | help: give it a value of the expected type: `break 'inner2 42` - | - = note: expected type `i32` - found unit type `()` error: aborting due to 3 previous errors diff --git a/src/test/ui/loops/loop-properly-diverging-2.stderr b/src/test/ui/loops/loop-properly-diverging-2.stderr index 41027dc3ad6..9b4329ded18 100644 --- a/src/test/ui/loops/loop-properly-diverging-2.stderr +++ b/src/test/ui/loops/loop-properly-diverging-2.stderr @@ -6,9 +6,6 @@ LL | let x: i32 = loop { break }; | | | expected i32, found () | help: give it a value of the expected type: `break 42` - | - = note: expected type `i32` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/match/match-arm-resolving-to-never.stderr b/src/test/ui/match/match-arm-resolving-to-never.stderr index f717cf4ea75..4598b512f1d 100644 --- a/src/test/ui/match/match-arm-resolving-to-never.stderr +++ b/src/test/ui/match/match-arm-resolving-to-never.stderr @@ -9,12 +9,10 @@ LL | | E::D => 4, LL | | E::E => unimplemented!(""), | | ------------------ this and all prior arms are found to be of type `{integer}` LL | | E::F => "", - | | ^^ expected integer, found reference + | | ^^ expected integer, found &str LL | | }; | |_____- `match` arms have incompatible types | - = note: expected type `{integer}` - found reference `&'static str` = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/match/match-range-fail.rs b/src/test/ui/match/match-range-fail.rs index 252d4cbf162..c0cdbe342a0 100644 --- a/src/test/ui/match/match-range-fail.rs +++ b/src/test/ui/match/match-range-fail.rs @@ -19,6 +19,4 @@ fn main() { _ => { } }; //~^^^ ERROR mismatched types - //~| expected type `{integer}` - //~| found type `char` } diff --git a/src/test/ui/match/match-range-fail.stderr b/src/test/ui/match/match-range-fail.stderr index 25fa9c2f618..8ce2d8853de 100644 --- a/src/test/ui/match/match-range-fail.stderr +++ b/src/test/ui/match/match-range-fail.stderr @@ -29,9 +29,6 @@ error[E0308]: mismatched types | LL | 'c' ..= 100 => { } | ^^^^^^^^^^^ expected integer, found char - | - = note: expected type `{integer}` - found type `char` error: aborting due to 4 previous errors diff --git a/src/test/ui/match/match-struct.rs b/src/test/ui/match/match-struct.rs index e82d9581b2d..7a54c54b98c 100644 --- a/src/test/ui/match/match-struct.rs +++ b/src/test/ui/match/match-struct.rs @@ -6,8 +6,6 @@ fn main() { E::C(_) => (), //~^ ERROR mismatched types //~| expected struct `S`, found enum `E` - //~| expected struct `S` - //~| found enum `E` _ => () } } diff --git a/src/test/ui/match/match-struct.stderr b/src/test/ui/match/match-struct.stderr index 3d4a19a9317..c23451d51ec 100644 --- a/src/test/ui/match/match-struct.stderr +++ b/src/test/ui/match/match-struct.stderr @@ -5,9 +5,6 @@ LL | match (S { a: 1 }) { | ------------ this match expression has type `S` LL | E::C(_) => (), | ^^^^^^^ expected struct `S`, found enum `E` - | - = note: expected struct `S` - found enum `E` error: aborting due to previous error diff --git a/src/test/ui/match/match-tag-nullary.stderr b/src/test/ui/match/match-tag-nullary.stderr index 5dd7b564d9d..4b6260b2199 100644 --- a/src/test/ui/match/match-tag-nullary.stderr +++ b/src/test/ui/match/match-tag-nullary.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | fn main() { let x: A = A::A; match x { B::B => { } } } | ^^^^ expected enum `A`, found enum `B` - | - = note: expected enum `A` - found enum `B` error: aborting due to previous error diff --git a/src/test/ui/match/match-tag-unary.stderr b/src/test/ui/match/match-tag-unary.stderr index 833d8838e57..db5dcd2be3b 100644 --- a/src/test/ui/match/match-tag-unary.stderr +++ b/src/test/ui/match/match-tag-unary.stderr @@ -5,9 +5,6 @@ LL | fn main() { let x: A = A::A(0); match x { B::B(y) => { } } } | - ^^^^^^^ expected enum `A`, found enum `B` | | | this match expression has type `A` - | - = note: expected enum `A` - found enum `B` error: aborting due to previous error diff --git a/src/test/ui/match/match-type-err-first-arm.rs b/src/test/ui/match/match-type-err-first-arm.rs index 8dfbf1019e9..2a0f01a0b09 100644 --- a/src/test/ui/match/match-type-err-first-arm.rs +++ b/src/test/ui/match/match-type-err-first-arm.rs @@ -18,7 +18,6 @@ fn test_func2(n: i32) -> i32 { _ => 42, //~^ ERROR match arms have incompatible types //~| NOTE expected char, found integer - //~| NOTE expected type `char` }; x } @@ -35,7 +34,6 @@ fn test_func3(n: i32) -> i32 { _ => 42, //~^ ERROR match arms have incompatible types //~| NOTE expected char, found integer - //~| NOTE expected type `char` }; x } @@ -48,6 +46,5 @@ fn test_func4() { None => {} //~^ ERROR match arms have incompatible types //~| NOTE expected u32, found () - //~| NOTE expected type `u32` }; } diff --git a/src/test/ui/match/match-type-err-first-arm.stderr b/src/test/ui/match/match-type-err-first-arm.stderr index 8f8bb4bdcd2..39048e03296 100644 --- a/src/test/ui/match/match-type-err-first-arm.stderr +++ b/src/test/ui/match/match-type-err-first-arm.stderr @@ -18,15 +18,11 @@ LL | | _ => 42, | | ^^ expected char, found integer LL | | LL | | -LL | | LL | | }; | |_____- `match` arms have incompatible types - | - = note: expected type `char` - found type `{integer}` error[E0308]: match arms have incompatible types - --> $DIR/match-type-err-first-arm.rs:35:14 + --> $DIR/match-type-err-first-arm.rs:34:14 | LL | let x = match n { | _____________- @@ -39,16 +35,13 @@ LL | | 6 => 'b', LL | | LL | | _ => 42, | | ^^ expected char, found integer -... | +LL | | LL | | LL | | }; | |_____- `match` arms have incompatible types - | - = note: expected type `char` - found type `{integer}` error[E0308]: match arms have incompatible types - --> $DIR/match-type-err-first-arm.rs:48:17 + --> $DIR/match-type-err-first-arm.rs:46:17 | LL | / match Some(0u32) { LL | | Some(x) => { @@ -57,13 +50,10 @@ LL | | x LL | | }, LL | | None => {} | | ^^ expected u32, found () -... | +LL | | LL | | LL | | }; | |_____- `match` arms have incompatible types - | - = note: expected type `u32` - found unit type `()` error: aborting due to 4 previous errors diff --git a/src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr b/src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr index 99e0a466817..12f75d009e2 100644 --- a/src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr +++ b/src/test/ui/methods/method-deref-to-same-trait-object-with-separate-params.stderr @@ -3,18 +3,12 @@ error[E0308]: mismatched types | LL | let _seetype: () = z; | ^ expected (), found u32 - | - = note: expected unit type `()` - found type `u32` error[E0308]: mismatched types --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:102:24 | LL | let _seetype: () = z; | ^ expected (), found u64 - | - = note: expected unit type `()` - found type `u64` error[E0034]: multiple applicable items in scope --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:120:15 @@ -46,27 +40,18 @@ error[E0308]: mismatched types | LL | let _seetype: () = z; | ^ expected (), found u8 - | - = note: expected unit type `()` - found type `u8` error[E0308]: mismatched types --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:155:24 | LL | let _seetype: () = z; | ^ expected (), found u32 - | - = note: expected unit type `()` - found type `u32` error[E0308]: mismatched types --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:172:24 | LL | let _seetype: () = z; | ^ expected (), found u32 - | - = note: expected unit type `()` - found type `u32` error: aborting due to 6 previous errors diff --git a/src/test/ui/methods/method-self-arg-1.rs b/src/test/ui/methods/method-self-arg-1.rs index 169c14c0f53..c58040cdf5f 100644 --- a/src/test/ui/methods/method-self-arg-1.rs +++ b/src/test/ui/methods/method-self-arg-1.rs @@ -10,8 +10,6 @@ fn main() { let x = Foo; Foo::bar(x); //~ ERROR mismatched types //~| expected &Foo, found struct `Foo` - //~| expected reference `&Foo` - //~| found struct `Foo` Foo::bar(&42); //~ ERROR mismatched types //~| expected struct `Foo`, found integer //~| expected reference `&Foo` diff --git a/src/test/ui/methods/method-self-arg-1.stderr b/src/test/ui/methods/method-self-arg-1.stderr index e0cb0915fe1..a56164db1b6 100644 --- a/src/test/ui/methods/method-self-arg-1.stderr +++ b/src/test/ui/methods/method-self-arg-1.stderr @@ -6,12 +6,9 @@ LL | Foo::bar(x); | | | expected &Foo, found struct `Foo` | help: consider borrowing here: `&x` - | - = note: expected reference `&Foo` - found struct `Foo` error[E0308]: mismatched types - --> $DIR/method-self-arg-1.rs:15:14 + --> $DIR/method-self-arg-1.rs:13:14 | LL | Foo::bar(&42); | ^^^ expected struct `Foo`, found integer diff --git a/src/test/ui/mir-unpretty.stderr b/src/test/ui/mir-unpretty.stderr index cb2715f5543..d3e41dabba6 100644 --- a/src/test/ui/mir-unpretty.stderr +++ b/src/test/ui/mir-unpretty.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | let x: () = 0; | ^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error: aborting due to previous error diff --git a/src/test/ui/mismatched_types/E0409.stderr b/src/test/ui/mismatched_types/E0409.stderr index e3919bf2602..5a961f8948b 100644 --- a/src/test/ui/mismatched_types/E0409.stderr +++ b/src/test/ui/mismatched_types/E0409.stderr @@ -11,9 +11,6 @@ error[E0308]: mismatched types | LL | (0, ref y) | (y, 0) => {} | ^ expected &{integer}, found integer - | - = note: expected type `&{integer}` - found type `{integer}` error: aborting due to 2 previous errors diff --git a/src/test/ui/mismatched_types/abridged.stderr b/src/test/ui/mismatched_types/abridged.stderr index 81cc8e29e49..c2081878629 100644 --- a/src/test/ui/mismatched_types/abridged.stderr +++ b/src/test/ui/mismatched_types/abridged.stderr @@ -76,9 +76,6 @@ LL | 1+2 | | | expected struct `std::string::String`, found integer | help: try using a conversion method: `(1+2).to_string()` - | - = note: expected struct `std::string::String` - found type `{integer}` error[E0308]: mismatched types --> $DIR/abridged.rs:59:5 @@ -90,9 +87,6 @@ LL | -2 | | | expected struct `std::string::String`, found integer | help: try using a conversion method: `(-2).to_string()` - | - = note: expected struct `std::string::String` - found type `{integer}` error: aborting due to 8 previous errors diff --git a/src/test/ui/mismatched_types/for-loop-has-unit-body.stderr b/src/test/ui/mismatched_types/for-loop-has-unit-body.stderr index 8bba0efc814..97b1139abd5 100644 --- a/src/test/ui/mismatched_types/for-loop-has-unit-body.stderr +++ b/src/test/ui/mismatched_types/for-loop-has-unit-body.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | x | ^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error: aborting due to previous error diff --git a/src/test/ui/mismatched_types/main.stderr b/src/test/ui/mismatched_types/main.stderr index fc128fe6fc7..de66c504f8c 100644 --- a/src/test/ui/mismatched_types/main.stderr +++ b/src/test/ui/mismatched_types/main.stderr @@ -5,9 +5,6 @@ LL | let x: u32 = ( | __________________^ LL | | ); | |_____^ expected u32, found () - | - = note: expected type `u32` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/mismatched_types/overloaded-calls-bad.stderr b/src/test/ui/mismatched_types/overloaded-calls-bad.stderr index b5daf195ef7..b57ceb08b17 100644 --- a/src/test/ui/mismatched_types/overloaded-calls-bad.stderr +++ b/src/test/ui/mismatched_types/overloaded-calls-bad.stderr @@ -2,10 +2,7 @@ error[E0308]: mismatched types --> $DIR/overloaded-calls-bad.rs:28:17 | LL | let ans = s("what"); - | ^^^^^^ expected isize, found reference - | - = note: expected type `isize` - found reference `&'static str` + | ^^^^^^ expected isize, found &str error[E0057]: this function takes 1 parameter but 0 parameters were supplied --> $DIR/overloaded-calls-bad.rs:29:15 diff --git a/src/test/ui/missing/missing-return.stderr b/src/test/ui/missing/missing-return.stderr index 8d8d6b78c19..441551486a4 100644 --- a/src/test/ui/missing/missing-return.stderr +++ b/src/test/ui/missing/missing-return.stderr @@ -5,9 +5,6 @@ LL | fn f() -> isize { } | - ^^^^^ expected isize, found () | | | implicitly returns `()` as its body has no tail or `return` expression - | - = note: expected type `isize` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/never_type/call-fn-never-arg-wrong-type.stderr b/src/test/ui/never_type/call-fn-never-arg-wrong-type.stderr index cf3952bca11..d7013bf3c0f 100644 --- a/src/test/ui/never_type/call-fn-never-arg-wrong-type.stderr +++ b/src/test/ui/never_type/call-fn-never-arg-wrong-type.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/call-fn-never-arg-wrong-type.rs:10:9 | LL | foo("wow"); - | ^^^^^ expected !, found reference + | ^^^^^ expected !, found &str | = note: expected type `!` found reference `&'static str` diff --git a/src/test/ui/never_type/never-assign-wrong-type.stderr b/src/test/ui/never_type/never-assign-wrong-type.stderr index fcdb9ef6c92..3f72b6914ca 100644 --- a/src/test/ui/never_type/never-assign-wrong-type.stderr +++ b/src/test/ui/never_type/never-assign-wrong-type.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/never-assign-wrong-type.rs:7:16 | LL | let x: ! = "hello"; - | ^^^^^^^ expected !, found reference + | ^^^^^^^ expected !, found &str | = note: expected type `!` found reference `&'static str` diff --git a/src/test/ui/or-patterns/consistent-bindings.stderr b/src/test/ui/or-patterns/consistent-bindings.stderr index b56aebb99d5..d787cae4343 100644 --- a/src/test/ui/or-patterns/consistent-bindings.stderr +++ b/src/test/ui/or-patterns/consistent-bindings.stderr @@ -11,9 +11,6 @@ error[E0308]: mismatched types | LL | let () = 0; | ^^ expected integer, found () - | - = note: expected type `{integer}` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/or-patterns/issue-64879-trailing-before-guard.stderr b/src/test/ui/or-patterns/issue-64879-trailing-before-guard.stderr index db6670fc5b1..4502ae0c0cc 100644 --- a/src/test/ui/or-patterns/issue-64879-trailing-before-guard.stderr +++ b/src/test/ui/or-patterns/issue-64879-trailing-before-guard.stderr @@ -11,9 +11,6 @@ error[E0308]: mismatched types | LL | let recovery_witness: bool = 0; | ^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error: aborting due to 2 previous errors diff --git a/src/test/ui/or-patterns/or-pattern-mismatch.stderr b/src/test/ui/or-patterns/or-pattern-mismatch.stderr index 731b2090a7b..be06f3666cb 100644 --- a/src/test/ui/or-patterns/or-pattern-mismatch.stderr +++ b/src/test/ui/or-patterns/or-pattern-mismatch.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | fn main() { match Blah::A(1, 1, 2) { Blah::A(_, x, y) | Blah::B(x, y) => { } } } | ^ expected usize, found isize - | - = note: expected type `usize` - found type `isize` error: aborting due to previous error diff --git a/src/test/ui/or-patterns/or-patterns-syntactic-fail.stderr b/src/test/ui/or-patterns/or-patterns-syntactic-fail.stderr index 5985b2aecfc..7e4cf0d14e1 100644 --- a/src/test/ui/or-patterns/or-patterns-syntactic-fail.stderr +++ b/src/test/ui/or-patterns/or-patterns-syntactic-fail.stderr @@ -122,9 +122,6 @@ LL | let recovery_witness: String = 0; | | | expected struct `std::string::String`, found integer | help: try using a conversion method: `0.to_string()` - | - = note: expected struct `std::string::String` - found type `{integer}` error: aborting due to 16 previous errors diff --git a/src/test/ui/output-type-mismatch.stderr b/src/test/ui/output-type-mismatch.stderr index 051af60121b..91ee46c55a7 100644 --- a/src/test/ui/output-type-mismatch.stderr +++ b/src/test/ui/output-type-mismatch.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | fn main() { let i: isize; i = f(); } | ^^^ expected isize, found () - | - = note: expected type `isize` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/parser/expr-as-stmt.stderr b/src/test/ui/parser/expr-as-stmt.stderr index 83e8880f183..2a751e9d43a 100644 --- a/src/test/ui/parser/expr-as-stmt.stderr +++ b/src/test/ui/parser/expr-as-stmt.stderr @@ -48,36 +48,24 @@ error[E0308]: mismatched types | LL | {2} + {2} | ^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error[E0308]: mismatched types --> $DIR/expr-as-stmt.rs:12:6 | LL | {2} + 2 | ^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error[E0308]: mismatched types --> $DIR/expr-as-stmt.rs:18:7 | LL | { 42 } + foo; | ^^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error[E0308]: mismatched types --> $DIR/expr-as-stmt.rs:24:7 | LL | { 3 } * 3 | ^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error[E0614]: type `{integer}` cannot be dereferenced --> $DIR/expr-as-stmt.rs:24:11 diff --git a/src/test/ui/parser/fn-arg-doc-comment.rs b/src/test/ui/parser/fn-arg-doc-comment.rs index 995eb62d0bb..ad28c9d3dce 100644 --- a/src/test/ui/parser/fn-arg-doc-comment.rs +++ b/src/test/ui/parser/fn-arg-doc-comment.rs @@ -17,13 +17,10 @@ fn main() { // verify that the parser recovered and properly typechecked the args f("", ""); //~^ ERROR mismatched types - //~| NOTE expected u8, found reference - //~| NOTE expected + //~| NOTE expected u8, found &str //~| ERROR mismatched types - //~| NOTE expected u8, found reference - //~| NOTE expected + //~| NOTE expected u8, found &str bar(""); //~^ ERROR mismatched types - //~| NOTE expected i32, found reference - //~| NOTE expected + //~| NOTE expected i32, found &str } diff --git a/src/test/ui/parser/fn-arg-doc-comment.stderr b/src/test/ui/parser/fn-arg-doc-comment.stderr index 9554cf42ee3..5ea1eef0e4f 100644 --- a/src/test/ui/parser/fn-arg-doc-comment.stderr +++ b/src/test/ui/parser/fn-arg-doc-comment.stderr @@ -20,28 +20,19 @@ error[E0308]: mismatched types --> $DIR/fn-arg-doc-comment.rs:18:7 | LL | f("", ""); - | ^^ expected u8, found reference - | - = note: expected type `u8` - found reference `&'static str` + | ^^ expected u8, found &str error[E0308]: mismatched types --> $DIR/fn-arg-doc-comment.rs:18:11 | LL | f("", ""); - | ^^ expected u8, found reference - | - = note: expected type `u8` - found reference `&'static str` + | ^^ expected u8, found &str error[E0308]: mismatched types - --> $DIR/fn-arg-doc-comment.rs:25:9 + --> $DIR/fn-arg-doc-comment.rs:23:9 | LL | bar(""); - | ^^ expected i32, found reference - | - = note: expected type `i32` - found reference `&'static str` + | ^^ expected i32, found &str error: aborting due to 6 previous errors diff --git a/src/test/ui/parser/issue-33413.stderr b/src/test/ui/parser/issue-33413.stderr index d1e09ce1655..b0d41a27dc9 100644 --- a/src/test/ui/parser/issue-33413.stderr +++ b/src/test/ui/parser/issue-33413.stderr @@ -11,9 +11,6 @@ LL | fn f(*, a: u8) -> u8 {} | - ^^ expected u8, found () | | | implicitly returns `()` as its body has no tail or `return` expression - | - = note: expected type `u8` - found unit type `()` error: aborting due to 2 previous errors diff --git a/src/test/ui/parser/issue-62881.stderr b/src/test/ui/parser/issue-62881.stderr index 2905cc7370d..ddb97b40e95 100644 --- a/src/test/ui/parser/issue-62881.stderr +++ b/src/test/ui/parser/issue-62881.stderr @@ -20,9 +20,6 @@ LL | fn f() -> isize { fn f() -> isize {} pub f< | - ^^^^^ expected isize, found () | | | implicitly returns `()` as its body has no tail or `return` expression - | - = note: expected type `isize` - found unit type `()` error: aborting due to 3 previous errors diff --git a/src/test/ui/parser/issue-62895.stderr b/src/test/ui/parser/issue-62895.stderr index 61cb1faead1..e46152fad0e 100644 --- a/src/test/ui/parser/issue-62895.stderr +++ b/src/test/ui/parser/issue-62895.stderr @@ -40,9 +40,6 @@ LL | fn v() -> isize { | - ^^^^^ expected isize, found () | | | implicitly returns `()` as its body has no tail or `return` expression - | - = note: expected type `isize` - found unit type `()` error: aborting due to 6 previous errors diff --git a/src/test/ui/parser/lex-bad-char-literals-6.stderr b/src/test/ui/parser/lex-bad-char-literals-6.stderr index fbd1fc28dd6..db2b9c70a03 100644 --- a/src/test/ui/parser/lex-bad-char-literals-6.stderr +++ b/src/test/ui/parser/lex-bad-char-literals-6.stderr @@ -43,10 +43,7 @@ error[E0308]: mismatched types --> $DIR/lex-bad-char-literals-6.rs:15:20 | LL | let a: usize = ""; - | ^^ expected usize, found reference - | - = note: expected type `usize` - found reference `&'static str` + | ^^ expected usize, found &str error[E0277]: can't compare `&str` with `char` --> $DIR/lex-bad-char-literals-6.rs:12:10 diff --git a/src/test/ui/parser/match-vec-invalid.stderr b/src/test/ui/parser/match-vec-invalid.stderr index 2e4bf8320fb..b9d0f13c065 100644 --- a/src/test/ui/parser/match-vec-invalid.stderr +++ b/src/test/ui/parser/match-vec-invalid.stderr @@ -35,9 +35,6 @@ error[E0308]: mismatched types | LL | const RECOVERY_WITNESS: () = 0; | ^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error: aborting due to 5 previous errors diff --git a/src/test/ui/parser/numeric-lifetime.stderr b/src/test/ui/parser/numeric-lifetime.stderr index 4a7a28825ff..2ef6aa6f113 100644 --- a/src/test/ui/parser/numeric-lifetime.stderr +++ b/src/test/ui/parser/numeric-lifetime.stderr @@ -14,10 +14,7 @@ error[E0308]: mismatched types --> $DIR/numeric-lifetime.rs:6:20 | LL | let x: usize = ""; - | ^^ expected usize, found reference - | - = note: expected type `usize` - found reference `&'static str` + | ^^ expected usize, found &str error: aborting due to 3 previous errors diff --git a/src/test/ui/parser/pat-lt-bracket-6.stderr b/src/test/ui/parser/pat-lt-bracket-6.stderr index d702dac81da..bfb8866437b 100644 --- a/src/test/ui/parser/pat-lt-bracket-6.stderr +++ b/src/test/ui/parser/pat-lt-bracket-6.stderr @@ -18,9 +18,6 @@ error[E0308]: mismatched types | LL | const RECOVERY_WITNESS: () = 0; | ^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error: aborting due to 3 previous errors diff --git a/src/test/ui/parser/pat-lt-bracket-7.stderr b/src/test/ui/parser/pat-lt-bracket-7.stderr index 77bb3b0417a..d30a3bc0b14 100644 --- a/src/test/ui/parser/pat-lt-bracket-7.stderr +++ b/src/test/ui/parser/pat-lt-bracket-7.stderr @@ -9,9 +9,6 @@ error[E0308]: mismatched types | LL | const RECOVERY_WITNESS: () = 0; | ^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error: aborting due to 2 previous errors diff --git a/src/test/ui/parser/pat-tuple-4.stderr b/src/test/ui/parser/pat-tuple-4.stderr index 7aa91ab2af4..9472237a22e 100644 --- a/src/test/ui/parser/pat-tuple-4.stderr +++ b/src/test/ui/parser/pat-tuple-4.stderr @@ -18,9 +18,6 @@ error[E0308]: mismatched types | LL | const RECOVERY_WITNESS: () = 0; | ^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error: aborting due to 3 previous errors diff --git a/src/test/ui/parser/recover-for-loop-parens-around-head.stderr b/src/test/ui/parser/recover-for-loop-parens-around-head.stderr index f0373b0c89f..74ac926cb02 100644 --- a/src/test/ui/parser/recover-for-loop-parens-around-head.stderr +++ b/src/test/ui/parser/recover-for-loop-parens-around-head.stderr @@ -18,9 +18,6 @@ error[E0308]: mismatched types | LL | const RECOVERY_WITNESS: () = 0; | ^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error: aborting due to 3 previous errors diff --git a/src/test/ui/parser/recover-from-homoglyph.stderr b/src/test/ui/parser/recover-from-homoglyph.stderr index d69cba7a106..3f5a986f086 100644 --- a/src/test/ui/parser/recover-from-homoglyph.stderr +++ b/src/test/ui/parser/recover-from-homoglyph.stderr @@ -14,9 +14,6 @@ error[E0308]: mismatched types | LL | let x: usize = (); | ^^ expected usize, found () - | - = note: expected type `usize` - found unit type `()` error: aborting due to 2 previous errors diff --git a/src/test/ui/parser/recover-missing-semi.stderr b/src/test/ui/parser/recover-missing-semi.stderr index 41640ac3f23..1ccf8b22c53 100644 --- a/src/test/ui/parser/recover-missing-semi.stderr +++ b/src/test/ui/parser/recover-missing-semi.stderr @@ -21,18 +21,12 @@ error[E0308]: mismatched types | LL | let _: usize = () | ^^ expected usize, found () - | - = note: expected type `usize` - found unit type `()` error[E0308]: mismatched types --> $DIR/recover-missing-semi.rs:9:20 | LL | let _: usize = () | ^^ expected usize, found () - | - = note: expected type `usize` - found unit type `()` error: aborting due to 4 previous errors diff --git a/src/test/ui/parser/recover-range-pats.stderr b/src/test/ui/parser/recover-range-pats.stderr index 160ab18e34a..af03b577548 100644 --- a/src/test/ui/parser/recover-range-pats.stderr +++ b/src/test/ui/parser/recover-range-pats.stderr @@ -418,18 +418,12 @@ error[E0308]: mismatched types | LL | if let .0..Y = 0 {} | ^^^^^ expected integer, found floating-point number - | - = note: expected type `{integer}` - found type `{float}` error[E0308]: mismatched types --> $DIR/recover-range-pats.rs:23:12 | LL | if let X.. .0 = 0 {} | ^^^^^^ expected integer, found floating-point number - | - = note: expected type `u8` - found type `{float}` error[E0029]: only char and numeric types are allowed in range patterns --> $DIR/recover-range-pats.rs:32:12 @@ -452,18 +446,12 @@ error[E0308]: mismatched types | LL | if let .0..=Y = 0 {} | ^^^^^^ expected integer, found floating-point number - | - = note: expected type `{integer}` - found type `{float}` error[E0308]: mismatched types --> $DIR/recover-range-pats.rs:36:12 | LL | if let X..=.0 = 0 {} | ^^^^^^ expected integer, found floating-point number - | - = note: expected type `u8` - found type `{float}` error[E0029]: only char and numeric types are allowed in range patterns --> $DIR/recover-range-pats.rs:45:12 @@ -486,18 +474,12 @@ error[E0308]: mismatched types | LL | if let .0...Y = 0 {} | ^^^^^^ expected integer, found floating-point number - | - = note: expected type `{integer}` - found type `{float}` error[E0308]: mismatched types --> $DIR/recover-range-pats.rs:52:12 | LL | if let X... .0 = 0 {} | ^^^^^^^ expected integer, found floating-point number - | - = note: expected type `u8` - found type `{float}` error[E0029]: only char and numeric types are allowed in range patterns --> $DIR/recover-range-pats.rs:60:12 @@ -510,9 +492,6 @@ error[E0308]: mismatched types | LL | if let .0.. = 0 {} | ^^^^ expected integer, found floating-point number - | - = note: expected type `{integer}` - found type `{float}` error[E0029]: only char and numeric types are allowed in range patterns --> $DIR/recover-range-pats.rs:70:12 @@ -525,9 +504,6 @@ error[E0308]: mismatched types | LL | if let .0..= = 0 {} | ^^^^^ expected integer, found floating-point number - | - = note: expected type `{integer}` - found type `{float}` error[E0029]: only char and numeric types are allowed in range patterns --> $DIR/recover-range-pats.rs:82:12 @@ -540,9 +516,6 @@ error[E0308]: mismatched types | LL | if let .0... = 0 {} | ^^^^^ expected integer, found floating-point number - | - = note: expected type `{integer}` - found type `{float}` error[E0029]: only char and numeric types are allowed in range patterns --> $DIR/recover-range-pats.rs:94:14 @@ -555,9 +528,6 @@ error[E0308]: mismatched types | LL | if let .. .0 = 0 {} | ^^^^^ expected integer, found floating-point number - | - = note: expected type `{integer}` - found type `{float}` error[E0029]: only char and numeric types are allowed in range patterns --> $DIR/recover-range-pats.rs:104:15 @@ -570,9 +540,6 @@ error[E0308]: mismatched types | LL | if let ..=.0 = 0 {} | ^^^^^ expected integer, found floating-point number - | - = note: expected type `{integer}` - found type `{float}` error[E0029]: only char and numeric types are allowed in range patterns --> $DIR/recover-range-pats.rs:116:15 @@ -585,9 +552,6 @@ error[E0308]: mismatched types | LL | if let ....3 = 0 {} | ^^^^^ expected integer, found floating-point number - | - = note: expected type `{integer}` - found type `{float}` error: aborting due to 85 previous errors diff --git a/src/test/ui/parser/recover-tuple.stderr b/src/test/ui/parser/recover-tuple.stderr index 70eefd8a170..1bd2e986753 100644 --- a/src/test/ui/parser/recover-tuple.stderr +++ b/src/test/ui/parser/recover-tuple.stderr @@ -8,10 +8,7 @@ error[E0308]: mismatched types --> $DIR/recover-tuple.rs:6:20 | LL | let y: usize = ""; - | ^^ expected usize, found reference - | - = note: expected type `usize` - found reference `&'static str` + | ^^ expected usize, found &str error: aborting due to 2 previous errors diff --git a/src/test/ui/parser/require-parens-for-chained-comparison.stderr b/src/test/ui/parser/require-parens-for-chained-comparison.stderr index 85478dcd1dc..f5766881249 100644 --- a/src/test/ui/parser/require-parens-for-chained-comparison.stderr +++ b/src/test/ui/parser/require-parens-for-chained-comparison.stderr @@ -46,18 +46,12 @@ error[E0308]: mismatched types | LL | false == 0 < 2; | ^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error[E0308]: mismatched types --> $DIR/require-parens-for-chained-comparison.rs:8:18 | LL | false == 0 < 2; | ^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error: aborting due to 7 previous errors diff --git a/src/test/ui/pattern/pat-tuple-bad-type.stderr b/src/test/ui/pattern/pat-tuple-bad-type.stderr index 7a599b07f1e..a6224d89894 100644 --- a/src/test/ui/pattern/pat-tuple-bad-type.stderr +++ b/src/test/ui/pattern/pat-tuple-bad-type.stderr @@ -14,9 +14,6 @@ error[E0308]: mismatched types | LL | (..) => {} | ^^^^ expected u8, found () - | - = note: expected type `u8` - found unit type `()` error: aborting due to 2 previous errors diff --git a/src/test/ui/pattern/pattern-error-continue.rs b/src/test/ui/pattern/pattern-error-continue.rs index f21da3b55dc..eb57210f454 100644 --- a/src/test/ui/pattern/pattern-error-continue.rs +++ b/src/test/ui/pattern/pattern-error-continue.rs @@ -22,8 +22,6 @@ fn main() { S { .. } => (), //~^ ERROR mismatched types //~| expected char, found struct `S` - //~| expected type `char` - //~| found struct `S` _ => () } diff --git a/src/test/ui/pattern/pattern-error-continue.stderr b/src/test/ui/pattern/pattern-error-continue.stderr index c8d80043fdb..22da0d5e0db 100644 --- a/src/test/ui/pattern/pattern-error-continue.stderr +++ b/src/test/ui/pattern/pattern-error-continue.stderr @@ -1,5 +1,5 @@ error[E0433]: failed to resolve: use of undeclared type or module `E` - --> $DIR/pattern-error-continue.rs:35:9 + --> $DIR/pattern-error-continue.rs:33:9 | LL | E::V => {} | ^ use of undeclared type or module `E` @@ -31,12 +31,9 @@ LL | match 'c' { | --- this match expression has type `char` LL | S { .. } => (), | ^^^^^^^^ expected char, found struct `S` - | - = note: expected type `char` - found struct `S` error[E0308]: mismatched types - --> $DIR/pattern-error-continue.rs:30:7 + --> $DIR/pattern-error-continue.rs:28:7 | LL | f(true); | ^^^^ expected char, found bool diff --git a/src/test/ui/point-to-type-err-cause-on-impl-trait-return.stderr b/src/test/ui/point-to-type-err-cause-on-impl-trait-return.stderr index 314ff84ae3c..b73ab6e5d9f 100644 --- a/src/test/ui/point-to-type-err-cause-on-impl-trait-return.stderr +++ b/src/test/ui/point-to-type-err-cause-on-impl-trait-return.stderr @@ -9,9 +9,6 @@ LL | return 0i32; LL | } LL | 1u32 | ^^^^ expected i32, found u32 - | - = note: expected type `i32` - found type `u32` error[E0308]: mismatched types --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:13:16 @@ -24,9 +21,6 @@ LL | return 0i32; LL | } else { LL | return 1u32; | ^^^^ expected i32, found u32 - | - = note: expected type `i32` - found type `u32` error[E0308]: mismatched types --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:22:9 @@ -39,9 +33,6 @@ LL | return 0i32; LL | } else { LL | 1u32 | ^^^^ expected i32, found u32 - | - = note: expected type `i32` - found type `u32` error[E0308]: if and else have incompatible types --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:31:9 @@ -55,9 +46,6 @@ LL | | 1u32 LL | | LL | | } | |_____- if and else have incompatible types - | - = note: expected type `i32` - found type `u32` error[E0308]: mismatched types --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:39:14 @@ -69,9 +57,6 @@ LL | 0 => return 0i32, | ---- ...is found to be `i32` here LL | _ => 1u32, | ^^^^ expected i32, found u32 - | - = note: expected type `i32` - found type `u32` error[E0308]: mismatched types --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:45:5 @@ -86,9 +71,6 @@ LL | | 1 => 1u32, LL | | _ => 2u32, LL | | } | |_____^ expected i32, found u32 - | - = note: expected type `i32` - found type `u32` error[E0308]: mismatched types --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:59:13 @@ -101,9 +83,6 @@ LL | return 0i32; ... LL | 1u32 | ^^^^ expected i32, found u32 - | - = note: expected type `i32` - found type `u32` error: aborting due to 7 previous errors diff --git a/src/test/ui/proc-macro/attribute-spans-preserved.stderr b/src/test/ui/proc-macro/attribute-spans-preserved.stderr index e8e3b488209..34a20330094 100644 --- a/src/test/ui/proc-macro/attribute-spans-preserved.stderr +++ b/src/test/ui/proc-macro/attribute-spans-preserved.stderr @@ -2,19 +2,13 @@ error[E0308]: mismatched types --> $DIR/attribute-spans-preserved.rs:7:23 | LL | #[ foo ( let y: u32 = "z"; ) ] - | ^^^ expected u32, found reference - | - = note: expected type `u32` - found reference `&'static str` + | ^^^ expected u32, found &str error[E0308]: mismatched types --> $DIR/attribute-spans-preserved.rs:8:23 | LL | #[ bar { let x: u32 = "y"; } ] - | ^^^ expected u32, found reference - | - = note: expected type `u32` - found reference `&'static str` + | ^^^ expected u32, found &str error: aborting due to 2 previous errors diff --git a/src/test/ui/proc-macro/attribute-with-error.stderr b/src/test/ui/proc-macro/attribute-with-error.stderr index 73d0e2ef66e..e810e9ad658 100644 --- a/src/test/ui/proc-macro/attribute-with-error.stderr +++ b/src/test/ui/proc-macro/attribute-with-error.stderr @@ -2,37 +2,25 @@ error[E0308]: mismatched types --> $DIR/attribute-with-error.rs:10:18 | LL | let a: i32 = "foo"; - | ^^^^^ expected i32, found reference - | - = note: expected type `i32` - found reference `&'static str` + | ^^^^^ expected i32, found &str error[E0308]: mismatched types --> $DIR/attribute-with-error.rs:12:18 | LL | let b: i32 = "f'oo"; - | ^^^^^^ expected i32, found reference - | - = note: expected type `i32` - found reference `&'static str` + | ^^^^^^ expected i32, found &str error[E0308]: mismatched types --> $DIR/attribute-with-error.rs:25:22 | LL | let a: i32 = "foo"; - | ^^^^^ expected i32, found reference - | - = note: expected type `i32` - found reference `&'static str` + | ^^^^^ expected i32, found &str error[E0308]: mismatched types --> $DIR/attribute-with-error.rs:35:22 | LL | let a: i32 = "foo"; - | ^^^^^ expected i32, found reference - | - = note: expected type `i32` - found reference `&'static str` + | ^^^^^ expected i32, found &str error: aborting due to 4 previous errors diff --git a/src/test/ui/proc-macro/nested-item-spans.stderr b/src/test/ui/proc-macro/nested-item-spans.stderr index b8776c29057..e6d1c9356ea 100644 --- a/src/test/ui/proc-macro/nested-item-spans.stderr +++ b/src/test/ui/proc-macro/nested-item-spans.stderr @@ -2,19 +2,13 @@ error[E0308]: mismatched types --> $DIR/nested-item-spans.rs:9:22 | LL | let x: u32 = "x"; - | ^^^ expected u32, found reference - | - = note: expected type `u32` - found reference `&'static str` + | ^^^ expected u32, found &str error[E0308]: mismatched types --> $DIR/nested-item-spans.rs:18:22 | LL | let x: u32 = "x"; - | ^^^ expected u32, found reference - | - = note: expected type `u32` - found reference `&'static str` + | ^^^ expected u32, found &str error: aborting due to 2 previous errors diff --git a/src/test/ui/proc-macro/span-preservation.stderr b/src/test/ui/proc-macro/span-preservation.stderr index 60fb9755003..86d2bee2068 100644 --- a/src/test/ui/proc-macro/span-preservation.stderr +++ b/src/test/ui/proc-macro/span-preservation.stderr @@ -2,10 +2,7 @@ error[E0308]: mismatched types --> $DIR/span-preservation.rs:11:20 | LL | let x: usize = "hello"; - | ^^^^^^^ expected usize, found reference - | - = note: expected type `usize` - found reference `&'static str` + | ^^^^^^^ expected usize, found &str error[E0308]: mismatched types --> $DIR/span-preservation.rs:17:29 @@ -48,9 +45,6 @@ LL | extern "C" fn baz() { | - possibly return type missing here? LL | 0 | ^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error[E0308]: mismatched types --> $DIR/span-preservation.rs:49:5 diff --git a/src/test/ui/repeat_count.rs b/src/test/ui/repeat_count.rs index cd1b9336ac7..7e899ec37d2 100644 --- a/src/test/ui/repeat_count.rs +++ b/src/test/ui/repeat_count.rs @@ -7,21 +7,15 @@ fn main() { let b = [0; ()]; //~^ ERROR mismatched types //~| expected usize, found () - //~| expected type `usize` - //~| found unit type `()` let c = [0; true]; //~^ ERROR mismatched types //~| expected usize, found bool let d = [0; 0.5]; //~^ ERROR mismatched types //~| expected usize, found floating-point number - //~| expected type `usize` - //~| found type `{float}` let e = [0; "foo"]; //~^ ERROR mismatched types - //~| expected usize, found reference - //~| expected type `usize` - //~| found reference `&'static str` + //~| expected usize, found &str let f = [0; -4_isize]; //~^ ERROR mismatched types //~| expected usize, found isize @@ -34,6 +28,4 @@ fn main() { let g = [0; G { g: () }]; //~^ ERROR mismatched types //~| expected usize, found struct `main::G` - //~| expected type `usize` - //~| found struct `main::G` } diff --git a/src/test/ui/repeat_count.stderr b/src/test/ui/repeat_count.stderr index 056cad6127f..76e90af7557 100644 --- a/src/test/ui/repeat_count.stderr +++ b/src/test/ui/repeat_count.stderr @@ -9,36 +9,27 @@ error[E0308]: mismatched types | LL | let b = [0; ()]; | ^^ expected usize, found () - | - = note: expected type `usize` - found unit type `()` error[E0308]: mismatched types - --> $DIR/repeat_count.rs:12:17 + --> $DIR/repeat_count.rs:10:17 | LL | let c = [0; true]; | ^^^^ expected usize, found bool error[E0308]: mismatched types - --> $DIR/repeat_count.rs:15:17 + --> $DIR/repeat_count.rs:13:17 | LL | let d = [0; 0.5]; | ^^^ expected usize, found floating-point number - | - = note: expected type `usize` - found type `{float}` error[E0308]: mismatched types - --> $DIR/repeat_count.rs:20:17 + --> $DIR/repeat_count.rs:16:17 | LL | let e = [0; "foo"]; - | ^^^^^ expected usize, found reference - | - = note: expected type `usize` - found reference `&'static str` + | ^^^^^ expected usize, found &str error[E0308]: mismatched types - --> $DIR/repeat_count.rs:25:17 + --> $DIR/repeat_count.rs:19:17 | LL | let f = [0; -4_isize]; | ^^^^^^^^ expected usize, found isize @@ -49,7 +40,7 @@ LL | let f = [0; (-4_isize).try_into().unwrap()]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types - --> $DIR/repeat_count.rs:28:23 + --> $DIR/repeat_count.rs:22:23 | LL | let f = [0_usize; -1_isize]; | ^^^^^^^^ expected usize, found isize @@ -60,13 +51,10 @@ LL | let f = [0_usize; (-1_isize).try_into().unwrap()]; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0308]: mismatched types - --> $DIR/repeat_count.rs:34:17 + --> $DIR/repeat_count.rs:28:17 | LL | let g = [0; G { g: () }]; | ^^^^^^^^^^^ expected usize, found struct `main::G` - | - = note: expected type `usize` - found struct `main::G` error: aborting due to 8 previous errors diff --git a/src/test/ui/resolve/resolve-inconsistent-binding-mode.stderr b/src/test/ui/resolve/resolve-inconsistent-binding-mode.stderr index 6f660872f5e..361c79dabd1 100644 --- a/src/test/ui/resolve/resolve-inconsistent-binding-mode.stderr +++ b/src/test/ui/resolve/resolve-inconsistent-binding-mode.stderr @@ -25,18 +25,12 @@ error[E0308]: mismatched types | LL | Opts::A(ref i) | Opts::B(i) => {} | ^ expected &isize, found isize - | - = note: expected type `&isize` - found type `isize` error[E0308]: mismatched types --> $DIR/resolve-inconsistent-binding-mode.rs:16:32 | LL | Opts::A(ref i) | Opts::B(i) => {} | ^ expected &isize, found isize - | - = note: expected type `&isize` - found type `isize` error[E0308]: mismatched types --> $DIR/resolve-inconsistent-binding-mode.rs:25:36 diff --git a/src/test/ui/resolve/resolve-inconsistent-names.stderr b/src/test/ui/resolve/resolve-inconsistent-names.stderr index f02867a0024..04edc2da256 100644 --- a/src/test/ui/resolve/resolve-inconsistent-names.stderr +++ b/src/test/ui/resolve/resolve-inconsistent-names.stderr @@ -88,9 +88,6 @@ error[E0308]: mismatched types | LL | (A, B) | (ref B, c) | (c, A) => () | ^^^^^ expected enum `E`, found &E - | - = note: expected type `E` - found type `&E` error: aborting due to 9 previous errors diff --git a/src/test/ui/return/return-from-diverging.stderr b/src/test/ui/return/return-from-diverging.stderr index 31f86bdf15d..c1dcc1d5d8f 100644 --- a/src/test/ui/return/return-from-diverging.stderr +++ b/src/test/ui/return/return-from-diverging.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | fn fail() -> ! { | - expected `!` because of return type LL | return "wow"; - | ^^^^^ expected !, found reference + | ^^^^^ expected !, found &str | = note: expected type `!` found reference `&'static str` diff --git a/src/test/ui/rfc-2005-default-binding-mode/const.stderr b/src/test/ui/rfc-2005-default-binding-mode/const.stderr index e536ed50de1..8e1873c0659 100644 --- a/src/test/ui/rfc-2005-default-binding-mode/const.stderr +++ b/src/test/ui/rfc-2005-default-binding-mode/const.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | FOO => {}, | ^^^ expected &Foo, found struct `Foo` - | - = note: expected type `&Foo` - found struct `Foo` error: aborting due to previous error diff --git a/src/test/ui/rfc-2005-default-binding-mode/lit.stderr b/src/test/ui/rfc-2005-default-binding-mode/lit.stderr index f8df0b4ada0..fd48c56c07b 100644 --- a/src/test/ui/rfc-2005-default-binding-mode/lit.stderr +++ b/src/test/ui/rfc-2005-default-binding-mode/lit.stderr @@ -11,7 +11,7 @@ error[E0308]: mismatched types --> $DIR/lit.rs:16:9 | LL | b"abc" => true, - | ^^^^^^ expected &[u8], found array of 3 elements + | ^^^^^^ expected &[u8], found array `[u8; 3]` | = note: expected type `&&[u8]` found reference `&'static [u8; 3]` diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions.stderr b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions.stderr index 0a597eaa1ff..d2d319f50c7 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions.stderr +++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions.stderr @@ -5,9 +5,6 @@ LL | fn cannot_coerce_empty_enum_to_anything(x: UninhabitedEnum) -> A { | - expected `A` because of return type LL | x | ^ expected struct `A`, found enum `uninhabited::UninhabitedEnum` - | - = note: expected struct `A` - found enum `uninhabited::UninhabitedEnum` error[E0308]: mismatched types --> $DIR/coercions.rs:27:5 @@ -16,9 +13,6 @@ LL | fn cannot_coerce_empty_tuple_struct_to_anything(x: UninhabitedTupleStruct) | - expected `A` because of return type LL | x | ^ expected struct `A`, found struct `uninhabited::UninhabitedTupleStruct` - | - = note: expected struct `A` - found struct `uninhabited::UninhabitedTupleStruct` error[E0308]: mismatched types --> $DIR/coercions.rs:31:5 @@ -27,9 +21,6 @@ LL | fn cannot_coerce_empty_struct_to_anything(x: UninhabitedStruct) -> A { | - expected `A` because of return type LL | x | ^ expected struct `A`, found struct `uninhabited::UninhabitedStruct` - | - = note: expected struct `A` - found struct `uninhabited::UninhabitedStruct` error[E0308]: mismatched types --> $DIR/coercions.rs:35:5 @@ -38,9 +29,6 @@ LL | fn cannot_coerce_enum_with_empty_variants_to_anything(x: UninhabitedVariant | - expected `A` because of return type LL | x | ^ expected struct `A`, found enum `uninhabited::UninhabitedVariants` - | - = note: expected struct `A` - found enum `uninhabited::UninhabitedVariants` error: aborting due to 4 previous errors diff --git a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr index 6d7383b3896..fd2c56974bd 100644 --- a/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr +++ b/src/test/ui/rfc-2008-non-exhaustive/uninhabited/coercions_same_crate.stderr @@ -5,9 +5,6 @@ LL | fn cannot_coerce_empty_enum_to_anything(x: UninhabitedEnum) -> A { | - expected `A` because of return type LL | x | ^ expected struct `A`, found enum `UninhabitedEnum` - | - = note: expected struct `A` - found enum `UninhabitedEnum` error[E0308]: mismatched types --> $DIR/coercions_same_crate.rs:34:5 @@ -16,9 +13,6 @@ LL | fn cannot_coerce_empty_tuple_struct_to_anything(x: UninhabitedTupleStruct) | - expected `A` because of return type LL | x | ^ expected struct `A`, found struct `UninhabitedTupleStruct` - | - = note: expected struct `A` - found struct `UninhabitedTupleStruct` error[E0308]: mismatched types --> $DIR/coercions_same_crate.rs:38:5 @@ -27,9 +21,6 @@ LL | fn cannot_coerce_empty_struct_to_anything(x: UninhabitedStruct) -> A { | - expected `A` because of return type LL | x | ^ expected struct `A`, found struct `UninhabitedStruct` - | - = note: expected struct `A` - found struct `UninhabitedStruct` error[E0308]: mismatched types --> $DIR/coercions_same_crate.rs:42:5 @@ -38,9 +29,6 @@ LL | fn cannot_coerce_enum_with_empty_variants_to_anything(x: UninhabitedVariant | - expected `A` because of return type LL | x | ^ expected struct `A`, found enum `UninhabitedVariants` - | - = note: expected struct `A` - found enum `UninhabitedVariants` error: aborting due to 4 previous errors diff --git a/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr b/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr index b7f16a8d5bb..a04b109ba6d 100644 --- a/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr +++ b/src/test/ui/rfc-2497-if-let-chains/disallowed-positions.stderr @@ -539,9 +539,6 @@ LL | if &let 0 = 0 {} | | | expected bool, found &bool | help: consider removing the borrow: `let 0 = 0` - | - = note: expected type `bool` - found reference `&bool` error[E0614]: type `bool` cannot be dereferenced --> $DIR/disallowed-positions.rs:36:8 @@ -583,9 +580,6 @@ LL | if x = let 0 = 0 {} | | | expected bool, found () | help: try comparing for equality: `x == let 0 = 0` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:59:8 @@ -697,9 +691,6 @@ error[E0308]: mismatched types | LL | if let Range { start: true, end } = t..&&false {} | ^^^^^^^ expected bool, found &&bool - | - = note: expected type `bool` - found reference `&&bool` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:86:8 @@ -727,9 +718,6 @@ LL | while &let 0 = 0 {} | | | expected bool, found &bool | help: consider removing the borrow: `let 0 = 0` - | - = note: expected type `bool` - found reference `&bool` error[E0614]: type `bool` cannot be dereferenced --> $DIR/disallowed-positions.rs:100:11 @@ -771,9 +759,6 @@ LL | while x = let 0 = 0 {} | | | expected bool, found () | help: try comparing for equality: `x == let 0 = 0` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:123:11 @@ -885,9 +870,6 @@ error[E0308]: mismatched types | LL | while let Range { start: true, end } = t..&&false {} | ^^^^^^^ expected bool, found &&bool - | - = note: expected type `bool` - found reference `&&bool` error[E0308]: mismatched types --> $DIR/disallowed-positions.rs:150:11 @@ -958,9 +940,6 @@ LL | fn outside_if_and_while_expr() { ... LL | &let 0 = 0 | ^^^^^^^^^^ expected (), found &bool - | - = note: expected unit type `()` - found reference `&bool` error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try` --> $DIR/disallowed-positions.rs:179:17 diff --git a/src/test/ui/span/coerce-suggestions.stderr b/src/test/ui/span/coerce-suggestions.stderr index 84b92a7c04a..da9ac04e348 100644 --- a/src/test/ui/span/coerce-suggestions.stderr +++ b/src/test/ui/span/coerce-suggestions.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | let x: usize = String::new(); | ^^^^^^^^^^^^^ expected usize, found struct `std::string::String` - | - = note: expected type `usize` - found struct `std::string::String` error[E0308]: mismatched types --> $DIR/coerce-suggestions.rs:9:19 @@ -15,9 +12,6 @@ LL | let x: &str = String::new(); | | | expected &str, found struct `std::string::String` | help: consider borrowing here: `&String::new()` - | - = note: expected reference `&str` - found struct `std::string::String` error[E0308]: mismatched types --> $DIR/coerce-suggestions.rs:12:10 @@ -50,10 +44,8 @@ error[E0308]: mismatched types --> $DIR/coerce-suggestions.rs:21:9 | LL | s = format!("foo"); - | ^^^^^^^^^^^^^^ expected mutable reference, found struct `std::string::String` + | ^^^^^^^^^^^^^^ expected &mut std::string::String, found struct `std::string::String` | - = note: expected mutable reference `&mut std::string::String` - found struct `std::string::String` = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error: aborting due to 6 previous errors diff --git a/src/test/ui/span/issue-33884.stderr b/src/test/ui/span/issue-33884.stderr index 4cb2fc24a05..4f46c4c7394 100644 --- a/src/test/ui/span/issue-33884.stderr +++ b/src/test/ui/span/issue-33884.stderr @@ -4,8 +4,6 @@ error[E0308]: mismatched types LL | stream.write_fmt(format!("message received")) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `std::fmt::Arguments`, found struct `std::string::String` | - = note: expected struct `std::fmt::Arguments<'_>` - found struct `std::string::String` = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/span/issue-34264.stderr b/src/test/ui/span/issue-34264.stderr index a9cf323c990..c0e9d6cfab8 100644 --- a/src/test/ui/span/issue-34264.stderr +++ b/src/test/ui/span/issue-34264.stderr @@ -55,10 +55,7 @@ error[E0308]: mismatched types --> $DIR/issue-34264.rs:8:13 | LL | bar("", ""); - | ^^ expected usize, found reference - | - = note: expected type `usize` - found reference `&'static str` + | ^^ expected usize, found &str error[E0061]: this function takes 2 parameters but 3 parameters were supplied --> $DIR/issue-34264.rs:10:5 diff --git a/src/test/ui/span/issue-39018.stderr b/src/test/ui/span/issue-39018.stderr index 8ce1dfb11bc..e2ba768d7a3 100644 --- a/src/test/ui/span/issue-39018.stderr +++ b/src/test/ui/span/issue-39018.stderr @@ -72,9 +72,6 @@ LL | let _ = a + b; | | | expected &str, found struct `std::string::String` | help: consider borrowing here: `&b` - | - = note: expected reference `&str` - found struct `std::string::String` error[E0369]: binary operation `+` cannot be applied to type `&std::string::String` --> $DIR/issue-39018.rs:30:15 diff --git a/src/test/ui/str/str-array-assignment.stderr b/src/test/ui/str/str-array-assignment.stderr index 9f790d33659..e8678b439d4 100644 --- a/src/test/ui/str/str-array-assignment.stderr +++ b/src/test/ui/str/str-array-assignment.stderr @@ -5,9 +5,6 @@ LL | let t = if true { s[..2] } else { s }; | ------ ^ expected str, found &str | | | expected because of this - | - = note: expected type `str` - found reference `&str` error[E0308]: mismatched types --> $DIR/str-array-assignment.rs:5:27 @@ -17,9 +14,6 @@ LL | let u: &str = if true { s[..2] } else { s }; | | | expected &str, found str | help: consider borrowing here: `&s[..2]` - | - = note: expected reference `&str` - found type `str` error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/str-array-assignment.rs:7:7 @@ -42,9 +36,6 @@ LL | let w: &str = s[..2]; | | | expected &str, found str | help: consider borrowing here: `&s[..2]` - | - = note: expected reference `&str` - found type `str` error: aborting due to 4 previous errors diff --git a/src/test/ui/str/str-lit-type-mismatch.stderr b/src/test/ui/str/str-lit-type-mismatch.stderr index e328bb33c83..af66fe8b880 100644 --- a/src/test/ui/str/str-lit-type-mismatch.stderr +++ b/src/test/ui/str/str-lit-type-mismatch.stderr @@ -4,7 +4,7 @@ error[E0308]: mismatched types LL | let x: &[u8] = "foo"; | ^^^^^ | | - | expected slice, found str + | expected slice `[u8]`, found str | help: consider adding a leading `b`: `b"foo"` | = note: expected reference `&[u8]` @@ -16,7 +16,7 @@ error[E0308]: mismatched types LL | let y: &[u8; 4] = "baaa"; | ^^^^^^ | | - | expected array of 4 elements, found str + | expected array `[u8; 4]`, found str | help: consider adding a leading `b`: `b"baaa"` | = note: expected reference `&[u8; 4]` @@ -28,7 +28,7 @@ error[E0308]: mismatched types LL | let z: &str = b"foo"; | ^^^^^^ | | - | expected str, found array of 3 elements + | expected str, found array `[u8; 3]` | help: consider removing the leading `b`: `"foo"` | = note: expected reference `&str` diff --git a/src/test/ui/struct-literal-variant-in-if.stderr b/src/test/ui/struct-literal-variant-in-if.stderr index 8c7475e622a..e89111ca2c8 100644 --- a/src/test/ui/struct-literal-variant-in-if.stderr +++ b/src/test/ui/struct-literal-variant-in-if.stderr @@ -58,18 +58,12 @@ LL | if x == E::V { field } {} | | | | | expected (), found bool | expected this to be `()` - | - = note: expected unit type `()` - found type `bool` error[E0308]: mismatched types --> $DIR/struct-literal-variant-in-if.rs:21:20 | LL | let y: usize = (); | ^^ expected usize, found () - | - = note: expected type `usize` - found unit type `()` error: aborting due to 7 previous errors diff --git a/src/test/ui/structs/struct-base-wrong-type.stderr b/src/test/ui/structs/struct-base-wrong-type.stderr index c0bd9bda451..b039ce2cc92 100644 --- a/src/test/ui/structs/struct-base-wrong-type.stderr +++ b/src/test/ui/structs/struct-base-wrong-type.stderr @@ -3,36 +3,24 @@ error[E0308]: mismatched types | LL | static foo: Foo = Foo { a: 2, ..bar }; | ^^^ expected struct `Foo`, found struct `Bar` - | - = note: expected struct `Foo` - found struct `Bar` error[E0308]: mismatched types --> $DIR/struct-base-wrong-type.rs:8:35 | LL | static foo_i: Foo = Foo { a: 2, ..4 }; | ^ expected struct `Foo`, found integer - | - = note: expected struct `Foo` - found type `{integer}` error[E0308]: mismatched types --> $DIR/struct-base-wrong-type.rs:12:27 | LL | let f = Foo { a: 2, ..b }; | ^ expected struct `Foo`, found struct `Bar` - | - = note: expected struct `Foo` - found struct `Bar` error[E0308]: mismatched types --> $DIR/struct-base-wrong-type.rs:13:34 | LL | let f__isize = Foo { a: 2, ..4 }; | ^ expected struct `Foo`, found integer - | - = note: expected struct `Foo` - found type `{integer}` error: aborting due to 4 previous errors diff --git a/src/test/ui/structs/structure-constructor-type-mismatch.stderr b/src/test/ui/structs/structure-constructor-type-mismatch.stderr index 4a78fa3896f..f184f81647d 100644 --- a/src/test/ui/structs/structure-constructor-type-mismatch.stderr +++ b/src/test/ui/structs/structure-constructor-type-mismatch.stderr @@ -6,9 +6,6 @@ LL | x: 1, | | | expected f32, found integer | help: use a float literal: `1.0` - | - = note: expected type `f32` - found type `{integer}` error[E0308]: mismatched types --> $DIR/structure-constructor-type-mismatch.rs:20:12 @@ -18,9 +15,6 @@ LL | y: 2, | | | expected f32, found integer | help: use a float literal: `2.0` - | - = note: expected type `f32` - found type `{integer}` error[E0308]: mismatched types --> $DIR/structure-constructor-type-mismatch.rs:26:12 @@ -30,9 +24,6 @@ LL | x: 3, | | | expected f32, found integer | help: use a float literal: `3.0` - | - = note: expected type `f32` - found type `{integer}` error[E0308]: mismatched types --> $DIR/structure-constructor-type-mismatch.rs:29:12 @@ -42,9 +33,6 @@ LL | y: 4, | | | expected f32, found integer | help: use a float literal: `4.0` - | - = note: expected type `f32` - found type `{integer}` error[E0308]: mismatched types --> $DIR/structure-constructor-type-mismatch.rs:35:12 @@ -54,9 +42,6 @@ LL | x: 5, | | | expected f32, found integer | help: use a float literal: `5.0` - | - = note: expected type `f32` - found type `{integer}` error[E0308]: mismatched types --> $DIR/structure-constructor-type-mismatch.rs:42:12 @@ -66,9 +51,6 @@ LL | x: 7, | | | expected f32, found integer | help: use a float literal: `7.0` - | - = note: expected type `f32` - found type `{integer}` error[E0107]: wrong number of type arguments: expected 0, found 1 --> $DIR/structure-constructor-type-mismatch.rs:48:24 @@ -84,9 +66,6 @@ LL | x: 9, | | | expected f32, found integer | help: use a float literal: `9.0` - | - = note: expected type `f32` - found type `{integer}` error[E0308]: mismatched types --> $DIR/structure-constructor-type-mismatch.rs:50:12 @@ -96,9 +75,6 @@ LL | y: 10, | | | expected f32, found integer | help: use a float literal: `10.0` - | - = note: expected type `f32` - found type `{integer}` error[E0107]: wrong number of type arguments: expected 0, found 1 --> $DIR/structure-constructor-type-mismatch.rs:54:18 diff --git a/src/test/ui/suggestions/as-ref.stderr b/src/test/ui/suggestions/as-ref.stderr index d01c3735195..5379f77ae5c 100644 --- a/src/test/ui/suggestions/as-ref.stderr +++ b/src/test/ui/suggestions/as-ref.stderr @@ -5,9 +5,6 @@ LL | opt.map(|arg| takes_ref(arg)); | --- ^^^ expected &Foo, found struct `Foo` | | | help: consider using `as_ref` instead: `as_ref().map` - | - = note: expected reference `&Foo` - found struct `Foo` error[E0308]: mismatched types --> $DIR/as-ref.rs:8:37 @@ -16,9 +13,6 @@ LL | opt.and_then(|arg| Some(takes_ref(arg))); | -------- ^^^ expected &Foo, found struct `Foo` | | | help: consider using `as_ref` instead: `as_ref().and_then` - | - = note: expected reference `&Foo` - found struct `Foo` error[E0308]: mismatched types --> $DIR/as-ref.rs:11:27 @@ -27,9 +21,6 @@ LL | opt.map(|arg| takes_ref(arg)); | --- ^^^ expected &Foo, found struct `Foo` | | | help: consider using `as_ref` instead: `as_ref().map` - | - = note: expected reference `&Foo` - found struct `Foo` error[E0308]: mismatched types --> $DIR/as-ref.rs:13:35 @@ -38,9 +29,6 @@ LL | opt.and_then(|arg| Ok(takes_ref(arg))); | -------- ^^^ expected &Foo, found struct `Foo` | | | help: consider using `as_ref` instead: `as_ref().and_then` - | - = note: expected reference `&Foo` - found struct `Foo` error[E0308]: mismatched types --> $DIR/as-ref.rs:16:27 diff --git a/src/test/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr b/src/test/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr index 66f6bf91cc2..7ec1daacb61 100644 --- a/src/test/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr +++ b/src/test/ui/suggestions/dont-suggest-deref-inside-macro-issue-58298.stderr @@ -9,8 +9,6 @@ LL | | }; | |______expected &str, found struct `std::string::String` | in this macro invocation | - = note: expected reference `&str` - found struct `std::string::String` = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) error: aborting due to previous error diff --git a/src/test/ui/suggestions/format-borrow.stderr b/src/test/ui/suggestions/format-borrow.stderr index 7f1cec2d218..d43a249d9cc 100644 --- a/src/test/ui/suggestions/format-borrow.stderr +++ b/src/test/ui/suggestions/format-borrow.stderr @@ -4,11 +4,8 @@ error[E0308]: mismatched types LL | let a: String = &String::from("a"); | ^^^^^^^^^^^^^^^^^^ | | - | expected struct `std::string::String`, found reference + | expected struct `std::string::String`, found &std::string::String | help: consider removing the borrow: `String::from("a")` - | - = note: expected struct `std::string::String` - found reference `&std::string::String` error[E0308]: mismatched types --> $DIR/format-borrow.rs:4:21 @@ -16,11 +13,8 @@ error[E0308]: mismatched types LL | let b: String = &format!("b"); | ^^^^^^^^^^^^^ | | - | expected struct `std::string::String`, found reference + | expected struct `std::string::String`, found &std::string::String | help: consider removing the borrow: `format!("b")` - | - = note: expected struct `std::string::String` - found reference `&std::string::String` error: aborting due to 2 previous errors diff --git a/src/test/ui/suggestions/issue-52820.stderr b/src/test/ui/suggestions/issue-52820.stderr index 0b064d19675..ba7457df069 100644 --- a/src/test/ui/suggestions/issue-52820.stderr +++ b/src/test/ui/suggestions/issue-52820.stderr @@ -6,9 +6,6 @@ LL | guts, | | | expected struct `std::string::String`, found &str | help: try using a conversion method: `guts: guts.to_string()` - | - = note: expected struct `std::string::String` - found reference `&str` error[E0308]: mismatched types --> $DIR/issue-52820.rs:10:17 @@ -18,9 +15,6 @@ LL | brains: guts.clone(), | | | expected struct `std::string::String`, found &str | help: try using a conversion method: `guts.to_string()` - | - = note: expected struct `std::string::String` - found reference `&str` error: aborting due to 2 previous errors diff --git a/src/test/ui/suggestions/issue-59819.stderr b/src/test/ui/suggestions/issue-59819.stderr index b04ab374f0f..331a6a53b12 100644 --- a/src/test/ui/suggestions/issue-59819.stderr +++ b/src/test/ui/suggestions/issue-59819.stderr @@ -6,9 +6,6 @@ LL | let y: i32 = x; | | | expected i32, found struct `Foo` | help: consider dereferencing the type: `*x` - | - = note: expected type `i32` - found struct `Foo` error[E0308]: mismatched types --> $DIR/issue-59819.rs:30:18 @@ -18,9 +15,6 @@ LL | let b: i32 = a; | | | expected i32, found &{integer} | help: consider dereferencing the borrow: `*a` - | - = note: expected type `i32` - found reference `&{integer}` error[E0308]: mismatched types --> $DIR/issue-59819.rs:34:21 @@ -30,9 +24,6 @@ LL | let g: String = f; | | | expected struct `std::string::String`, found struct `Bar` | help: try using a conversion method: `f.to_string()` - | - = note: expected struct `std::string::String` - found struct `Bar` error: aborting due to 3 previous errors diff --git a/src/test/ui/suggestions/match-needing-semi.stderr b/src/test/ui/suggestions/match-needing-semi.stderr index eccd9d01fec..c9e263d0db8 100644 --- a/src/test/ui/suggestions/match-needing-semi.stderr +++ b/src/test/ui/suggestions/match-needing-semi.stderr @@ -12,9 +12,6 @@ LL | | } | | -- help: consider using a semicolon here | |_____| | expected this to be `()` - | - = note: expected unit type `()` - found type `{integer}` error[E0308]: mismatched types --> $DIR/match-needing-semi.rs:12:5 @@ -27,9 +24,6 @@ LL | | } | | ^- help: consider using a semicolon here | |_____| | expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error: aborting due to 2 previous errors diff --git a/src/test/ui/suggestions/recover-from-semicolon-trailing-item.stderr b/src/test/ui/suggestions/recover-from-semicolon-trailing-item.stderr index 36548a3dfcb..44c07a7c83a 100644 --- a/src/test/ui/suggestions/recover-from-semicolon-trailing-item.stderr +++ b/src/test/ui/suggestions/recover-from-semicolon-trailing-item.stderr @@ -23,27 +23,18 @@ error[E0308]: mismatched types | LL | let _: usize = S {}; | ^^^^ expected usize, found struct `S` - | - = note: expected type `usize` - found struct `S` error[E0308]: mismatched types --> $DIR/recover-from-semicolon-trailing-item.rs:12:20 | LL | let _: usize = X {}; | ^^^^ expected usize, found struct `main::X` - | - = note: expected type `usize` - found struct `main::X` error[E0308]: mismatched types --> $DIR/recover-from-semicolon-trailing-item.rs:14:9 | LL | foo(""); - | ^^ expected usize, found reference - | - = note: expected type `usize` - found reference `&'static str` + | ^^ expected usize, found &str error: aborting due to 6 previous errors diff --git a/src/test/ui/switched-expectations.stderr b/src/test/ui/switched-expectations.stderr index b38c0d93099..d65adea1ed4 100644 --- a/src/test/ui/switched-expectations.stderr +++ b/src/test/ui/switched-expectations.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | let ref string: String = var; | ^^^ expected struct `std::string::String`, found i32 - | - = note: expected struct `std::string::String` - found type `i32` error: aborting due to previous error diff --git a/src/test/ui/terminal-width/non-whitespace-trimming-2.stderr b/src/test/ui/terminal-width/non-whitespace-trimming-2.stderr index fca72817d65..5e49fcdf95a 100644 --- a/src/test/ui/terminal-width/non-whitespace-trimming-2.stderr +++ b/src/test/ui/terminal-width/non-whitespace-trimming-2.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | ...; let _: usize = 14; let _: usize = 15; let _: () = 42; let _: usize = 0; let _: usize = 1; let _: usize = 2; let _: usize = 3; let _:... | ^^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error: aborting due to previous error diff --git a/src/test/ui/terminal-width/non-whitespace-trimming-unicode.stderr b/src/test/ui/terminal-width/non-whitespace-trimming-unicode.stderr index e1b73104521..cea937ca8b1 100644 --- a/src/test/ui/terminal-width/non-whitespace-trimming-unicode.stderr +++ b/src/test/ui/terminal-width/non-whitespace-trimming-unicode.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | ...♯♰♱♲♳♴♵♶♷♸♹♺♻♼♽♾♿⚀⚁⚂⚃⚄⚅⚆⚈⚉4"; let _: () = 42; let _: &str = "🦀☀☁☂☃☄★☆☇☈☉☊☋☌☍☎☏☐☑☒☓ ☖☗☘☙☚☛☜☝☞☟☠☡☢☣☤☥☦☧☨☩☪☫☬☭☮☯☰☱☲☳☴☵☶☷☸☹☺☻☼☽☾☿♀♁♂♃♄♅♆... | ^^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error: aborting due to previous error diff --git a/src/test/ui/terminal-width/non-whitespace-trimming.stderr b/src/test/ui/terminal-width/non-whitespace-trimming.stderr index 72b1502fbf2..b024d2ace37 100644 --- a/src/test/ui/terminal-width/non-whitespace-trimming.stderr +++ b/src/test/ui/terminal-width/non-whitespace-trimming.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | ...) = (); let _: () = (); let _: () = (); let _: () = 42; let _: () = (); let _: () = (); let _: () = (); let _: () = (); let _: () = ()... | ^^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error: aborting due to previous error diff --git a/src/test/ui/terminal-width/whitespace-trimming-2.stderr b/src/test/ui/terminal-width/whitespace-trimming-2.stderr index dae00b902dc..3013019df26 100644 --- a/src/test/ui/terminal-width/whitespace-trimming-2.stderr +++ b/src/test/ui/terminal-width/whitespace-trimming-2.stderr @@ -5,9 +5,6 @@ LL | ...-> usize { | ----- expected `usize` because of return type LL | ... () | ^^ expected usize, found () - | - = note: expected type `usize` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/terminal-width/whitespace-trimming.stderr b/src/test/ui/terminal-width/whitespace-trimming.stderr index 4a1f8f6f846..d3064d8bfb9 100644 --- a/src/test/ui/terminal-width/whitespace-trimming.stderr +++ b/src/test/ui/terminal-width/whitespace-trimming.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | ... let _: () = 42; | ^^ expected (), found integer - | - = note: expected unit type `()` - found type `{integer}` error: aborting due to previous error diff --git a/src/test/ui/terr-in-field.rs b/src/test/ui/terr-in-field.rs index 80834985471..aa801fd0a6c 100644 --- a/src/test/ui/terr-in-field.rs +++ b/src/test/ui/terr-in-field.rs @@ -12,8 +12,6 @@ fn want_foo(f: Foo) {} fn have_bar(b: Bar) { want_foo(b); //~ ERROR mismatched types //~| expected struct `Foo`, found struct `Bar` - //~| expected struct `Foo` - //~| found struct `Bar` } fn main() {} diff --git a/src/test/ui/terr-in-field.stderr b/src/test/ui/terr-in-field.stderr index ef6412a633b..5c6859a0efe 100644 --- a/src/test/ui/terr-in-field.stderr +++ b/src/test/ui/terr-in-field.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | want_foo(b); | ^ expected struct `Foo`, found struct `Bar` - | - = note: expected struct `Foo` - found struct `Bar` error: aborting due to previous error diff --git a/src/test/ui/traits/traits-assoc-type-in-supertrait-bad.stderr b/src/test/ui/traits/traits-assoc-type-in-supertrait-bad.stderr index 44643e8c8de..19374ba49c5 100644 --- a/src/test/ui/traits/traits-assoc-type-in-supertrait-bad.stderr +++ b/src/test/ui/traits/traits-assoc-type-in-supertrait-bad.stderr @@ -3,9 +3,6 @@ error[E0271]: type mismatch resolving ` as std::iter::It | LL | impl Foo for IntoIter { | ^^^ expected i32, found u32 - | - = note: expected type `i32` - found type `u32` error: aborting due to previous error diff --git a/src/test/ui/try-block/try-block-bad-type.stderr b/src/test/ui/try-block/try-block-bad-type.stderr index 722b7a3b60a..75ff998d3bf 100644 --- a/src/test/ui/try-block/try-block-bad-type.stderr +++ b/src/test/ui/try-block/try-block-bad-type.stderr @@ -18,18 +18,12 @@ error[E0271]: type mismatch resolving ` as std::op | LL | "" | ^^ expected i32, found &str - | - = note: expected type `i32` - found reference `&str` error[E0271]: type mismatch resolving ` as std::ops::Try>::Ok == ()` --> $DIR/try-block-bad-type.rs:15:39 | LL | let res: Result = try { }; | ^ expected i32, found () - | - = note: expected type `i32` - found unit type `()` error[E0277]: the trait bound `(): std::ops::Try` is not satisfied --> $DIR/try-block-bad-type.rs:17:23 diff --git a/src/test/ui/try-block/try-block-type-error.stderr b/src/test/ui/try-block/try-block-type-error.stderr index 0dd81d8e152..63f2c02bc71 100644 --- a/src/test/ui/try-block/try-block-type-error.stderr +++ b/src/test/ui/try-block/try-block-type-error.stderr @@ -6,18 +6,12 @@ LL | 42 | | | expected f32, found integer | help: use a float literal: `42.0` - | - = note: expected type `f32` - found type `{integer}` error[E0271]: type mismatch resolving ` as std::ops::Try>::Ok == ()` --> $DIR/try-block-type-error.rs:16:5 | LL | }; | ^ expected i32, found () - | - = note: expected type `i32` - found unit type `()` error: aborting due to 2 previous errors diff --git a/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr b/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr index e6e82f49692..a1afd5e9a0e 100644 --- a/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr +++ b/src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr @@ -12,9 +12,6 @@ error[E0308]: mismatched types | LL | let _: u8 = ::V; | ^^^^^^^ expected u8, found enum `E2` - | - = note: expected type `u8` - found enum `E2` error: aborting due to 2 previous errors diff --git a/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.stderr b/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.stderr index 0a6d454a67f..5411456b34b 100644 --- a/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.stderr +++ b/src/test/ui/type-alias-impl-trait/never_reveal_concrete_type.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/never_reveal_concrete_type.rs:13:27 | LL | let _: &'static str = x; - | ^ expected reference, found opaque type + | ^ expected &str, found opaque type | = note: expected reference `&'static str` found opaque type `NoReveal` diff --git a/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr b/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr index 366d6bad37a..aaf5e286643 100644 --- a/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr +++ b/src/test/ui/type-alias-impl-trait/no_revealing_outside_defining_module.stderr @@ -13,7 +13,7 @@ error[E0308]: mismatched types LL | fn bomp() -> boo::Boo { | -------- expected `Boo` because of return type LL | "" - | ^^ expected opaque type, found reference + | ^^ expected opaque type, found &str | = note: expected opaque type `Boo` found reference `&'static str` diff --git a/src/test/ui/type/type-ascription-precedence.stderr b/src/test/ui/type/type-ascription-precedence.stderr index ebb9c4199dc..5f42ed228dd 100644 --- a/src/test/ui/type/type-ascription-precedence.stderr +++ b/src/test/ui/type/type-ascription-precedence.stderr @@ -3,18 +3,12 @@ error[E0308]: mismatched types | LL | &(S: &S); | ^ expected &S, found struct `S` - | - = note: expected reference `&S` - found struct `S` error[E0308]: mismatched types --> $DIR/type-ascription-precedence.rs:35:7 | LL | *(S: Z); | ^ expected struct `Z`, found struct `S` - | - = note: expected struct `Z` - found struct `S` error[E0614]: type `Z` cannot be dereferenced --> $DIR/type-ascription-precedence.rs:35:5 @@ -27,9 +21,6 @@ error[E0308]: mismatched types | LL | -(S: Z); | ^ expected struct `Z`, found struct `S` - | - = note: expected struct `Z` - found struct `S` error[E0600]: cannot apply unary operator `-` to type `Z` --> $DIR/type-ascription-precedence.rs:40:5 @@ -44,18 +35,12 @@ error[E0308]: mismatched types | LL | (S + Z): Z; | ^^^^^^^ expected struct `Z`, found struct `S` - | - = note: expected struct `Z` - found struct `S` error[E0308]: mismatched types --> $DIR/type-ascription-precedence.rs:49:5 | LL | (S * Z): Z; | ^^^^^^^ expected struct `Z`, found struct `S` - | - = note: expected struct `Z` - found struct `S` error[E0308]: mismatched types --> $DIR/type-ascription-precedence.rs:53:5 diff --git a/src/test/ui/type/type-ascription-soundness.stderr b/src/test/ui/type/type-ascription-soundness.stderr index d8803cad011..6ed940823af 100644 --- a/src/test/ui/type/type-ascription-soundness.stderr +++ b/src/test/ui/type/type-ascription-soundness.stderr @@ -2,7 +2,7 @@ error[E0308]: mismatched types --> $DIR/type-ascription-soundness.rs:7:17 | LL | let ref x = arr: &[u8]; - | ^^^ expected slice, found array of 3 elements + | ^^^ expected slice `[u8]`, found array `[u8; 3]` | = note: expected reference `&[u8]` found reference `&[u8; 3]` @@ -11,7 +11,7 @@ error[E0308]: mismatched types --> $DIR/type-ascription-soundness.rs:8:21 | LL | let ref mut x = arr: &[u8]; - | ^^^ expected slice, found array of 3 elements + | ^^^ expected slice `[u8]`, found array `[u8; 3]` | = note: expected reference `&[u8]` found reference `&[u8; 3]` @@ -20,7 +20,7 @@ error[E0308]: mismatched types --> $DIR/type-ascription-soundness.rs:9:11 | LL | match arr: &[u8] { - | ^^^ expected slice, found array of 3 elements + | ^^^ expected slice `[u8]`, found array `[u8; 3]` | = note: expected reference `&[u8]` found reference `&[u8; 3]` @@ -29,7 +29,7 @@ error[E0308]: mismatched types --> $DIR/type-ascription-soundness.rs:12:17 | LL | let _len = (arr: &[u8]).len(); - | ^^^ expected slice, found array of 3 elements + | ^^^ expected slice `[u8]`, found array `[u8; 3]` | = note: expected reference `&[u8]` found reference `&[u8; 3]` diff --git a/src/test/ui/type/type-check/assignment-expected-bool.stderr b/src/test/ui/type/type-check/assignment-expected-bool.stderr index c6b42afa513..f210fd62d7d 100644 --- a/src/test/ui/type/type-check/assignment-expected-bool.stderr +++ b/src/test/ui/type/type-check/assignment-expected-bool.stderr @@ -6,9 +6,6 @@ LL | let _: bool = 0 = 0; | | | expected bool, found () | help: try comparing for equality: `0 == 0` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-expected-bool.rs:9:14 @@ -18,9 +15,6 @@ LL | 0 => 0 = 0, | | | expected bool, found () | help: try comparing for equality: `0 == 0` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-expected-bool.rs:10:14 @@ -30,9 +24,6 @@ LL | _ => 0 = 0, | | | expected bool, found () | help: try comparing for equality: `0 == 0` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-expected-bool.rs:14:17 @@ -42,9 +33,6 @@ LL | true => 0 = 0, | | | expected bool, found () | help: try comparing for equality: `0 == 0` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-expected-bool.rs:18:8 @@ -54,9 +42,6 @@ LL | if 0 = 0 {} | | | expected bool, found () | help: try comparing for equality: `0 == 0` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-expected-bool.rs:20:24 @@ -66,9 +51,6 @@ LL | let _: bool = if { 0 = 0 } { | | | expected bool, found () | help: try comparing for equality: `0 == 0` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-expected-bool.rs:21:9 @@ -78,9 +60,6 @@ LL | 0 = 0 | | | expected bool, found () | help: try comparing for equality: `0 == 0` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-expected-bool.rs:23:9 @@ -90,9 +69,6 @@ LL | 0 = 0 | | | expected bool, found () | help: try comparing for equality: `0 == 0` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-expected-bool.rs:26:13 @@ -102,9 +78,6 @@ LL | let _ = (0 = 0) | | | expected bool, found () | help: try comparing for equality: `0 == 0` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-expected-bool.rs:27:14 @@ -114,9 +87,6 @@ LL | && { 0 = 0 } | | | expected bool, found () | help: try comparing for equality: `0 == 0` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-expected-bool.rs:28:12 @@ -126,9 +96,6 @@ LL | || (0 = 0); | | | expected bool, found () | help: try comparing for equality: `0 == 0` - | - = note: expected type `bool` - found unit type `()` error[E0070]: invalid left-hand side expression --> $DIR/assignment-expected-bool.rs:31:20 @@ -141,9 +108,6 @@ error[E0308]: mismatched types | LL | let _: usize = 0 = 0; | ^^^^^ expected usize, found () - | - = note: expected type `usize` - found unit type `()` error: aborting due to 13 previous errors 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 05280aab2dd..789902bbb94 100644 --- a/src/test/ui/type/type-check/assignment-in-if.stderr +++ b/src/test/ui/type/type-check/assignment-in-if.stderr @@ -6,9 +6,6 @@ LL | if x = x { | | | expected bool, found () | help: try comparing for equality: `x == x` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-in-if.rs:20:8 @@ -18,9 +15,6 @@ LL | if (x = x) { | | | expected bool, found () | help: try comparing for equality: `x == x` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-in-if.rs:25:8 @@ -30,9 +24,6 @@ LL | if y = (Foo { foo: x }) { | | | expected bool, found () | help: try comparing for equality: `y == (Foo { foo: x })` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-in-if.rs:30:8 @@ -42,9 +33,6 @@ LL | if 3 = x { | | | expected bool, found () | help: try comparing for equality: `3 == x` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-in-if.rs:36:13 @@ -54,9 +42,6 @@ LL | x = 4 | | | expected bool, found () | help: try comparing for equality: `x == 4` - | - = note: expected type `bool` - found unit type `()` error[E0308]: mismatched types --> $DIR/assignment-in-if.rs:38:13 @@ -66,9 +51,6 @@ LL | x = 5 | | | expected bool, found () | help: try comparing for equality: `x == 5` - | - = note: expected type `bool` - found unit type `()` error: aborting due to 6 previous errors diff --git a/src/test/ui/type/type-error-break-tail.stderr b/src/test/ui/type/type-error-break-tail.stderr index 47416c4f911..720bde93711 100644 --- a/src/test/ui/type/type-error-break-tail.stderr +++ b/src/test/ui/type/type-error-break-tail.stderr @@ -9,9 +9,6 @@ LL | if false { break; } | | | expected i32, found () | help: give it a value of the expected type: `break 42` - | - = note: expected type `i32` - found unit type `()` error: aborting due to previous error diff --git a/src/test/ui/type/type-mismatch-multiple.rs b/src/test/ui/type/type-mismatch-multiple.rs index b8f04ca8d4a..6270ee64713 100644 --- a/src/test/ui/type/type-mismatch-multiple.rs +++ b/src/test/ui/type/type-mismatch-multiple.rs @@ -2,8 +2,6 @@ fn main() { let a: bool = 1; let b: i32 = true; } //~^ ERROR mismatched types -//~| expected type `bool` -//~| found type `{integer}` //~| expected bool, found integer //~| ERROR mismatched types //~| expected i32, found bool diff --git a/src/test/ui/type/type-mismatch-multiple.stderr b/src/test/ui/type/type-mismatch-multiple.stderr index 8f6b23ea091..6de8a056978 100644 --- a/src/test/ui/type/type-mismatch-multiple.stderr +++ b/src/test/ui/type/type-mismatch-multiple.stderr @@ -3,9 +3,6 @@ error[E0308]: mismatched types | LL | fn main() { let a: bool = 1; let b: i32 = true; } | ^ expected bool, found integer - | - = note: expected type `bool` - found type `{integer}` error[E0308]: mismatched types --> $DIR/type-mismatch-multiple.rs:3:43 diff --git a/src/test/ui/type/type-mismatch-same-crate-name.rs b/src/test/ui/type/type-mismatch-same-crate-name.rs index 88daffde504..b1f9a28e16d 100644 --- a/src/test/ui/type/type-mismatch-same-crate-name.rs +++ b/src/test/ui/type/type-mismatch-same-crate-name.rs @@ -17,8 +17,6 @@ fn main() { //~^ ERROR mismatched types //~| Perhaps two different versions of crate `crate_a1` //~| expected struct `main::a::Foo` - //~| expected struct `main::a::Foo` - //~| found struct `main::a::Foo` a::try_bar(bar2); //~^ ERROR mismatched types //~| Perhaps two different versions of crate `crate_a1` diff --git a/src/test/ui/type/type-mismatch-same-crate-name.stderr b/src/test/ui/type/type-mismatch-same-crate-name.stderr index db53344a07e..91bbe9c1fbe 100644 --- a/src/test/ui/type/type-mismatch-same-crate-name.stderr +++ b/src/test/ui/type/type-mismatch-same-crate-name.stderr @@ -4,8 +4,6 @@ error[E0308]: mismatched types LL | a::try_foo(foo2); | ^^^^ expected struct `main::a::Foo`, found a different struct `main::a::Foo` | - = note: expected struct `main::a::Foo` (struct `main::a::Foo`) - found struct `main::a::Foo` (struct `main::a::Foo`) note: Perhaps two different versions of crate `crate_a1` are being used? --> $DIR/type-mismatch-same-crate-name.rs:16:20 | @@ -13,7 +11,7 @@ LL | a::try_foo(foo2); | ^^^^ error[E0308]: mismatched types - --> $DIR/type-mismatch-same-crate-name.rs:22:20 + --> $DIR/type-mismatch-same-crate-name.rs:20:20 | LL | a::try_bar(bar2); | ^^^^ expected trait `main::a::Bar`, found a different trait `main::a::Bar` @@ -21,7 +19,7 @@ LL | a::try_bar(bar2); = note: expected struct `std::boxed::Box<(dyn main::a::Bar + 'static)>` found struct `std::boxed::Box` note: Perhaps two different versions of crate `crate_a1` are being used? - --> $DIR/type-mismatch-same-crate-name.rs:22:20 + --> $DIR/type-mismatch-same-crate-name.rs:20:20 | LL | a::try_bar(bar2); | ^^^^ diff --git a/src/test/ui/type/type-mismatch.stderr b/src/test/ui/type/type-mismatch.stderr index 2d9481e5a41..e6016bdef18 100644 --- a/src/test/ui/type/type-mismatch.stderr +++ b/src/test/ui/type/type-mismatch.stderr @@ -3,18 +3,12 @@ error[E0308]: mismatched types | LL | want::(f); | ^ expected struct `foo`, found usize - | - = note: expected struct `foo` - found type `usize` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:18:17 | LL | want::(f); | ^ expected struct `bar`, found usize - | - = note: expected struct `bar` - found type `usize` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:19:24 @@ -75,18 +69,12 @@ error[E0308]: mismatched types | LL | want::(f); | ^ expected usize, found struct `foo` - | - = note: expected type `usize` - found struct `foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:29:17 | LL | want::(f); | ^ expected struct `bar`, found struct `foo` - | - = note: expected struct `bar` - found struct `foo` error[E0308]: mismatched types --> $DIR/type-mismatch.rs:30:24 @@ -230,7 +218,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:48:26 | LL | want::<&Foo>(f); - | ^ expected reference, found struct `Foo` + | ^ expected &Foo, found struct `Foo` | = note: expected reference `&Foo` found struct `Foo` @@ -322,7 +310,7 @@ error[E0308]: mismatched types LL | want::<&Foo>(f); | ^ | | - | expected reference, found struct `Foo` + | expected &Foo, found struct `Foo` | help: consider borrowing here: `&f` | = note: expected reference `&Foo` @@ -422,7 +410,7 @@ error[E0308]: mismatched types --> $DIR/type-mismatch.rs:75:26 | LL | want::<&Foo>(f); - | ^ expected reference, found struct `Foo` + | ^ expected &Foo, found struct `Foo` | = note: expected reference `&Foo` found struct `Foo` diff --git a/src/test/ui/type/type-shadow.stderr b/src/test/ui/type/type-shadow.stderr index 56185e048a3..70be30ed53e 100644 --- a/src/test/ui/type/type-shadow.stderr +++ b/src/test/ui/type/type-shadow.stderr @@ -2,10 +2,7 @@ error[E0308]: mismatched types --> $DIR/type-shadow.rs:6:20 | LL | let y: Y = "hello"; - | ^^^^^^^ expected isize, found reference - | - = note: expected type `isize` - found reference `&'static str` + | ^^^^^^^ expected isize, found &str error: aborting due to previous error diff --git a/src/test/ui/wrong-mul-method-signature.stderr b/src/test/ui/wrong-mul-method-signature.stderr index 61c976b773a..fb21980805f 100644 --- a/src/test/ui/wrong-mul-method-signature.stderr +++ b/src/test/ui/wrong-mul-method-signature.stderr @@ -30,18 +30,12 @@ error[E0308]: mismatched types | LL | let x: Vec2 = Vec2 { x: 1.0, y: 2.0 } * 2.0; // trait had reversed order | ^^^ expected struct `Vec2`, found floating-point number - | - = note: expected struct `Vec2` - found type `{float}` error[E0308]: mismatched types --> $DIR/wrong-mul-method-signature.rs:63:19 | LL | let x: Vec2 = Vec2 { x: 1.0, y: 2.0 } * 2.0; // trait had reversed order | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `Vec2`, found f64 - | - = note: expected struct `Vec2` - found type `f64` error: aborting due to 5 previous errors