]> git.lizzy.rs Git - rust.git/commitdiff
Implementation for 65853
authorJack Huey <31162821+jackh726@users.noreply.github.com>
Sat, 22 Jan 2022 04:50:54 +0000 (23:50 -0500)
committerJack Huey <31162821+jackh726@users.noreply.github.com>
Sat, 16 Apr 2022 06:26:56 +0000 (02:26 -0400)
This attempts to bring better error messages to invalid method calls, by applying some heuristics to identify common mistakes.

The algorithm is inspired by Levenshtein distance and longest common sub-sequence.   In essence, we treat the types of the function, and the types of the arguments you provided as two "words" and compute the edits to get from one to the other.

We then modify that algorithm to detect 4 cases:

 - A function input is missing
 - An extra argument was provided
 - The type of an argument is straight up invalid
 - Two arguments have been swapped
 - A subset of the arguments have been shuffled

(We detect the last two as separate cases so that we can detect two swaps, instead of 4 parameters permuted.)

It helps to understand this argument by paying special attention to terminology: "inputs" refers to the inputs being *expected* by the function, and "arguments" refers to what has been provided at the call site.

The basic sketch of the algorithm is as follows:

 - Construct a boolean grid, with a row for each argument, and a column for each input.  The cell [i, j] is true if the i'th argument could satisfy the j'th input.
 - If we find an argument that could satisfy no inputs, provided for an input that can't be satisfied by any other argument, we consider this an "invalid type".
 - Extra arguments are those that can't satisfy any input, provided for an input that *could* be satisfied by another argument.
 - Missing inputs are inputs that can't be satisfied by any argument, where the provided argument could satisfy another input
 - Swapped / Permuted arguments are identified with a cycle detection algorithm.

As each issue is found, we remove the relevant inputs / arguments and check for more issues.  If we find no issues, we match up any "valid" arguments, and start again.

Note that there's a lot of extra complexity:
 - We try to stay efficient on the happy path, only computing the diagonal until we find a problem, and then filling in the rest of the matrix.
 - Closure arguments are wrapped in a tuple and need to be unwrapped
 - We need to resolve closure types after the rest, to allow the most specific type constraints
 - We need to handle imported C functions that might be variadic in their inputs.

I tried to document a lot of this in comments in the code and keep the naming clear.

180 files changed:
compiler/rustc_infer/src/infer/error_reporting/mod.rs
compiler/rustc_infer/src/infer/mod.rs
compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
compiler/rustc_typeck/src/check/coercion.rs
compiler/rustc_typeck/src/check/compare_method.rs
compiler/rustc_typeck/src/check/demand.rs
compiler/rustc_typeck/src/check/expr.rs
compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs
compiler/rustc_typeck/src/check/fn_ctxt/arg_matrix.rs [new file with mode: 0644]
compiler/rustc_typeck/src/check/fn_ctxt/checks.rs
compiler/rustc_typeck/src/check/fn_ctxt/mod.rs
compiler/rustc_typeck/src/lib.rs
src/test/ui/arg-count-mismatch.rs [deleted file]
src/test/ui/arg-count-mismatch.stderr [deleted file]
src/test/ui/arg-type-mismatch.rs [deleted file]
src/test/ui/arg-type-mismatch.stderr [deleted file]
src/test/ui/argument-suggestions/basic.rs [new file with mode: 0644]
src/test/ui/argument-suggestions/basic.stderr [new file with mode: 0644]
src/test/ui/argument-suggestions/complex.rs [new file with mode: 0644]
src/test/ui/argument-suggestions/complex.stderr [new file with mode: 0644]
src/test/ui/argument-suggestions/extra_arguments.rs [new file with mode: 0644]
src/test/ui/argument-suggestions/extra_arguments.stderr [new file with mode: 0644]
src/test/ui/argument-suggestions/invalid_arguments.rs [new file with mode: 0644]
src/test/ui/argument-suggestions/invalid_arguments.stderr [new file with mode: 0644]
src/test/ui/argument-suggestions/missing_arguments.rs [new file with mode: 0644]
src/test/ui/argument-suggestions/missing_arguments.stderr [new file with mode: 0644]
src/test/ui/argument-suggestions/mixed_cases.rs [new file with mode: 0644]
src/test/ui/argument-suggestions/mixed_cases.stderr [new file with mode: 0644]
src/test/ui/argument-suggestions/permuted_arguments.rs [new file with mode: 0644]
src/test/ui/argument-suggestions/permuted_arguments.stderr [new file with mode: 0644]
src/test/ui/argument-suggestions/swapped_arguments.rs [new file with mode: 0644]
src/test/ui/argument-suggestions/swapped_arguments.stderr [new file with mode: 0644]
src/test/ui/associated-types/associated-type-projection-from-supertrait.stderr
src/test/ui/associated-types/associated-types-path-2.stderr
src/test/ui/async-await/dont-suggest-missing-await.stderr
src/test/ui/async-await/generator-desc.stderr
src/test/ui/async-await/suggest-missing-await-closure.stderr
src/test/ui/async-await/suggest-missing-await.stderr
src/test/ui/c-variadic/variadic-ffi-1.stderr
src/test/ui/cast/cast-int-to-char.stderr
src/test/ui/closures/closure-reform-bad.stderr
src/test/ui/closures/issue-84128.stderr
src/test/ui/closures/issue-87461.stderr
src/test/ui/coercion/coerce-mut.stderr
src/test/ui/coercion/coerce-reborrow-multi-arg-fail.stderr
src/test/ui/coercion/coerce-to-bang.stderr
src/test/ui/const-generics/const-argument-cross-crate-mismatch.min.stderr [new file with mode: 0644]
src/test/ui/const-generics/const-argument-cross-crate-mismatch.stderr
src/test/ui/const-generics/generic_const_exprs/issue-62504.min.stderr
src/test/ui/did_you_mean/issue-42764.stderr
src/test/ui/disambiguate-identical-names.stderr
src/test/ui/error-codes/E0057.stderr
src/test/ui/error-codes/E0060.rs
src/test/ui/error-codes/E0060.stderr
src/test/ui/error-codes/E0061.rs
src/test/ui/error-codes/E0061.stderr
src/test/ui/estr-subtyping.rs [new file with mode: 0644]
src/test/ui/estr-subtyping.stderr [new file with mode: 0644]
src/test/ui/fmt/ifmt-bad-arg.stderr
src/test/ui/fn/fn-item-type.rs
src/test/ui/fn/fn-item-type.stderr
src/test/ui/generic-associated-types/issue-68648-2.stderr
src/test/ui/generic-associated-types/missing-bounds.stderr
src/test/ui/hrtb/issue-58451.stderr
src/test/ui/impl-trait/issues/issue-74282.stderr
src/test/ui/indexing-requires-a-uint.stderr
src/test/ui/inference/deref-suggestion.stderr
src/test/ui/inference/tutorial-suffix-inference-test.stderr
src/test/ui/issues/issue-10764.stderr
src/test/ui/issues/issue-11374.stderr
src/test/ui/issues/issue-12997-2.stderr
src/test/ui/issues/issue-13359.stderr
src/test/ui/issues/issue-13853.stderr
src/test/ui/issues/issue-1448-2.stderr
src/test/ui/issues/issue-15783.stderr
src/test/ui/issues/issue-16939.stderr
src/test/ui/issues/issue-17033.stderr
src/test/ui/issues/issue-18819.stderr
src/test/ui/issues/issue-24819.stderr
src/test/ui/issues/issue-26094.rs
src/test/ui/issues/issue-26094.stderr
src/test/ui/issues/issue-3044.rs
src/test/ui/issues/issue-3044.stderr
src/test/ui/issues/issue-43420-no-over-suggest.stderr
src/test/ui/issues/issue-4517.stderr
src/test/ui/issues/issue-46756-consider-borrowing-cast-or-binexpr.stderr
src/test/ui/issues/issue-48364.stderr
src/test/ui/issues/issue-4935.stderr
src/test/ui/issues/issue-51154.stderr
src/test/ui/issues/issue-5216.stderr
src/test/ui/issues/issue-61106.stderr
src/test/ui/issues/issue-69306.stderr
src/test/ui/macros/issue-29084.stderr
src/test/ui/methods/method-call-err-msg.stderr
src/test/ui/methods/method-self-arg-1.stderr
src/test/ui/mismatched_types/issue-26480.stderr
src/test/ui/mismatched_types/issue-35030.stderr
src/test/ui/mismatched_types/numeric-literal-cast.stderr
src/test/ui/mismatched_types/overloaded-calls-bad.rs
src/test/ui/mismatched_types/overloaded-calls-bad.stderr
src/test/ui/mismatched_types/trait-bounds-cant-coerce.stderr
src/test/ui/mut/mut-cross-borrowing.stderr
src/test/ui/never_type/call-fn-never-arg-wrong-type.stderr
src/test/ui/not-enough-arguments.stderr
src/test/ui/numeric/integer-literal-suffix-inference.stderr
src/test/ui/numeric/len.stderr
src/test/ui/numeric/numeric-cast-without-suggestion.stderr
src/test/ui/numeric/numeric-cast.stderr
src/test/ui/numeric/numeric-suffix.fixed [deleted file]
src/test/ui/numeric/numeric-suffix.rs [deleted file]
src/test/ui/numeric/numeric-suffix.stderr [deleted file]
src/test/ui/numeric/numeric-suffix/numeric-suffix-i32.fixed [new file with mode: 0644]
src/test/ui/numeric/numeric-suffix/numeric-suffix-i32.rs [new file with mode: 0644]
src/test/ui/numeric/numeric-suffix/numeric-suffix-i32.stderr [new file with mode: 0644]
src/test/ui/numeric/numeric-suffix/numeric-suffix-i64.fixed [new file with mode: 0644]
src/test/ui/numeric/numeric-suffix/numeric-suffix-i64.rs [new file with mode: 0644]
src/test/ui/numeric/numeric-suffix/numeric-suffix-i64.stderr [new file with mode: 0644]
src/test/ui/numeric/numeric-suffix/numeric-suffix-isize.fixed [new file with mode: 0644]
src/test/ui/numeric/numeric-suffix/numeric-suffix-isize.rs [new file with mode: 0644]
src/test/ui/numeric/numeric-suffix/numeric-suffix-isize.stderr [new file with mode: 0644]
src/test/ui/numeric/numeric-suffix/numeric-suffix-u32.fixed [new file with mode: 0644]
src/test/ui/numeric/numeric-suffix/numeric-suffix-u32.rs [new file with mode: 0644]
src/test/ui/numeric/numeric-suffix/numeric-suffix-u32.stderr [new file with mode: 0644]
src/test/ui/numeric/numeric-suffix/numeric-suffix-u64.fixed [new file with mode: 0644]
src/test/ui/numeric/numeric-suffix/numeric-suffix-u64.rs [new file with mode: 0644]
src/test/ui/numeric/numeric-suffix/numeric-suffix-u64.stderr [new file with mode: 0644]
src/test/ui/numeric/numeric-suffix/numeric-suffix-usize.fixed [new file with mode: 0644]
src/test/ui/numeric/numeric-suffix/numeric-suffix-usize.rs [new file with mode: 0644]
src/test/ui/numeric/numeric-suffix/numeric-suffix-usize.stderr [new file with mode: 0644]
src/test/ui/numeric/numeric-suffix/numeric-suffix.fixed [new file with mode: 0644]
src/test/ui/numeric/numeric-suffix/numeric-suffix.rs [new file with mode: 0644]
src/test/ui/numeric/numeric-suffix/numeric-suffix.stderr [new file with mode: 0644]
src/test/ui/parser/fn-arg-doc-comment.rs
src/test/ui/parser/fn-arg-doc-comment.stderr
src/test/ui/pattern/pattern-error-continue.stderr
src/test/ui/proc-macro/signature.stderr
src/test/ui/range/issue-54505-no-literals.stderr
src/test/ui/range/issue-54505-no-std.stderr
src/test/ui/range/issue-54505.stderr
src/test/ui/range/issue-73553-misinterp-range-literal.stderr
src/test/ui/resolve/resolve-primitive-fallback.stderr
src/test/ui/self/issue-61882.stderr
src/test/ui/span/E0057.rs [new file with mode: 0644]
src/test/ui/span/E0057.stderr [new file with mode: 0644]
src/test/ui/span/coerce-suggestions.stderr
src/test/ui/span/issue-34264.stderr
src/test/ui/span/missing-unit-argument.stderr
src/test/ui/suggestions/args-instead-of-tuple-errors.stderr
src/test/ui/suggestions/args-instead-of-tuple.stderr
src/test/ui/suggestions/as-ref.stderr
src/test/ui/suggestions/boxed-variant-field.stderr
src/test/ui/suggestions/expected-boxed-future-isnt-pinned.stderr
src/test/ui/suggestions/issue-86100-tuple-paren-comma.stderr
src/test/ui/suggestions/issue-90213-expected-boxfuture-self-ice.stderr
src/test/ui/suggestions/recover-from-semicolon-trailing-item.stderr
src/test/ui/suggestions/suggest-ref-macro.stderr
src/test/ui/suggestions/trait-with-missing-associated-type-restriction-fixable.stderr
src/test/ui/suggestions/trait-with-missing-associated-type-restriction.stderr
src/test/ui/terminal-width/flag-json.rs
src/test/ui/terr-in-field.stderr
src/test/ui/terr-sorts.stderr
src/test/ui/traits/bound/sugar.stderr
src/test/ui/traits/issue-52893.stderr
src/test/ui/traits/multidispatch-bad.stderr
src/test/ui/tuple/tuple-arity-mismatch.stderr
src/test/ui/tuple/wrong_argument_ice-2.stderr
src/test/ui/tuple/wrong_argument_ice-3.stderr
src/test/ui/tuple/wrong_argument_ice-4.stderr
src/test/ui/tuple/wrong_argument_ice.stderr
src/test/ui/type-alias-enum-variants/enum-variant-generic-args.stderr
src/test/ui/type-alias-enum-variants/enum-variant-priority-higher-than-other-inherent.stderr
src/test/ui/type/type-ascription-instead-of-initializer.stderr
src/test/ui/type/type-mismatch-same-crate-name.stderr
src/test/ui/type/type-mismatch.stderr
src/test/ui/typeck/issue-46112.stderr
src/test/ui/typeck/issue-84768.stderr
src/test/ui/typeck/issue-89856.stderr
src/test/ui/typeck/struct-enum-wrong-args.stderr
src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr
src/test/ui/unboxed-closures/unboxed-closures-type-mismatch.stderr

index f25215fe813d6d10b0856d2c697c771934d74aee..f2dd4f5d5cbcae1273fa0d4d3a7bf5d91d9d7ca2 100644 (file)
@@ -1448,6 +1448,7 @@ pub fn note_type_err(
         mut values: Option<ValuePairs<'tcx>>,
         terr: &TypeError<'tcx>,
         swap_secondary_and_primary: bool,
+        force_label: bool,
     ) {
         let span = cause.span(self.tcx);
         debug!("note_type_err cause={:?} values={:?}, terr={:?}", cause, values, terr);
@@ -1623,7 +1624,7 @@ enum Mismatch<'a> {
             TypeError::ObjectUnsafeCoercion(_) => {}
             _ => {
                 let mut label_or_note = |span: Span, msg: &str| {
-                    if &[span] == diag.span.primary_spans() {
+                    if force_label || &[span] == diag.span.primary_spans() {
                         diag.span_label(span, msg);
                     } else {
                         diag.span_note(span, msg);
@@ -2171,7 +2172,7 @@ pub fn report_and_explain_type_error(
                 struct_span_err!(self.tcx.sess, span, E0644, "{}", failure_str)
             }
         };
-        self.note_type_err(&mut diag, &trace.cause, None, Some(trace.values), terr, false);
+        self.note_type_err(&mut diag, &trace.cause, None, Some(trace.values), terr, false, false);
         diag
     }
 
@@ -2765,7 +2766,7 @@ fn report_inference_failure(
     }
 }
 
-enum FailureCode {
+pub enum FailureCode {
     Error0038(DefId),
     Error0317(&'static str),
     Error0580(&'static str),
@@ -2773,7 +2774,7 @@ enum FailureCode {
     Error0644(&'static str),
 }
 
-trait ObligationCauseExt<'tcx> {
+pub trait ObligationCauseExt<'tcx> {
     fn as_failure_code(&self, terr: &TypeError<'tcx>) -> FailureCode;
     fn as_requirement_str(&self) -> &'static str;
 }
index 2524bd78355a118c3701d1dedc371df28db90d1b..919b89396d678407820d9bce8eeca0ad2772fdaa 100644 (file)
@@ -385,8 +385,8 @@ pub fn ty(&self) -> Option<(Ty<'tcx>, Ty<'tcx>)> {
 /// See the `error_reporting` module for more details.
 #[derive(Clone, Debug)]
 pub struct TypeTrace<'tcx> {
-    cause: ObligationCause<'tcx>,
-    values: ValuePairs<'tcx>,
+    pub cause: ObligationCause<'tcx>,
+    pub values: ValuePairs<'tcx>,
 }
 
 /// The origin of a `r1 <= r2` constraint.
index 0cb70de241596080f181260637f8fac47d3e6246..50e4fafdd6c829c44fe8212e244993f5689a0b3b 100644 (file)
@@ -1654,7 +1654,15 @@ fn report_projection_error(
                     }),
                 _ => None,
             };
-            self.note_type_err(&mut diag, &obligation.cause, secondary_span, values, err, true);
+            self.note_type_err(
+                &mut diag,
+                &obligation.cause,
+                secondary_span,
+                values,
+                err,
+                true,
+                false,
+            );
             self.note_obligation_cause(&mut diag, obligation);
             diag.emit();
         });
index 34fc177de6de0d31841b3df893f49649ba7e7e5b..2070caa7d93c208aad6d152b300ac6675fd0682f 100644 (file)
@@ -1502,7 +1502,7 @@ pub fn coerce_forced_unit<'a>(
                         found,
                         expected,
                         None,
-                        coercion_error,
+                        Some(coercion_error),
                     );
                 }
 
index 0bd5e018f4a3851bca1685f7524a0b6b2e240d88..f9d4aa9671fee9b5865b0617d7cb333191e75c58 100644 (file)
@@ -384,6 +384,7 @@ fn compare_predicate_entailment<'tcx>(
                 })),
                 &terr,
                 false,
+                false,
             );
 
             return Err(diag.emit());
@@ -1074,6 +1075,7 @@ fn compare_const_param_types<'tcx>(
                 })),
                 &terr,
                 false,
+                false,
             );
             diag.emit();
         }
index 83e535b3c32477f22d2523ecada2657c0cefa16c..a8055cb8237233e35b6a466f20305215e1b13276 100644 (file)
@@ -28,7 +28,7 @@ pub fn emit_coerce_suggestions(
         expr_ty: Ty<'tcx>,
         expected: Ty<'tcx>,
         expected_ty_expr: Option<&'tcx hir::Expr<'tcx>>,
-        error: TypeError<'tcx>,
+        error: Option<TypeError<'tcx>>,
     ) {
         self.annotate_expected_due_to_let_ty(err, expr, error);
         self.suggest_deref_ref_or_into(err, expr, expected, expr_ty, expected_ty_expr);
@@ -150,7 +150,7 @@ pub fn demand_coerce_diag(
         let expr_ty = self.resolve_vars_with_obligations(checked_ty);
         let mut err = self.report_mismatched_types(&cause, expected, expr_ty, e.clone());
 
-        self.emit_coerce_suggestions(&mut err, expr, expr_ty, expected, expected_ty_expr, e);
+        self.emit_coerce_suggestions(&mut err, expr, expr_ty, expected, expected_ty_expr, Some(e));
 
         (expected, Some(err))
     }
@@ -159,7 +159,7 @@ fn annotate_expected_due_to_let_ty(
         &self,
         err: &mut Diagnostic,
         expr: &hir::Expr<'_>,
-        error: TypeError<'_>,
+        error: Option<TypeError<'_>>,
     ) {
         let parent = self.tcx.hir().get_parent_node(expr.hir_id);
         match (self.tcx.hir().find(parent), error) {
@@ -173,7 +173,7 @@ fn annotate_expected_due_to_let_ty(
                 Some(hir::Node::Expr(hir::Expr {
                     kind: hir::ExprKind::Assign(lhs, rhs, _), ..
                 })),
-                TypeError::Sorts(ExpectedFound { expected, .. }),
+                Some(TypeError::Sorts(ExpectedFound { expected, .. })),
             ) if rhs.hir_id == expr.hir_id && !expected.is_closure() => {
                 // We ignore closures explicitly because we already point at them elsewhere.
                 // Point at the assigned-to binding.
index 669521bc4725effe38218cfbf7599f2a97188442..4275f8fb6017204330a0c7e9180a2048ab279726 100644 (file)
@@ -259,7 +259,7 @@ pub(super) fn check_expr_with_expectation_and_args(
     }
 
     #[instrument(skip(self, expr), level = "debug")]
-    fn check_expr_kind(
+    pub(super) fn check_expr_kind(
         &self,
         expr: &'tcx hir::Expr<'tcx>,
         expected: Expectation<'tcx>,
@@ -1367,11 +1367,13 @@ fn check_expr_struct_fields(
     ) {
         let tcx = self.tcx;
 
-        let adt_ty_hint = self
-            .expected_inputs_for_expected_output(span, expected, adt_ty, &[adt_ty])
-            .get(0)
-            .cloned()
-            .unwrap_or(adt_ty);
+        let expected_inputs =
+            self.expected_inputs_for_expected_output(span, expected, adt_ty, &[adt_ty]);
+        let adt_ty_hint = if let Some(expected_inputs) = expected_inputs {
+            expected_inputs.get(0).cloned().unwrap_or(adt_ty)
+        } else {
+            adt_ty
+        };
         // re-link the regions that EIfEO can erase.
         self.demand_eqtype(span, adt_ty_hint, adt_ty);
 
index d403d6e3f33828ccd16d4021e994b6df18dc9e55..152be4bd5382906b728fb6d67fa9eb2f606bd640 100644 (file)
@@ -755,9 +755,9 @@ pub(in super::super) fn expected_inputs_for_expected_output(
         expected_ret: Expectation<'tcx>,
         formal_ret: Ty<'tcx>,
         formal_args: &[Ty<'tcx>],
-    ) -> Vec<Ty<'tcx>> {
+    ) -> Option<Vec<Ty<'tcx>>> {
         let formal_ret = self.resolve_vars_with_obligations(formal_ret);
-        let Some(ret_ty) = expected_ret.only_has_type(self) else { return Vec::new() };
+        let Some(ret_ty) = expected_ret.only_has_type(self) else { return None };
 
         // HACK(oli-obk): This is a hack to keep RPIT and TAIT in sync wrt their behaviour.
         // Without it, the inference
@@ -779,7 +779,7 @@ pub(in super::super) fn expected_inputs_for_expected_output(
                 if let ty::subst::GenericArgKind::Type(ty) = ty.unpack() {
                     if let ty::Opaque(def_id, _) = *ty.kind() {
                         if self.infcx.opaque_type_origin(def_id, DUMMY_SP).is_some() {
-                            return Vec::new();
+                            return None;
                         }
                     }
                 }
@@ -820,7 +820,7 @@ pub(in super::super) fn expected_inputs_for_expected_output(
 
                 // Record all the argument types, with the substitutions
                 // produced from the above subtyping unification.
-                Ok(formal_args.iter().map(|&ty| self.resolve_vars_if_possible(ty)).collect())
+                Ok(Some(formal_args.iter().map(|&ty| self.resolve_vars_if_possible(ty)).collect()))
             })
             .unwrap_or_default();
         debug!(?formal_args, ?formal_ret, ?expect_args, ?expected_ret);
diff --git a/compiler/rustc_typeck/src/check/fn_ctxt/arg_matrix.rs b/compiler/rustc_typeck/src/check/fn_ctxt/arg_matrix.rs
new file mode 100644 (file)
index 0000000..48a66e8
--- /dev/null
@@ -0,0 +1,343 @@
+use std::cmp;
+
+use rustc_middle::ty::error::TypeError;
+
+// An issue that might be found in the compatibility matrix
+enum Issue {
+    /// The given argument is the invalid type for the input
+    Invalid(usize),
+    /// There is a missing input
+    Missing(usize),
+    /// There's a superfluous argument
+    Extra(usize),
+    /// Two arguments should be swapped
+    Swap(usize, usize),
+    /// Several arguments should be reordered
+    Permutation(Vec<Option<usize>>),
+}
+
+#[derive(Clone, Debug)]
+pub(crate) enum Compatibility<'tcx> {
+    Compatible,
+    Incompatible(Option<TypeError<'tcx>>),
+}
+
+/// Similar to `Issue`, but contains some extra information
+pub(crate) enum Error<'tcx> {
+    /// The given argument is the invalid type for the input
+    Invalid(usize, Compatibility<'tcx>),
+    /// There is a missing input
+    Missing(usize),
+    /// There's a superfluous argument
+    Extra(usize),
+    /// Two arguments should be swapped
+    Swap(usize, usize, usize, usize),
+    /// Several arguments should be reordered
+    Permutation(Vec<(usize, usize)>), // dest_arg, dest_input
+}
+
+pub(crate) struct ArgMatrix<'tcx> {
+    input_indexes: Vec<usize>,
+    arg_indexes: Vec<usize>,
+    compatibility_matrix: Vec<Vec<Compatibility<'tcx>>>,
+}
+
+impl<'tcx> ArgMatrix<'tcx> {
+    pub(crate) fn new<F: FnMut(usize, usize) -> Compatibility<'tcx>>(
+        minimum_input_count: usize,
+        provided_arg_count: usize,
+        mut is_compatible: F,
+    ) -> Self {
+        let compatibility_matrix = (0..provided_arg_count)
+            .map(|i| (0..minimum_input_count).map(|j| is_compatible(i, j)).collect())
+            .collect();
+        ArgMatrix {
+            input_indexes: (0..minimum_input_count).collect(),
+            arg_indexes: (0..provided_arg_count).collect(),
+            compatibility_matrix,
+        }
+    }
+
+    /// Remove a given input from consideration
+    fn eliminate_input(&mut self, idx: usize) {
+        self.input_indexes.remove(idx);
+        for row in &mut self.compatibility_matrix {
+            row.remove(idx);
+        }
+    }
+
+    /// Remove a given argument from consideration
+    fn eliminate_arg(&mut self, idx: usize) {
+        self.arg_indexes.remove(idx);
+        self.compatibility_matrix.remove(idx);
+    }
+
+    /// "satisfy" an input with a given arg, removing both from consideration
+    fn satisfy_input(&mut self, input_idx: usize, arg_idx: usize) {
+        self.eliminate_input(input_idx);
+        self.eliminate_arg(arg_idx);
+    }
+
+    fn eliminate_satisfied(&mut self) -> Vec<(usize, usize)> {
+        let mut i = cmp::min(self.input_indexes.len(), self.arg_indexes.len());
+        let mut eliminated = vec![];
+        while i > 0 {
+            let idx = i - 1;
+            if matches!(self.compatibility_matrix[idx][idx], Compatibility::Compatible) {
+                eliminated.push((self.arg_indexes[idx], self.input_indexes[idx]));
+                self.satisfy_input(idx, idx);
+            }
+            i -= 1;
+        }
+        return eliminated;
+    }
+
+    // Check for the above mismatch cases
+    fn find_issue(&self) -> Option<Issue> {
+        let mat = &self.compatibility_matrix;
+        let ai = &self.arg_indexes;
+        let ii = &self.input_indexes;
+
+        for i in 0..cmp::max(ai.len(), ii.len()) {
+            // If we eliminate the last row, any left-over inputs are considered missing
+            if i >= mat.len() {
+                return Some(Issue::Missing(i));
+            }
+            // If we eliminate the last column, any left-over arguments are extra
+            if mat[i].len() == 0 {
+                return Some(Issue::Extra(i));
+            }
+
+            // Make sure we don't pass the bounds of our matrix
+            let is_arg = i < ai.len();
+            let is_input = i < ii.len();
+            if is_arg && is_input && matches!(mat[i][i], Compatibility::Compatible) {
+                // This is a satisfied input, so move along
+                continue;
+            }
+
+            let mut useless = true;
+            let mut unsatisfiable = true;
+            if is_arg {
+                for j in 0..ii.len() {
+                    // If we find at least one input this argument could satisfy
+                    // this argument isn't completely useless
+                    if matches!(mat[i][j], Compatibility::Compatible) {
+                        useless = false;
+                        break;
+                    }
+                }
+            }
+            if is_input {
+                for j in 0..ai.len() {
+                    // If we find at least one argument that could satisfy this input
+                    // this argument isn't unsatisfiable
+                    if matches!(mat[j][i], Compatibility::Compatible) {
+                        unsatisfiable = false;
+                        break;
+                    }
+                }
+            }
+
+            match (is_arg, is_input, useless, unsatisfiable) {
+                // If an input is unsatisfied, and the argument in its position is useless
+                // then the most likely explanation is that we just got the types wrong
+                (true, true, true, true) => return Some(Issue::Invalid(i)),
+                // Otherwise, if an input is useless, then indicate that this is an extra argument
+                (true, _, true, _) => return Some(Issue::Extra(i)),
+                // Otherwise, if an argument is unsatisfiable, indicate that it's missing
+                (_, true, _, true) => return Some(Issue::Missing(i)),
+                (true, true, _, _) => {
+                    // The argument isn't useless, and the input isn't unsatisfied,
+                    // so look for a parameter we might swap it with
+                    // We look for swaps explicitly, instead of just falling back on permutations
+                    // so that cases like (A,B,C,D) given (B,A,D,C) show up as two swaps,
+                    // instead of a large permutation of 4 elements.
+                    for j in 0..cmp::min(ai.len(), ii.len()) {
+                        if i == j || matches!(mat[j][j], Compatibility::Compatible) {
+                            continue;
+                        }
+                        if matches!(mat[i][j], Compatibility::Compatible)
+                            && matches!(mat[j][i], Compatibility::Compatible)
+                        {
+                            return Some(Issue::Swap(i, j));
+                        }
+                    }
+                }
+                _ => {
+                    continue;
+                }
+            };
+        }
+
+        // We didn't find any of the individual issues above, but
+        // there might be a larger permutation of parameters, so we now check for that
+        // by checking for cycles
+        // We use a double option at position i in this vec to represent:
+        // - None: We haven't computed anything about this argument yet
+        // - Some(None): This argument definitely doesn't participate in a cycle
+        // - Some(Some(x)): the i-th argument could permute to the x-th position
+        let mut permutation: Vec<Option<Option<usize>>> = vec![None; mat.len()];
+        let mut permutation_found = false;
+        for i in 0..mat.len() {
+            if permutation[i].is_some() {
+                // We've already decided whether this argument is or is not in a loop
+                continue;
+            }
+
+            let mut stack = vec![];
+            let mut j = i;
+            let mut last = i;
+            let mut is_cycle = true;
+            loop {
+                stack.push(j);
+                // Look for params this one could slot into
+                let compat: Vec<_> =
+                    mat[j]
+                        .iter()
+                        .enumerate()
+                        .filter_map(|(i, c)| {
+                            if matches!(c, Compatibility::Compatible) { Some(i) } else { None }
+                        })
+                        .collect();
+                if compat.len() != 1 {
+                    // this could go into multiple slots, don't bother exploring both
+                    is_cycle = false;
+                    break;
+                }
+                j = compat[0];
+                if stack.contains(&j) {
+                    last = j;
+                    break;
+                }
+            }
+            if stack.len() <= 2 {
+                // If we encounter a cycle of 1 or 2 elements, we'll let the
+                // "satisfy" and "swap" code above handle those
+                is_cycle = false;
+            }
+            // We've built up some chain, some of which might be a cycle
+            // ex: [1,2,3,4]; last = 2; j = 2;
+            // So, we want to mark 4, 3, and 2 as part of a permutation
+            permutation_found = is_cycle;
+            while let Some(x) = stack.pop() {
+                if is_cycle {
+                    permutation[x] = Some(Some(j));
+                    j = x;
+                    if j == last {
+                        // From here on out, we're a tail leading into a cycle,
+                        // not the cycle itself
+                        is_cycle = false;
+                    }
+                } else {
+                    // Some(None) ensures we save time by skipping this argument again
+                    permutation[x] = Some(None);
+                }
+            }
+        }
+
+        if permutation_found {
+            // Map unwrap to remove the first layer of Some
+            let final_permutation: Vec<Option<usize>> =
+                permutation.into_iter().map(|x| x.unwrap()).collect();
+            return Some(Issue::Permutation(final_permutation));
+        }
+        return None;
+    }
+
+    // Obviously, detecting exact user intention is impossible, so the goal here is to
+    // come up with as likely of a story as we can to be helpful.
+    //
+    // We'll iteratively removed "satisfied" input/argument pairs,
+    // then check for the cases above, until we've eliminated the entire grid
+    //
+    // We'll want to know which arguments and inputs these rows and columns correspond to
+    // even after we delete them.
+    pub(crate) fn find_errors(mut self) -> (Vec<Error<'tcx>>, Vec<Option<usize>>) {
+        let provided_arg_count = self.arg_indexes.len();
+
+        let mut errors: Vec<Error<'tcx>> = vec![];
+        // For each expected argument, the matched *actual* input
+        let mut matched_inputs: Vec<Option<usize>> = vec![None; self.input_indexes.len()];
+
+        // Before we start looking for issues, eliminate any arguments that are already satisfied,
+        // so that an argument which is already spoken for by the input it's in doesn't
+        // spill over into another similarly typed input
+        // ex:
+        //   fn some_func(_a: i32, _b: i32) {}
+        //   some_func(1, "");
+        // Without this elimination, the first argument causes the second argument
+        // to show up as both a missing input and extra argument, rather than
+        // just an invalid type.
+        for (arg, inp) in self.eliminate_satisfied() {
+            matched_inputs[inp] = Some(arg);
+        }
+
+        while self.input_indexes.len() > 0 || self.arg_indexes.len() > 0 {
+            // Check for the first relevant issue
+            match self.find_issue() {
+                Some(Issue::Invalid(idx)) => {
+                    let compatibility = self.compatibility_matrix[idx][idx].clone();
+                    let input_idx = self.input_indexes[idx];
+                    self.satisfy_input(idx, idx);
+                    errors.push(Error::Invalid(input_idx, compatibility));
+                }
+                Some(Issue::Extra(idx)) => {
+                    let arg_idx = self.arg_indexes[idx];
+                    self.eliminate_arg(idx);
+                    errors.push(Error::Extra(arg_idx));
+                }
+                Some(Issue::Missing(idx)) => {
+                    let input_idx = self.input_indexes[idx];
+                    self.eliminate_input(idx);
+                    errors.push(Error::Missing(input_idx));
+                }
+                Some(Issue::Swap(idx, other)) => {
+                    let input_idx = self.input_indexes[idx];
+                    let other_input_idx = self.input_indexes[other];
+                    let arg_idx = self.arg_indexes[idx];
+                    let other_arg_idx = self.arg_indexes[other];
+                    let (min, max) = (cmp::min(idx, other), cmp::max(idx, other));
+                    self.satisfy_input(min, max);
+                    // Subtract 1 because we already removed the "min" row
+                    self.satisfy_input(max - 1, min);
+                    errors.push(Error::Swap(input_idx, other_input_idx, arg_idx, other_arg_idx));
+                    matched_inputs[input_idx] = Some(other_arg_idx);
+                    matched_inputs[other_input_idx] = Some(arg_idx);
+                }
+                Some(Issue::Permutation(args)) => {
+                    // FIXME: If satisfy_input ever did anything non-trivial (emit obligations to help type checking, for example)
+                    // we'd want to call this function with the correct arg/input pairs, but for now, we just throw them in a bucket.
+                    // This works because they force a cycle, so each row is guaranteed to also be a column
+                    let mut idxs: Vec<usize> = args.iter().filter_map(|&a| a).collect();
+
+                    let mut real_idxs = vec![None; provided_arg_count];
+                    for (src, dst) in
+                        args.iter().enumerate().filter_map(|(src, dst)| dst.map(|dst| (src, dst)))
+                    {
+                        let src_arg = self.arg_indexes[src];
+                        let dst_arg = self.arg_indexes[dst];
+                        let dest_input = self.input_indexes[dst];
+                        real_idxs[src_arg] = Some((dst_arg, dest_input));
+                        matched_inputs[dest_input] = Some(src_arg);
+                    }
+                    idxs.sort();
+                    idxs.reverse();
+                    for i in idxs {
+                        self.satisfy_input(i, i);
+                    }
+                    errors.push(Error::Permutation(real_idxs.into_iter().flatten().collect()));
+                }
+                None => {
+                    // We didn't find any issues, so we need to push the algorithm forward
+                    // First, eliminate any arguments that currently satisfy their inputs
+                    for (arg, inp) in self.eliminate_satisfied() {
+                        matched_inputs[inp] = Some(arg);
+                    }
+                }
+            };
+        }
+
+        return (errors, matched_inputs);
+    }
+}
index f6a5243274cd267ddffe8f36ef39249abcdd4b38..ad635eecdace275c1dd60eed65418e9627ea91a9 100644 (file)
@@ -1,5 +1,6 @@
 use crate::astconv::AstConv;
 use crate::check::coercion::CoerceMany;
+use crate::check::fn_ctxt::arg_matrix::{ArgMatrix, Compatibility, Error};
 use crate::check::gather_locals::Declaration;
 use crate::check::method::MethodCallee;
 use crate::check::Expectation::*;
@@ -8,6 +9,7 @@
     potentially_plural_count, struct_span_err, BreakableCtxt, Diverges, Expectation, FnCtxt,
     LocalTy, Needs, TupleArgumentsFlag,
 };
+use crate::structured_errors::StructuredDiagnostic;
 
 use rustc_ast as ast;
 use rustc_data_structures::sync::Lrc;
 use rustc_hir::def::{CtorOf, DefKind, Res};
 use rustc_hir::def_id::DefId;
 use rustc_hir::{ExprKind, Node, QPath};
+use rustc_infer::infer::error_reporting::{FailureCode, ObligationCauseExt};
+use rustc_infer::infer::InferOk;
+use rustc_infer::infer::TypeTrace;
 use rustc_middle::ty::adjustment::AllowTwoPhase;
+use rustc_middle::ty::error::TypeError;
 use rustc_middle::ty::fold::TypeFoldable;
 use rustc_middle::ty::{self, Ty};
 use rustc_session::Session;
 use rustc_span::{self, Span};
 use rustc_trait_selection::traits::{self, ObligationCauseCode, StatementAsExpression};
 
-use crate::structured_errors::StructuredDiagnostic;
 use std::iter;
 use std::slice;
 
-struct FnArgsAsTuple<'hir> {
-    first: &'hir hir::Expr<'hir>,
-    last: &'hir hir::Expr<'hir>,
+enum TupleMatchFound {
+    None,
+    Single,
+    /// Beginning and end Span
+    Multiple(Span, Span),
 }
-
 impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
     pub(in super::super) fn check_casts(&self) {
         let mut deferred_cast_checks = self.deferred_cast_checks.borrow_mut();
@@ -67,7 +73,7 @@ pub(in super::super) fn check_method_argument_types(
                 sp,
                 expr,
                 &err_inputs,
-                vec![],
+                None,
                 args_no_rcvr,
                 false,
                 tuple_arguments,
@@ -108,7 +114,7 @@ pub(in super::super) fn check_argument_types(
         // Types (as defined in the *signature* of the target function)
         formal_input_tys: &[Ty<'tcx>],
         // More specific expected types, after unifying with caller output types
-        expected_input_tys: Vec<Ty<'tcx>>,
+        expected_input_tys: Option<Vec<Ty<'tcx>>>,
         // The expressions for each provided argument
         provided_args: &'tcx [hir::Expr<'tcx>],
         // Whether the function is variadic, for example when imported from C
@@ -119,10 +125,18 @@ pub(in super::super) fn check_argument_types(
         fn_def_id: Option<DefId>,
     ) {
         let tcx = self.tcx;
-        // Grab the argument types, supplying fresh type variables
-        // if the wrong number of arguments were supplied
-        let supplied_arg_count =
-            if tuple_arguments == DontTupleArguments { provided_args.len() } else { 1 };
+
+        // Conceptually, we've got some number of expected inputs, and some number of provided aguments
+        // and we can form a grid of whether each argument could satisfy a given input:
+        //      in1 | in2 | in3 | ...
+        // arg1  ?  |     |     |
+        // arg2     |  ?  |     |
+        // arg3     |     |  ?  |
+        // ...
+        // Initially, we just check the diagonal, because in the case of correct code
+        // these are the only checks that matter
+        // However, in the unhappy path, we'll fill in this whole grid to attempt to provide
+        // better error messages about invalid method calls.
 
         // All the input types from the fn signature must outlive the call
         // so as to validate implied bounds.
@@ -130,11 +144,7 @@ pub(in super::super) fn check_argument_types(
             self.register_wf_obligation(fn_input_ty.into(), arg_expr.span, traits::MiscObligation);
         }
 
-        let expected_arg_count = formal_input_tys.len();
-
-        // expected_count, arg_count, error_code, sugg_unit, sugg_tuple_wrap_args
-        let mut arg_count_error: Option<(usize, usize, &str, bool, Option<FnArgsAsTuple<'_>>)> =
-            None;
+        let mut err_code = "E0061";
 
         // If the arguments should be wrapped in a tuple (ex: closures), unwrap them here
         let (formal_input_tys, expected_input_tys) = if tuple_arguments == TupleArguments {
@@ -144,15 +154,17 @@ pub(in super::super) fn check_argument_types(
                 ty::Tuple(arg_types) => {
                     // Argument length differs
                     if arg_types.len() != provided_args.len() {
-                        arg_count_error =
-                            Some((arg_types.len(), provided_args.len(), "E0057", false, None));
+                        err_code = "E0057";
                     }
-                    let expected_input_tys = match expected_input_tys.get(0) {
-                        Some(&ty) => match ty.kind() {
-                            ty::Tuple(tys) => tys.iter().collect(),
-                            _ => vec![],
+                    let expected_input_tys = match expected_input_tys {
+                        Some(expected_input_tys) => match expected_input_tys.get(0) {
+                            Some(ty) => match ty.kind() {
+                                ty::Tuple(tys) => Some(tys.iter().collect()),
+                                _ => None,
+                            },
+                            None => None,
                         },
-                        None => vec![],
+                        None => None,
                     };
                     (arg_types.iter().collect(), expected_input_tys)
                 }
@@ -167,67 +179,25 @@ pub(in super::super) fn check_argument_types(
                          for the function trait is neither a tuple nor unit"
                     )
                     .emit();
-                    (self.err_args(provided_args.len()), vec![])
+                    (self.err_args(provided_args.len()), None)
                 }
             }
-        } else if expected_arg_count == supplied_arg_count {
-            (formal_input_tys.to_vec(), expected_input_tys)
-        } else if c_variadic {
-            if supplied_arg_count >= expected_arg_count {
-                (formal_input_tys.to_vec(), expected_input_tys)
-            } else {
-                arg_count_error =
-                    Some((expected_arg_count, supplied_arg_count, "E0060", false, None));
-                (self.err_args(supplied_arg_count), vec![])
-            }
         } else {
-            // is the missing argument of type `()`?
-            let sugg_unit = if expected_input_tys.len() == 1 && supplied_arg_count == 0 {
-                self.resolve_vars_if_possible(expected_input_tys[0]).is_unit()
-            } else if formal_input_tys.len() == 1 && supplied_arg_count == 0 {
-                self.resolve_vars_if_possible(formal_input_tys[0]).is_unit()
-            } else {
-                false
-            };
-
-            // are we passing elements of a tuple without the tuple parentheses?
-            let expected_input_tys = if expected_input_tys.is_empty() {
-                // In most cases we can use expected_input_tys, but some callers won't have the type
-                // information, in which case we fall back to the types from the input expressions.
-                formal_input_tys
-            } else {
-                &*expected_input_tys
-            };
-
-            let sugg_tuple_wrap_args = self.suggested_tuple_wrap(expected_input_tys, provided_args);
-
-            arg_count_error = Some((
-                expected_arg_count,
-                supplied_arg_count,
-                "E0061",
-                sugg_unit,
-                sugg_tuple_wrap_args,
-            ));
-            (self.err_args(supplied_arg_count), vec![])
+            (formal_input_tys.to_vec(), expected_input_tys)
         };
 
-        debug!(
-            "check_argument_types: formal_input_tys={:?}",
-            formal_input_tys.iter().map(|t| self.ty_to_string(*t)).collect::<Vec<String>>()
-        );
-
-        // If there is no expectation, expect formal_input_tys.
-        let expected_input_tys = if !expected_input_tys.is_empty() {
+        // If there are no external expectations at the call site, just use the types from the function defn
+        let expected_input_tys = if let Some(expected_input_tys) = expected_input_tys {
+            assert_eq!(expected_input_tys.len(), formal_input_tys.len());
             expected_input_tys
         } else {
             formal_input_tys.clone()
         };
 
-        assert_eq!(expected_input_tys.len(), formal_input_tys.len());
-
-        let provided_arg_count: usize = provided_args.len();
+        let minimum_input_count = expected_input_tys.len();
+        let provided_arg_count = provided_args.len();
 
-        // Keep track of the fully coerced argument types
+        // We'll also want to keep track of the fully coerced argument types, for an awkward hack near the end
         let mut final_arg_types: Vec<Option<(Ty<'_>, Ty<'_>)>> = vec![None; provided_arg_count];
 
         // We introduce a helper function to demand that a given argument satisfy a given input
@@ -240,8 +210,9 @@ pub(in super::super) fn check_argument_types(
 
             debug!("checking argument {}: {:?} = {:?}", idx, provided_arg, formal_input_ty);
 
-            // The special-cased logic below has three functions:
-            // 1. Provide as good of an expected type as possible.
+            // We're on the happy path here, so we'll do a more involved check and write back types
+            // To check compatibility, we'll do 3 things:
+            // 1. Unify the provided argument with the expected type
             let expectation = Expectation::rvalue_hint(self, expected_input_ty);
 
             let checked_ty = self.check_expr_with_expectation(provided_arg, expectation);
@@ -255,8 +226,7 @@ pub(in super::super) fn check_argument_types(
             final_arg_types[idx] = Some((checked_ty, coerced_ty));
 
             // Cause selection errors caused by resolving a single argument to point at the
-            // argument and not the call. This is otherwise redundant with the `demand_coerce`
-            // call immediately after, but it lets us customize the span pointed to in the
+            // argument and not the call. This lets us customize the span pointed to in the
             // fulfillment error to be more accurate.
             let coerced_ty =
                 self.resolve_vars_with_obligations_and_mutate_fulfillment(coerced_ty, |errors| {
@@ -270,18 +240,95 @@ pub(in super::super) fn check_argument_types(
                     );
                 });
 
+            // Make sure we store the resolved type
             final_arg_types[idx] = Some((checked_ty, coerced_ty));
 
-            // We're processing function arguments so we definitely want to use
-            // two-phase borrows.
-            self.demand_coerce(&provided_arg, checked_ty, coerced_ty, None, AllowTwoPhase::Yes);
+            let coerce_error = self
+                .try_coerce(provided_arg, checked_ty, coerced_ty, AllowTwoPhase::Yes, None)
+                .err();
+
+            if coerce_error.is_some() {
+                return Compatibility::Incompatible(coerce_error);
+            }
+
+            // 3. Check if the formal type is a supertype of the checked one
+            //    and register any such obligations for future type checks
+            let supertype_error = self
+                .at(&self.misc(provided_arg.span), self.param_env)
+                .sup(formal_input_ty, coerced_ty);
+            let subtyping_error = match supertype_error {
+                Ok(InferOk { obligations, value: () }) => {
+                    self.register_predicates(obligations);
+                    None
+                }
+                Err(err) => Some(err),
+            };
 
-            // 3. Relate the expected type and the formal one,
-            //    if the expected type was used for the coercion.
-            self.demand_suptype(provided_arg.span, formal_input_ty, coerced_ty);
+            // If neither check failed, the types are compatible
+            match subtyping_error {
+                None => Compatibility::Compatible,
+                Some(_) => Compatibility::Incompatible(subtyping_error),
+            }
         };
 
-        let minimum_input_count = formal_input_tys.len();
+        // A "softer" version of the helper above, which checks types without persisting them,
+        // and treats error types differently
+        // This will allow us to "probe" for other argument orders that would likely have been correct
+        let check_compatible = |arg_idx, input_idx| {
+            let formal_input_ty: Ty<'tcx> = formal_input_tys[input_idx];
+            let expected_input_ty: Ty<'tcx> = expected_input_tys[input_idx];
+
+            // If either is an error type, we defy the usual convention and consider them to *not* be
+            // coercible.  This prevents our error message heuristic from trying to pass errors into
+            // every argument.
+            if formal_input_ty.references_error() || expected_input_ty.references_error() {
+                return Compatibility::Incompatible(None);
+            }
+
+            let provided_arg: &hir::Expr<'tcx> = &provided_args[arg_idx];
+            let expectation = Expectation::rvalue_hint(self, expected_input_ty);
+            // FIXME: check that this is safe; I don't believe this commits any of the obligations, but I can't be sure.
+            //
+            //   I had another method of "soft" type checking before,
+            //   but it was failing to find the type of some expressions (like "")
+            //   so I prodded this method and made it pub(super) so I could call it, and it seems to work well.
+            let checked_ty = self.check_expr_kind(provided_arg, expectation);
+
+            let coerced_ty = expectation.only_has_type(self).unwrap_or(formal_input_ty);
+            let can_coerce = self.can_coerce(checked_ty, coerced_ty);
+
+            if !can_coerce {
+                return Compatibility::Incompatible(None);
+            }
+
+            let subtyping_result = self
+                .at(&self.misc(provided_arg.span), self.param_env)
+                .sup(formal_input_ty, coerced_ty);
+
+            // Same as above: if either the coerce type or the checked type is an error type,
+            // consider them *not* compatible.
+            let coercible =
+                !coerced_ty.references_error() && !checked_ty.references_error() && can_coerce;
+
+            match (coercible, &subtyping_result) {
+                (true, Ok(_)) => Compatibility::Compatible,
+                _ => Compatibility::Incompatible(subtyping_result.err()),
+            }
+        };
+
+        // To start, we only care "along the diagonal", where we expect every
+        // provided arg to be in the right spot
+        let mut compatibility = vec![Compatibility::Incompatible(None); provided_args.len()];
+
+        // Keep track of whether we *could possibly* be satisfied, i.e. whether we're on the happy path
+        // if the wrong number of arguments were supplied, we CAN'T be satisfied,
+        // and if we're c_variadic, the supplied arguments must be >= the minimum count from the function
+        // otherwise, they need to be identical, because rust doesn't currently support variadic functions
+        let mut call_appears_satisfied = if c_variadic {
+            provided_arg_count >= minimum_input_count
+        } else {
+            provided_arg_count == minimum_input_count
+        };
 
         // Check the arguments.
         // We do this in a pretty awful way: first we type-check any arguments
@@ -305,6 +352,8 @@ pub(in super::super) fn check_argument_types(
                 })
             }
 
+            // Check each argument, to satisfy the input it was provided for
+            // Visually, we're traveling down the diagonal of the compatibility matrix
             for (idx, arg) in provided_args.iter().enumerate() {
                 // Warn only for the first loop (the "no closures" one).
                 // Closure arguments themselves can't be diverging, but
@@ -327,15 +376,82 @@ pub(in super::super) fn check_argument_types(
                     continue;
                 }
 
-                demand_compatible(idx, &mut final_arg_types);
+                let compatible = demand_compatible(idx, &mut final_arg_types);
+                let is_compatible = matches!(compatible, Compatibility::Compatible);
+                compatibility[idx] = compatible;
+
+                if !is_compatible {
+                    call_appears_satisfied = false;
+                }
             }
         }
 
-        // If there was an error in parameter count, emit that here
-        if let Some((expected_count, arg_count, err_code, sugg_unit, sugg_tuple_wrap_args)) =
-            arg_count_error
-        {
-            let (span, start_span, args, ctor_of) = match &call_expr.kind {
+        // Logic here is a bit hairy
+        'errors: {
+            // If something above didn't typecheck, we've fallen off the happy path
+            // and we should make some effort to provide better error messages
+            if call_appears_satisfied {
+                break 'errors;
+            }
+
+            // The algorithm here is inspired by levenshtein distance and longest common subsequence.
+            // We'll try to detect 4 different types of mistakes:
+            // - An extra parameter has been provided that doesn't satisfy *any* of the other inputs
+            // - An input is missing, which isn't satisfied by *any* of the other arguments
+            // - Some number of arguments have been provided in the wrong order
+            // - A type is straight up invalid
+
+            // First, let's find the errors
+            let mut compatibility: Vec<_> = compatibility.into_iter().map(Some).collect();
+            let (mut errors, matched_inputs) =
+                ArgMatrix::new(minimum_input_count, provided_arg_count, |i, j| {
+                    if i == j { compatibility[i].take().unwrap() } else { check_compatible(i, j) }
+                })
+                .find_errors();
+
+            // Okay, so here's where it gets complicated in regards to what errors
+            // we emit and how.
+            // There are 3 different "types" of errors we might encounter.
+            //   1) Missing/extra/swapped arguments
+            //   2) Valid but incorrect arguments
+            //   3) Invalid arguments
+            //      - Currently I think this only comes up with `CyclicTy`
+            //
+            // We first need to go through, remove those from (3) and emit those
+            // as their own error, particularly since they're error code and
+            // message is special. From what I can tell, we *must* emit these
+            // here (vs somewhere prior to this function) since the arguments
+            // become invalid *because* of how they get used in the function.
+            // It is what it is.
+
+            let found_errors = !errors.is_empty();
+
+            errors.drain_filter(|error| {
+                let Error::Invalid(input_idx, Compatibility::Incompatible(error)) = error else { return false };
+                let expected_ty = expected_input_tys[*input_idx];
+                let provided_ty = final_arg_types[*input_idx].map(|ty| ty.0).unwrap();
+                let cause = &self.misc(provided_args[*input_idx].span);
+                let trace = TypeTrace::types(cause, true, expected_ty, provided_ty);
+                if let Some(e) = error {
+                    if !matches!(trace.cause.as_failure_code(e), FailureCode::Error0308(_)) {
+                        self.report_and_explain_type_error(trace, e).emit();
+                        return true;
+                    }
+                }
+                false
+            });
+
+            // We're done if we found errors, but we already emitted them.
+            // I don't think we *should* be able to enter this bit of code
+            // (`!call_appears_satisfied`) without *also* finding errors, but we
+            // don't want to accidentally not emit an error if there is some
+            // logic bug in the `ArgMatrix` code.
+            if found_errors && errors.is_empty() {
+                break 'errors;
+            }
+
+            // Next, let's construct the error
+            let (error_span, full_call_span, ctor_of) = match &call_expr.kind {
                 hir::ExprKind::Call(
                     hir::Expr {
                         span,
@@ -346,67 +462,484 @@ pub(in super::super) fn check_argument_types(
                             )),
                         ..
                     },
-                    args,
-                ) => (*span, *span, &args[..], Some(of)),
-                hir::ExprKind::Call(hir::Expr { span, .. }, args) => {
-                    (*span, *span, &args[..], None)
+                    _,
+                ) => (call_span, *span, Some(of)),
+                hir::ExprKind::Call(hir::Expr { span, .. }, _) => (call_span, *span, None),
+                hir::ExprKind::MethodCall(path_segment, _, span) => {
+                    let ident_span = path_segment.ident.span;
+                    let ident_span = if let Some(args) = path_segment.args {
+                        ident_span.with_hi(args.span_ext.hi())
+                    } else {
+                        ident_span
+                    };
+                    (
+                        *span, ident_span, None, // methods are never ctors
+                    )
                 }
-                hir::ExprKind::MethodCall(path_segment, args, _) => (
-                    path_segment.ident.span,
-                    // `sp` doesn't point at the whole `foo.bar()`, only at `bar`.
-                    path_segment
-                        .args
-                        .and_then(|args| args.args.iter().last())
-                        // Account for `foo.bar::<T>()`.
-                        .map(|arg| {
-                            // Skip the closing `>`.
-                            tcx.sess
-                                .source_map()
-                                .next_point(tcx.sess.source_map().next_point(arg.span()))
-                        })
-                        .unwrap_or(path_segment.ident.span),
-                    &args[1..], // Skip the receiver.
-                    None,       // methods are never ctors
-                ),
                 k => span_bug!(call_span, "checking argument types on a non-call: `{:?}`", k),
             };
-            let arg_spans = if provided_args.is_empty() {
-                // foo()
-                // ^^^-- supplied 0 arguments
-                // |
-                // expected 2 arguments
-                vec![tcx.sess.source_map().next_point(start_span).with_hi(call_span.hi())]
-            } else {
-                // foo(1, 2, 3)
-                // ^^^ -  -  - supplied 3 arguments
-                // |
-                // expected 2 arguments
-                args.iter().map(|arg| arg.span).collect::<Vec<Span>>()
-            };
+            let args_span = error_span.trim_start(full_call_span).unwrap_or(error_span);
             let call_name = match ctor_of {
                 Some(CtorOf::Struct) => "struct",
                 Some(CtorOf::Variant) => "enum variant",
                 None => "function",
             };
-            let mut err = tcx.sess.struct_span_err_with_code(
-                span,
-                &format!(
-                    "this {} takes {}{} but {} {} supplied",
+            if c_variadic && provided_arg_count < minimum_input_count {
+                err_code = "E0060";
+            }
+
+            // Next special case: The case where we expect a single tuple and
+            // wrapping all the args in parentheses (or adding a comma to
+            // already existing parentheses) will result in a tuple that
+            // satisfies the call.
+            // This isn't super ideal code, because we copy code from elsewhere
+            // and somewhat duplicate this. We also delegate to the general type
+            // mismatch suggestions for the single arg case.
+            let sugg_tuple_wrap_args =
+                self.suggested_tuple_wrap(&expected_input_tys, provided_args);
+            match sugg_tuple_wrap_args {
+                TupleMatchFound::None => {}
+                TupleMatchFound::Single => {
+                    let expected_ty = expected_input_tys[0];
+                    let provided_ty = final_arg_types[0].map(|ty| ty.0).unwrap();
+                    let cause = &self.misc(provided_args[0].span);
+                    let compatibility = demand_compatible(0, &mut final_arg_types);
+                    let type_error = match compatibility {
+                        Compatibility::Incompatible(Some(error)) => error,
+                        _ => TypeError::Mismatch,
+                    };
+                    let trace = TypeTrace::types(cause, true, expected_ty, provided_ty);
+                    let mut err = self.report_and_explain_type_error(trace, &type_error);
+                    self.emit_coerce_suggestions(
+                        &mut err,
+                        &provided_args[0],
+                        final_arg_types[0].map(|ty| ty.0).unwrap(),
+                        final_arg_types[0].map(|ty| ty.1).unwrap(),
+                        None,
+                        None,
+                    );
+                    err.span_label(
+                        full_call_span,
+                        format!("arguments to this {} are incorrect", call_name),
+                    );
+                    // Call out where the function is defined
+                    if let Some(def_id) = fn_def_id && let Some(def_span) = tcx.def_ident_span(def_id) {
+                        let mut spans: MultiSpan = def_span.into();
+
+                        let params = tcx
+                            .hir()
+                            .get_if_local(def_id)
+                            .and_then(|node| node.body_id())
+                            .into_iter()
+                            .map(|id| tcx.hir().body(id).params)
+                            .flatten();
+
+                        for param in params {
+                            spans.push_span_label(param.span, String::new());
+                        }
+
+                        let def_kind = tcx.def_kind(def_id);
+                        err.span_note(spans, &format!("{} defined here", def_kind.descr(def_id)));
+                    }
+                    err.emit();
+                    break 'errors;
+                }
+                TupleMatchFound::Multiple(start, end) => {
+                    let mut err = tcx.sess.struct_span_err_with_code(
+                        full_call_span,
+                        &format!(
+                            "this {} takes {}{} but {} {} supplied",
+                            call_name,
+                            if c_variadic { "at least " } else { "" },
+                            potentially_plural_count(minimum_input_count, "argument"),
+                            potentially_plural_count(provided_arg_count, "argument"),
+                            if provided_arg_count == 1 { "was" } else { "were" }
+                        ),
+                        DiagnosticId::Error(err_code.to_owned()),
+                    );
+                    // Call out where the function is defined
+                    if let Some(def_id) = fn_def_id && let Some(def_span) = tcx.def_ident_span(def_id) {
+                        let mut spans: MultiSpan = def_span.into();
+
+                        let params = tcx
+                            .hir()
+                            .get_if_local(def_id)
+                            .and_then(|node| node.body_id())
+                            .into_iter()
+                            .map(|id| tcx.hir().body(id).params)
+                            .flatten();
+
+                        for param in params {
+                            spans.push_span_label(param.span, String::new());
+                        }
+
+                        let def_kind = tcx.def_kind(def_id);
+                        err.span_note(spans, &format!("{} defined here", def_kind.descr(def_id)));
+                    }
+                    err.multipart_suggestion(
+                        "use parentheses to construct a tuple",
+                        vec![(start, '('.to_string()), (end, ')'.to_string())],
+                        Applicability::MachineApplicable,
+                    );
+                    err.emit();
+                    break 'errors;
+                }
+            }
+
+            // Okay, now that we've emitted the special errors separately, we
+            // are only left missing/extra/swapped and mismatched arguments, both
+            // can be collated pretty easily if needed.
+
+            // Next special case: if there is only one "Incompatible" error, just emit that
+            if errors.len() == 1 {
+                if let Some(Error::Invalid(input_idx, Compatibility::Incompatible(Some(error)))) =
+                    errors.iter().next()
+                {
+                    let expected_ty = expected_input_tys[*input_idx];
+                    let provided_ty = final_arg_types[*input_idx].map(|ty| ty.0).unwrap();
+                    let cause = &self.misc(provided_args[*input_idx].span);
+                    let trace = TypeTrace::types(cause, true, expected_ty, provided_ty);
+                    let mut err = self.report_and_explain_type_error(trace, error);
+                    self.emit_coerce_suggestions(
+                        &mut err,
+                        &provided_args[*input_idx],
+                        final_arg_types[*input_idx].map(|ty| ty.0).unwrap(),
+                        final_arg_types[*input_idx].map(|ty| ty.1).unwrap(),
+                        None,
+                        None,
+                    );
+                    err.span_label(
+                        full_call_span,
+                        format!("arguments to this {} are incorrect", call_name),
+                    );
+                    // Call out where the function is defined
+                    if let Some(def_id) = fn_def_id && let Some(def_span) = tcx.def_ident_span(def_id) {
+                        let mut spans: MultiSpan = def_span.into();
+
+                        let params = tcx
+                            .hir()
+                            .get_if_local(def_id)
+                            .and_then(|node| node.body_id())
+                            .into_iter()
+                            .map(|id| tcx.hir().body(id).params)
+                            .flatten();
+
+                        for param in params {
+                            spans.push_span_label(param.span, String::new());
+                        }
+
+                        let def_kind = tcx.def_kind(def_id);
+                        err.span_note(spans, &format!("{} defined here", def_kind.descr(def_id)));
+                    }
+                    err.emit();
+                    break 'errors;
+                }
+            }
+
+            let mut err = if minimum_input_count == provided_arg_count {
+                struct_span_err!(
+                    tcx.sess,
+                    full_call_span,
+                    E0308,
+                    "arguments to this {} are incorrect",
                     call_name,
-                    if c_variadic { "at least " } else { "" },
-                    potentially_plural_count(expected_count, "argument"),
-                    potentially_plural_count(arg_count, "argument"),
-                    if arg_count == 1 { "was" } else { "were" }
-                ),
-                DiagnosticId::Error(err_code.to_owned()),
-            );
-            let label = format!("supplied {}", potentially_plural_count(arg_count, "argument"));
-            for (i, span) in arg_spans.into_iter().enumerate() {
-                err.span_label(
-                    span,
-                    if arg_count == 0 || i + 1 == arg_count { &label } else { "" },
-                );
+                )
+            } else {
+                tcx.sess.struct_span_err_with_code(
+                    full_call_span,
+                    &format!(
+                        "this {} takes {}{} but {} {} supplied",
+                        call_name,
+                        if c_variadic { "at least " } else { "" },
+                        potentially_plural_count(minimum_input_count, "argument"),
+                        potentially_plural_count(provided_arg_count, "argument"),
+                        if provided_arg_count == 1 { "was" } else { "were" }
+                    ),
+                    DiagnosticId::Error(err_code.to_owned()),
+                )
+            };
+
+            // As we encounter issues, keep track of what we want to provide for the suggestion
+            let mut labels = vec![];
+            // If there is a single error, we give a specific suggestion; otherwise, we change to
+            // "did you mean" with the suggested function call
+            enum SuggestionText {
+                None,
+                Provide(bool),
+                Remove(bool),
+                Swap,
+                Reorder,
+                DidYouMean,
             }
+            let mut suggestion_text = SuggestionText::None;
+
+            let mut errors = errors.into_iter().peekable();
+            while let Some(error) = errors.next() {
+                match error {
+                    Error::Invalid(input_idx, compatibility) => {
+                        let expected_ty = expected_input_tys[input_idx];
+                        if let Compatibility::Incompatible(error) = &compatibility {
+                            let provided_ty = final_arg_types[input_idx].map(|ty| ty.0).unwrap();
+                            let cause = &self.misc(provided_args[input_idx].span);
+                            let trace = TypeTrace::types(cause, true, expected_ty, provided_ty);
+                            if let Some(e) = error {
+                                self.note_type_err(
+                                    &mut err,
+                                    &trace.cause,
+                                    None,
+                                    Some(trace.values),
+                                    e,
+                                    false,
+                                    true,
+                                );
+                            }
+                        }
+
+                        self.emit_coerce_suggestions(
+                            &mut err,
+                            &provided_args[input_idx],
+                            final_arg_types[input_idx].map(|ty| ty.0).unwrap(),
+                            final_arg_types[input_idx].map(|ty| ty.1).unwrap(),
+                            None,
+                            None,
+                        );
+                    }
+                    Error::Extra(arg_idx) => {
+                        let arg_type = if let Some((_, ty)) = final_arg_types[arg_idx] {
+                            if ty.references_error() || ty.has_infer_types() {
+                                "".into()
+                            } else {
+                                format!(" of type `{}`", ty)
+                            }
+                        } else {
+                            "".into()
+                        };
+                        labels.push((
+                            provided_args[arg_idx].span,
+                            format!("argument{} unexpected", arg_type),
+                        ));
+                        suggestion_text = match suggestion_text {
+                            SuggestionText::None => SuggestionText::Remove(false),
+                            SuggestionText::Remove(_) => SuggestionText::Remove(true),
+                            _ => SuggestionText::DidYouMean,
+                        };
+                    }
+                    Error::Missing(input_idx) => {
+                        // If there are multiple missing arguments adjacent to each other,
+                        // then we can provide a single error.
+
+                        let mut missing_idxs = vec![input_idx];
+                        while let Some(e) = errors.next_if(|e| matches!(e, Error::Missing(input_idx) if *input_idx == (missing_idxs.last().unwrap() + 1))) {
+                            match e {
+                                Error::Missing(input_idx) => missing_idxs.push(input_idx),
+                                _ => unreachable!(),
+                            }
+                        }
+
+                        // NOTE: Because we might be re-arranging arguments, might have extra
+                        // arguments, etc. it's hard to *really* know where we should provide
+                        // this error label, so as a heuristic, we point to the provided arg, or
+                        // to the call if the missing inputs pass the provided args.
+                        match &missing_idxs[..] {
+                            &[input_idx] => {
+                                let expected_ty = expected_input_tys[input_idx];
+                                let input_ty = self.resolve_vars_if_possible(expected_ty);
+                                let span = if input_idx < provided_arg_count {
+                                    let arg_span = provided_args[input_idx].span;
+                                    Span::new(arg_span.lo(), arg_span.hi(), arg_span.ctxt(), None)
+                                } else {
+                                    args_span
+                                };
+                                let arg_type =
+                                    if input_ty.references_error() || input_ty.has_infer_types() {
+                                        "".into()
+                                    } else {
+                                        format!(" of type `{}`", input_ty)
+                                    };
+                                labels.push((span, format!("an argument{} is missing", arg_type)));
+                                suggestion_text = match suggestion_text {
+                                    SuggestionText::None => SuggestionText::Provide(false),
+                                    SuggestionText::Provide(_) => SuggestionText::Provide(true),
+                                    _ => SuggestionText::DidYouMean,
+                                };
+                            }
+                            &[first_idx, second_idx] => {
+                                let first_input_ty =
+                                    self.resolve_vars_if_possible(expected_input_tys[first_idx]);
+                                let second_input_ty =
+                                    self.resolve_vars_if_possible(expected_input_tys[second_idx]);
+
+                                let span = if second_idx < provided_arg_count {
+                                    let first_arg_span = provided_args[first_idx].span;
+                                    let second_arg_span = provided_args[second_idx].span;
+                                    Span::new(
+                                        first_arg_span.lo(),
+                                        second_arg_span.hi(),
+                                        first_arg_span.ctxt(),
+                                        None,
+                                    )
+                                } else {
+                                    args_span
+                                };
+                                let any_unnameable = false
+                                    || first_input_ty.references_error()
+                                    || first_input_ty.has_infer_types()
+                                    || second_input_ty.references_error()
+                                    || second_input_ty.has_infer_types();
+                                let arg_type = if any_unnameable {
+                                    "".into()
+                                } else {
+                                    format!(
+                                        " of type `{}` and `{}`",
+                                        first_input_ty, second_input_ty
+                                    )
+                                };
+                                labels
+                                    .push((span, format!("two arguments{} are missing", arg_type)));
+                                suggestion_text = match suggestion_text {
+                                    SuggestionText::None | SuggestionText::Provide(_) => {
+                                        SuggestionText::Provide(true)
+                                    }
+                                    _ => SuggestionText::DidYouMean,
+                                };
+                            }
+                            &[first_idx, second_idx, third_idx] => {
+                                let first_input_ty =
+                                    self.resolve_vars_if_possible(expected_input_tys[first_idx]);
+                                let second_input_ty =
+                                    self.resolve_vars_if_possible(expected_input_tys[second_idx]);
+                                let third_input_ty =
+                                    self.resolve_vars_if_possible(expected_input_tys[second_idx]);
+                                let span = if third_idx < provided_arg_count {
+                                    let first_arg_span = provided_args[first_idx].span;
+                                    let third_arg_span = provided_args[third_idx].span;
+                                    Span::new(
+                                        first_arg_span.lo(),
+                                        third_arg_span.hi(),
+                                        first_arg_span.ctxt(),
+                                        None,
+                                    )
+                                } else {
+                                    args_span
+                                };
+                                let any_unnameable = false
+                                    || first_input_ty.references_error()
+                                    || first_input_ty.has_infer_types()
+                                    || second_input_ty.references_error()
+                                    || second_input_ty.has_infer_types()
+                                    || third_input_ty.references_error()
+                                    || third_input_ty.has_infer_types();
+                                let arg_type = if any_unnameable {
+                                    "".into()
+                                } else {
+                                    format!(
+                                        " of type `{}`, `{}`, and `{}`",
+                                        first_input_ty, second_input_ty, third_input_ty
+                                    )
+                                };
+                                labels.push((
+                                    span,
+                                    format!("three arguments{} are missing", arg_type),
+                                ));
+                                suggestion_text = match suggestion_text {
+                                    SuggestionText::None | SuggestionText::Provide(_) => {
+                                        SuggestionText::Provide(true)
+                                    }
+                                    _ => SuggestionText::DidYouMean,
+                                };
+                            }
+                            missing_idxs => {
+                                let first_idx = *missing_idxs.first().unwrap();
+                                let second_idx = *missing_idxs.last().unwrap();
+                                // NOTE: Because we might be re-arranging arguments, might have extra arguments, etc.
+                                // It's hard to *really* know where we should provide this error label, so this is a
+                                // decent heuristic
+                                let span = if first_idx < provided_arg_count {
+                                    let first_arg_span = provided_args[first_idx].span;
+                                    let second_arg_span = provided_args[second_idx].span;
+                                    Span::new(
+                                        first_arg_span.lo(),
+                                        second_arg_span.hi(),
+                                        first_arg_span.ctxt(),
+                                        None,
+                                    )
+                                } else {
+                                    // Otherwise just label the whole function
+                                    args_span
+                                };
+                                labels.push((span, format!("multiple arguments are missing")));
+                                suggestion_text = match suggestion_text {
+                                    SuggestionText::None | SuggestionText::Provide(_) => {
+                                        SuggestionText::Provide(true)
+                                    }
+                                    _ => SuggestionText::DidYouMean,
+                                };
+                            }
+                        }
+                    }
+                    Error::Swap(input_idx, other_input_idx, arg_idx, other_arg_idx) => {
+                        let first_span = provided_args[arg_idx].span;
+                        let second_span = provided_args[other_arg_idx].span;
+
+                        let first_expected_ty =
+                            self.resolve_vars_if_possible(expected_input_tys[input_idx]);
+                        let first_provided_ty = if let Some((ty, _)) = final_arg_types[arg_idx] {
+                            format!(",found `{}`", ty)
+                        } else {
+                            "".into()
+                        };
+                        labels.push((
+                            first_span,
+                            format!("expected `{}`{}", first_expected_ty, first_provided_ty),
+                        ));
+                        let other_expected_ty =
+                            self.resolve_vars_if_possible(expected_input_tys[other_input_idx]);
+                        let other_provided_ty =
+                            if let Some((ty, _)) = final_arg_types[other_arg_idx] {
+                                format!(",found `{}`", ty)
+                            } else {
+                                "".into()
+                            };
+                        labels.push((
+                            second_span,
+                            format!("expected `{}`{}", other_expected_ty, other_provided_ty),
+                        ));
+                        suggestion_text = match suggestion_text {
+                            SuggestionText::None => SuggestionText::Swap,
+                            _ => SuggestionText::DidYouMean,
+                        };
+                    }
+                    Error::Permutation(args) => {
+                        for (dst_arg, dest_input) in args {
+                            let expected_ty =
+                                self.resolve_vars_if_possible(expected_input_tys[dest_input]);
+                            let provided_ty = if let Some((ty, _)) = final_arg_types[dst_arg] {
+                                format!(",found `{}`", ty)
+                            } else {
+                                "".into()
+                            };
+                            labels.push((
+                                provided_args[dst_arg].span,
+                                format!("expected `{}`{}", expected_ty, provided_ty),
+                            ));
+                        }
+
+                        suggestion_text = match suggestion_text {
+                            SuggestionText::None => SuggestionText::Reorder,
+                            _ => SuggestionText::DidYouMean,
+                        };
+                    }
+                }
+            }
+
+            // If we have less than 5 things to say, it would be useful to call out exactly what's wrong
+            if labels.len() <= 5 {
+                for (span, label) in labels {
+                    err.span_label(span, label);
+                }
+            }
+
+            // Call out where the function is defined
             if let Some(def_id) = fn_def_id && let Some(def_span) = tcx.def_ident_span(def_id) {
                 let mut spans: MultiSpan = def_span.into();
 
@@ -425,33 +958,52 @@ pub(in super::super) fn check_argument_types(
                 let def_kind = tcx.def_kind(def_id);
                 err.span_note(spans, &format!("{} defined here", def_kind.descr(def_id)));
             }
-            if sugg_unit {
-                let sugg_span = tcx.sess.source_map().end_point(call_expr.span);
-                // remove closing `)` from the span
-                let sugg_span = sugg_span.shrink_to_lo();
-                err.span_suggestion(
-                    sugg_span,
-                    "expected the unit value `()`; create it with empty parentheses",
-                    String::from("()"),
-                    Applicability::MachineApplicable,
-                );
-            } else if let Some(FnArgsAsTuple { first, last }) = sugg_tuple_wrap_args {
-                err.multipart_suggestion(
-                    "use parentheses to construct a tuple",
-                    vec![
-                        (first.span.shrink_to_lo(), '('.to_string()),
-                        (last.span.shrink_to_hi(), ')'.to_string()),
-                    ],
-                    Applicability::MachineApplicable,
+
+            // And add a suggestion block for all of the parameters
+            let suggestion_text = match suggestion_text {
+                SuggestionText::None => None,
+                SuggestionText::Provide(plural) => {
+                    Some(format!("provide the argument{}", if plural { "s" } else { "" }))
+                }
+                SuggestionText::Remove(plural) => {
+                    Some(format!("remove the extra argument{}", if plural { "s" } else { "" }))
+                }
+                SuggestionText::Swap => Some(format!("swap these arguments")),
+                SuggestionText::Reorder => Some(format!("reorder these arguments")),
+                SuggestionText::DidYouMean => Some(format!("did you mean")),
+            };
+            if let Some(suggestion_text) = suggestion_text {
+                let source_map = self.sess().source_map();
+                let mut suggestion = format!(
+                    "{}(",
+                    source_map.span_to_snippet(full_call_span).unwrap_or_else(|_| String::new())
                 );
-            } else {
-                err.span_label(
-                    span,
-                    format!(
-                        "expected {}{}",
-                        if c_variadic { "at least " } else { "" },
-                        potentially_plural_count(expected_count, "argument")
-                    ),
+                for (idx, arg) in matched_inputs.iter().enumerate() {
+                    let suggestion_text = if let Some(arg) = arg {
+                        let arg_span = provided_args[*arg].span;
+                        let arg_text = source_map.span_to_snippet(arg_span).unwrap();
+                        arg_text
+                    } else {
+                        // Propose a placeholder of the correct type
+                        let expected_ty = expected_input_tys[idx];
+                        let input_ty = self.resolve_vars_if_possible(expected_ty);
+                        if input_ty.is_unit() {
+                            "()".to_string()
+                        } else {
+                            format!("{{{}}}", input_ty)
+                        }
+                    };
+                    suggestion += &suggestion_text;
+                    if idx < minimum_input_count - 1 {
+                        suggestion += ", ";
+                    }
+                }
+                suggestion += ")";
+                err.span_suggestion_verbose(
+                    error_span,
+                    &suggestion_text,
+                    suggestion,
+                    Applicability::HasPlaceholders,
                 );
             }
             err.emit();
@@ -460,10 +1012,11 @@ pub(in super::super) fn check_argument_types(
         for arg in provided_args.iter().skip(minimum_input_count) {
             let arg_ty = self.check_expr(&arg);
 
+            // If the function is c-style variadic, we skipped a bunch of arguments
+            // so we need to check those, and write out the types
+            // Ideally this would be folded into the above, for uniform style
+            // but c-variadic is already a corner case
             if c_variadic {
-                // We also need to make sure we at least write the ty of the other
-                // arguments which we skipped above, either because they were additional
-                // c_variadic args, or because we had an argument count mismatch.
                 fn variadic_error<'tcx>(sess: &Session, span: Span, ty: Ty<'tcx>, cast_ty: &str) {
                     use crate::structured_errors::MissingCastForVariadicArg;
 
@@ -498,27 +1051,31 @@ fn suggested_tuple_wrap(
         &self,
         expected_input_tys: &[Ty<'tcx>],
         provided_args: &'tcx [hir::Expr<'tcx>],
-    ) -> Option<FnArgsAsTuple<'_>> {
-        let [expected_arg_type] = expected_input_tys[..] else { return None };
-
+    ) -> TupleMatchFound {
+        // Only handle the case where we expect only one tuple arg
+        let [expected_arg_type] = expected_input_tys[..] else { return TupleMatchFound::None };
         let &ty::Tuple(expected_types) = self.resolve_vars_if_possible(expected_arg_type).kind()
-            else { return None };
+            else { return TupleMatchFound::None };
+
+        // First check that there are the same number of types.
+        if expected_types.len() != provided_args.len() {
+            return TupleMatchFound::None;
+        }
 
         let supplied_types: Vec<_> = provided_args.iter().map(|arg| self.check_expr(arg)).collect();
 
         let all_match = iter::zip(expected_types, supplied_types)
             .all(|(expected, supplied)| self.can_eq(self.param_env, expected, supplied).is_ok());
 
-        if all_match {
-            match provided_args {
-                [] => None,
-                [_] => unreachable!(
-                    "shouldn't reach here - need count mismatch between 1-tuple and 1-argument"
-                ),
-                [first, .., last] => Some(FnArgsAsTuple { first, last }),
+        if !all_match {
+            return TupleMatchFound::None;
+        }
+        match provided_args {
+            [] => TupleMatchFound::None,
+            [_] => TupleMatchFound::Single,
+            [first, .., last] => {
+                TupleMatchFound::Multiple(first.span.shrink_to_lo(), last.span.shrink_to_hi())
             }
-        } else {
-            None
         }
     }
 
index 77cba1c22c408cca0c99f173f089b170641b0b35..ce9ff61bd9e6f0ada69ba401eab3e39265cbcc9f 100644 (file)
@@ -1,9 +1,9 @@
 mod _impl;
+mod arg_matrix;
 mod checks;
 mod suggestions;
 
 pub use _impl::*;
-pub use checks::*;
 pub use suggestions::*;
 
 use crate::astconv::AstConv;
index d0c4726bb0a8c41193c3b3d7b20c8a055fec3852..9fb9652b849c9142b87d47fb8f8a90ce30e915a0 100644 (file)
 #![feature(box_patterns)]
 #![feature(control_flow_enum)]
 #![feature(crate_visibility_modifier)]
+#![feature(drain_filter)]
 #![feature(hash_drain_filter)]
 #![feature(if_let_guard)]
 #![feature(is_sorted)]
+#![feature(label_break_value)]
 #![feature(let_chains)]
 #![feature(let_else)]
 #![feature(min_specialization)]
diff --git a/src/test/ui/arg-count-mismatch.rs b/src/test/ui/arg-count-mismatch.rs
deleted file mode 100644 (file)
index 18926f5..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-// error-pattern: arguments were supplied
-
-fn f(x: isize) { }
-
-fn main() { let i: (); i = f(); }
diff --git a/src/test/ui/arg-count-mismatch.stderr b/src/test/ui/arg-count-mismatch.stderr
deleted file mode 100644 (file)
index d0577e4..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-error[E0061]: this function takes 1 argument but 0 arguments were supplied
-  --> $DIR/arg-count-mismatch.rs:5:28
-   |
-LL | fn main() { let i: (); i = f(); }
-   |                            ^-- supplied 0 arguments
-   |                            |
-   |                            expected 1 argument
-   |
-note: function defined here
-  --> $DIR/arg-count-mismatch.rs:3:4
-   |
-LL | fn f(x: isize) { }
-   |    ^ --------
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0061`.
diff --git a/src/test/ui/arg-type-mismatch.rs b/src/test/ui/arg-type-mismatch.rs
deleted file mode 100644 (file)
index 04ce288..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-// error-pattern: mismatched types
-
-fn f(x: isize) { }
-
-fn main() { let i: (); i = f(()); }
diff --git a/src/test/ui/arg-type-mismatch.stderr b/src/test/ui/arg-type-mismatch.stderr
deleted file mode 100644 (file)
index 05b21ef..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/arg-type-mismatch.rs:5:30
-   |
-LL | fn main() { let i: (); i = f(()); }
-   |                              ^^ expected `isize`, found `()`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/argument-suggestions/basic.rs b/src/test/ui/argument-suggestions/basic.rs
new file mode 100644 (file)
index 0000000..765b2d5
--- /dev/null
@@ -0,0 +1,25 @@
+// Some basic "obvious" cases for the heuristic error messages added for #65853
+// One for each of the detected cases
+
+enum E { X, Y }
+enum F { X2, Y2 }
+struct G {}
+struct H {}
+struct X {}
+struct Y {}
+struct Z {}
+
+
+fn invalid(_i: u32) {}
+fn extra() {}
+fn missing(_i: u32) {}
+fn swapped(_i: u32, _s: &str) {}
+fn permuted(_x: X, _y: Y, _z: Z) {}
+
+fn main() {
+    invalid(1.0); //~ ERROR mismatched types
+    extra(""); //~ ERROR this function takes
+    missing(); //~ ERROR this function takes
+    swapped("", 1); //~ ERROR arguments to this function are incorrect
+    permuted(Y {}, Z {}, X {}); //~ ERROR arguments to this function are incorrect
+}
diff --git a/src/test/ui/argument-suggestions/basic.stderr b/src/test/ui/argument-suggestions/basic.stderr
new file mode 100644 (file)
index 0000000..78f82b0
--- /dev/null
@@ -0,0 +1,87 @@
+error[E0308]: mismatched types
+  --> $DIR/basic.rs:20:13
+   |
+LL |     invalid(1.0);
+   |     ------- ^^^ expected `u32`, found floating-point number
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/basic.rs:13:4
+   |
+LL | fn invalid(_i: u32) {}
+   |    ^^^^^^^ -------
+
+error[E0061]: this function takes 0 arguments but 1 argument was supplied
+  --> $DIR/basic.rs:21:5
+   |
+LL |     extra("");
+   |     ^^^^^ -- argument unexpected
+   |
+note: function defined here
+  --> $DIR/basic.rs:14:4
+   |
+LL | fn extra() {}
+   |    ^^^^^
+help: remove the extra argument
+   |
+LL |     extra();
+   |     ~~~~~~~
+
+error[E0061]: this function takes 1 argument but 0 arguments were supplied
+  --> $DIR/basic.rs:22:5
+   |
+LL |     missing();
+   |     ^^^^^^^-- an argument of type `u32` is missing
+   |
+note: function defined here
+  --> $DIR/basic.rs:15:4
+   |
+LL | fn missing(_i: u32) {}
+   |    ^^^^^^^ -------
+help: provide the argument
+   |
+LL |     missing({u32});
+   |     ~~~~~~~~~~~~~~
+
+error[E0308]: arguments to this function are incorrect
+  --> $DIR/basic.rs:23:5
+   |
+LL |     swapped("", 1);
+   |     ^^^^^^^ --  - expected `&str`,found `{integer}`
+   |             |
+   |             expected `u32`,found `&'static str`
+   |
+note: function defined here
+  --> $DIR/basic.rs:16:4
+   |
+LL | fn swapped(_i: u32, _s: &str) {}
+   |    ^^^^^^^ -------  --------
+help: swap these arguments
+   |
+LL |     swapped(1, "");
+   |     ~~~~~~~~~~~~~~
+
+error[E0308]: arguments to this function are incorrect
+  --> $DIR/basic.rs:24:5
+   |
+LL |     permuted(Y {}, Z {}, X {});
+   |     ^^^^^^^^ ----  ----  ---- expected `Z`,found `X`
+   |              |     |
+   |              |     expected `Y`,found `Z`
+   |              expected `X`,found `Y`
+   |
+note: function defined here
+  --> $DIR/basic.rs:17:4
+   |
+LL | fn permuted(_x: X, _y: Y, _z: Z) {}
+   |    ^^^^^^^^ -----  -----  -----
+help: reorder these arguments
+   |
+LL |     permuted(X {}, Y {}, Z {});
+   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+error: aborting due to 5 previous errors
+
+Some errors have detailed explanations: E0061, E0308.
+For more information about an error, try `rustc --explain E0061`.
diff --git a/src/test/ui/argument-suggestions/complex.rs b/src/test/ui/argument-suggestions/complex.rs
new file mode 100644 (file)
index 0000000..384cdca
--- /dev/null
@@ -0,0 +1,16 @@
+// A complex case with mixed suggestions from #65853
+
+enum E { X, Y }
+enum F { X2, Y2 }
+struct G {}
+struct H {}
+struct X {}
+struct Y {}
+struct Z {}
+
+fn complex(_i: u32, _s: &str, _e: E, _f: F, _g: G, _x: X, _y: Y, _z: Z ) {}
+
+fn main() {
+  complex(1.0, H {}, &"", G{}, F::X2, Z {}, X {}, Y {});
+  //~^ ERROR arguments to this function are incorrect
+}
diff --git a/src/test/ui/argument-suggestions/complex.stderr b/src/test/ui/argument-suggestions/complex.stderr
new file mode 100644 (file)
index 0000000..c628f7d
--- /dev/null
@@ -0,0 +1,19 @@
+error[E0308]: arguments to this function are incorrect
+  --> $DIR/complex.rs:14:3
+   |
+LL |   complex(1.0, H {}, &"", G{}, F::X2, Z {}, X {}, Y {});
+   |   ^^^^^^^ --- expected `u32`, found floating-point number
+   |
+note: function defined here
+  --> $DIR/complex.rs:11:4
+   |
+LL | fn complex(_i: u32, _s: &str, _e: E, _f: F, _g: G, _x: X, _y: Y, _z: Z ) {}
+   |    ^^^^^^^ -------  --------  -----  -----  -----  -----  -----  ------
+help: did you mean
+   |
+LL |   complex({u32}, &"", {E}, F::X2, G{}, X {}, Y {}, Z {});
+   |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/argument-suggestions/extra_arguments.rs b/src/test/ui/argument-suggestions/extra_arguments.rs
new file mode 100644 (file)
index 0000000..3706ac4
--- /dev/null
@@ -0,0 +1,35 @@
+fn empty() {}
+fn one_arg(_a: i32) {}
+fn two_arg_same(_a: i32, _b: i32) {}
+fn two_arg_diff(_a: i32, _b: &str) {}
+
+fn main() {
+  empty(""); //~ ERROR this function takes
+
+  one_arg(1, 1); //~ ERROR this function takes
+  one_arg(1, ""); //~ ERROR this function takes
+  one_arg(1, "", 1.0); //~ ERROR this function takes
+
+  two_arg_same(1, 1, 1); //~ ERROR this function takes
+  two_arg_same(1, 1, 1.0); //~ ERROR this function takes
+
+  two_arg_diff(1, 1, ""); //~ ERROR this function takes
+  two_arg_diff(1, "", ""); //~ ERROR this function takes
+  two_arg_diff(1, 1, "", ""); //~ ERROR this function takes
+  two_arg_diff(1, "", 1, ""); //~ ERROR this function takes
+
+  // Check with weird spacing and newlines
+  two_arg_same(1, 1,     ""); //~ ERROR this function takes
+  two_arg_diff(1, 1,     ""); //~ ERROR this function takes
+  two_arg_same( //~ ERROR this function takes
+    1,
+    1,
+    ""
+  );
+
+  two_arg_diff( //~ ERROR this function takes
+    1,
+    1,
+    ""
+  );
+}
diff --git a/src/test/ui/argument-suggestions/extra_arguments.stderr b/src/test/ui/argument-suggestions/extra_arguments.stderr
new file mode 100644 (file)
index 0000000..9b63f9b
--- /dev/null
@@ -0,0 +1,239 @@
+error[E0061]: this function takes 0 arguments but 1 argument was supplied
+  --> $DIR/extra_arguments.rs:7:3
+   |
+LL |   empty("");
+   |   ^^^^^ -- argument unexpected
+   |
+note: function defined here
+  --> $DIR/extra_arguments.rs:1:4
+   |
+LL | fn empty() {}
+   |    ^^^^^
+help: remove the extra argument
+   |
+LL |   empty();
+   |   ~~~~~~~
+
+error[E0061]: this function takes 1 argument but 2 arguments were supplied
+  --> $DIR/extra_arguments.rs:9:3
+   |
+LL |   one_arg(1, 1);
+   |   ^^^^^^^    - argument unexpected
+   |
+note: function defined here
+  --> $DIR/extra_arguments.rs:2:4
+   |
+LL | fn one_arg(_a: i32) {}
+   |    ^^^^^^^ -------
+help: remove the extra argument
+   |
+LL |   one_arg(1);
+   |   ~~~~~~~~~~
+
+error[E0061]: this function takes 1 argument but 2 arguments were supplied
+  --> $DIR/extra_arguments.rs:10:3
+   |
+LL |   one_arg(1, "");
+   |   ^^^^^^^    -- argument unexpected
+   |
+note: function defined here
+  --> $DIR/extra_arguments.rs:2:4
+   |
+LL | fn one_arg(_a: i32) {}
+   |    ^^^^^^^ -------
+help: remove the extra argument
+   |
+LL |   one_arg(1);
+   |   ~~~~~~~~~~
+
+error[E0061]: this function takes 1 argument but 3 arguments were supplied
+  --> $DIR/extra_arguments.rs:11:3
+   |
+LL |   one_arg(1, "", 1.0);
+   |   ^^^^^^^    --  --- argument unexpected
+   |              |
+   |              argument unexpected
+   |
+note: function defined here
+  --> $DIR/extra_arguments.rs:2:4
+   |
+LL | fn one_arg(_a: i32) {}
+   |    ^^^^^^^ -------
+help: remove the extra arguments
+   |
+LL |   one_arg(1);
+   |   ~~~~~~~~~~
+
+error[E0061]: this function takes 2 arguments but 3 arguments were supplied
+  --> $DIR/extra_arguments.rs:13:3
+   |
+LL |   two_arg_same(1, 1, 1);
+   |   ^^^^^^^^^^^^       - argument unexpected
+   |
+note: function defined here
+  --> $DIR/extra_arguments.rs:3:4
+   |
+LL | fn two_arg_same(_a: i32, _b: i32) {}
+   |    ^^^^^^^^^^^^ -------  -------
+help: remove the extra argument
+   |
+LL |   two_arg_same(1, 1);
+   |   ~~~~~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 2 arguments but 3 arguments were supplied
+  --> $DIR/extra_arguments.rs:14:3
+   |
+LL |   two_arg_same(1, 1, 1.0);
+   |   ^^^^^^^^^^^^       --- argument unexpected
+   |
+note: function defined here
+  --> $DIR/extra_arguments.rs:3:4
+   |
+LL | fn two_arg_same(_a: i32, _b: i32) {}
+   |    ^^^^^^^^^^^^ -------  -------
+help: remove the extra argument
+   |
+LL |   two_arg_same(1, 1);
+   |   ~~~~~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 2 arguments but 3 arguments were supplied
+  --> $DIR/extra_arguments.rs:16:3
+   |
+LL |   two_arg_diff(1, 1, "");
+   |   ^^^^^^^^^^^^    - argument of type `&str` unexpected
+   |
+note: function defined here
+  --> $DIR/extra_arguments.rs:4:4
+   |
+LL | fn two_arg_diff(_a: i32, _b: &str) {}
+   |    ^^^^^^^^^^^^ -------  --------
+help: remove the extra argument
+   |
+LL |   two_arg_diff(1, "");
+   |   ~~~~~~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 2 arguments but 3 arguments were supplied
+  --> $DIR/extra_arguments.rs:17:3
+   |
+LL |   two_arg_diff(1, "", "");
+   |   ^^^^^^^^^^^^        -- argument unexpected
+   |
+note: function defined here
+  --> $DIR/extra_arguments.rs:4:4
+   |
+LL | fn two_arg_diff(_a: i32, _b: &str) {}
+   |    ^^^^^^^^^^^^ -------  --------
+help: remove the extra argument
+   |
+LL |   two_arg_diff(1, "");
+   |   ~~~~~~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 2 arguments but 4 arguments were supplied
+  --> $DIR/extra_arguments.rs:18:3
+   |
+LL |   two_arg_diff(1, 1, "", "");
+   |   ^^^^^^^^^^^^    -      -- argument unexpected
+   |                   |
+   |                   argument of type `&str` unexpected
+   |
+note: function defined here
+  --> $DIR/extra_arguments.rs:4:4
+   |
+LL | fn two_arg_diff(_a: i32, _b: &str) {}
+   |    ^^^^^^^^^^^^ -------  --------
+help: remove the extra arguments
+   |
+LL |   two_arg_diff(1, "");
+   |   ~~~~~~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 2 arguments but 4 arguments were supplied
+  --> $DIR/extra_arguments.rs:19:3
+   |
+LL |   two_arg_diff(1, "", 1, "");
+   |   ^^^^^^^^^^^^        -  -- argument unexpected
+   |                       |
+   |                       argument unexpected
+   |
+note: function defined here
+  --> $DIR/extra_arguments.rs:4:4
+   |
+LL | fn two_arg_diff(_a: i32, _b: &str) {}
+   |    ^^^^^^^^^^^^ -------  --------
+help: remove the extra arguments
+   |
+LL |   two_arg_diff(1, "");
+   |   ~~~~~~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 2 arguments but 3 arguments were supplied
+  --> $DIR/extra_arguments.rs:22:3
+   |
+LL |   two_arg_same(1, 1,     "");
+   |   ^^^^^^^^^^^^           -- argument unexpected
+   |
+note: function defined here
+  --> $DIR/extra_arguments.rs:3:4
+   |
+LL | fn two_arg_same(_a: i32, _b: i32) {}
+   |    ^^^^^^^^^^^^ -------  -------
+help: remove the extra argument
+   |
+LL |   two_arg_same(1, 1);
+   |   ~~~~~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 2 arguments but 3 arguments were supplied
+  --> $DIR/extra_arguments.rs:23:3
+   |
+LL |   two_arg_diff(1, 1,     "");
+   |   ^^^^^^^^^^^^    - argument of type `&str` unexpected
+   |
+note: function defined here
+  --> $DIR/extra_arguments.rs:4:4
+   |
+LL | fn two_arg_diff(_a: i32, _b: &str) {}
+   |    ^^^^^^^^^^^^ -------  --------
+help: remove the extra argument
+   |
+LL |   two_arg_diff(1, "");
+   |   ~~~~~~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 2 arguments but 3 arguments were supplied
+  --> $DIR/extra_arguments.rs:24:3
+   |
+LL |   two_arg_same(
+   |   ^^^^^^^^^^^^
+...
+LL |     ""
+   |     -- argument unexpected
+   |
+note: function defined here
+  --> $DIR/extra_arguments.rs:3:4
+   |
+LL | fn two_arg_same(_a: i32, _b: i32) {}
+   |    ^^^^^^^^^^^^ -------  -------
+help: remove the extra argument
+   |
+LL |   two_arg_same(1, 1);
+   |   ~~~~~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 2 arguments but 3 arguments were supplied
+  --> $DIR/extra_arguments.rs:30:3
+   |
+LL |   two_arg_diff(
+   |   ^^^^^^^^^^^^
+LL |     1,
+LL |     1,
+   |     - argument of type `&str` unexpected
+   |
+note: function defined here
+  --> $DIR/extra_arguments.rs:4:4
+   |
+LL | fn two_arg_diff(_a: i32, _b: &str) {}
+   |    ^^^^^^^^^^^^ -------  --------
+help: remove the extra argument
+   |
+LL |   two_arg_diff(1, "");
+   |   ~~~~~~~~~~~~~~~~~~~
+
+error: aborting due to 14 previous errors
+
+For more information about this error, try `rustc --explain E0061`.
diff --git a/src/test/ui/argument-suggestions/invalid_arguments.rs b/src/test/ui/argument-suggestions/invalid_arguments.rs
new file mode 100644 (file)
index 0000000..53fbdd4
--- /dev/null
@@ -0,0 +1,43 @@
+// More nuanced test cases for invalid arguments #65853
+
+struct X {}
+
+fn one_arg(_a: i32) {}
+fn two_arg_same(_a: i32, _b: i32) {}
+fn two_arg_diff(_a: i32, _b: f32) {}
+fn three_arg_diff(_a: i32, _b: f32, _c: &str) {}
+fn three_arg_repeat(_a: i32, _b: i32, _c: &str) {}
+
+fn main() {
+  // Providing an incorrect argument for a single parameter function
+  one_arg(1.0); //~ ERROR mismatched types
+
+  // Providing one or two invalid arguments to a two parameter function
+  two_arg_same(1, ""); //~ ERROR mismatched types
+  two_arg_same("", 1); //~ ERROR mismatched types
+  two_arg_same("", ""); //~ ERROR arguments to this function are incorrect
+  two_arg_diff(1, ""); //~ ERROR mismatched types
+  two_arg_diff("", 1.0); //~ ERROR mismatched types
+  two_arg_diff("", ""); //~ ERROR arguments to this function are incorrect
+
+  // Providing invalid arguments to a three parameter function
+  three_arg_diff(X{}, 1.0, ""); //~ ERROR mismatched types
+  three_arg_diff(1, X {}, ""); //~ ERROR mismatched types
+  three_arg_diff(1, 1.0, X {}); //~ ERROR mismatched types
+
+  three_arg_diff(X {}, X {}, ""); //~ ERROR arguments to this function are incorrect
+  three_arg_diff(X {}, 1.0, X {}); //~ ERROR arguments to this function are incorrect
+  three_arg_diff(1, X {}, X {}); //~ ERROR arguments to this function are incorrect
+
+  three_arg_diff(X {}, X {}, X {}); //~ ERROR arguments to this function are incorrect
+
+  three_arg_repeat(X {}, 1, ""); //~ ERROR mismatched types
+  three_arg_repeat(1, X {}, ""); //~ ERROR mismatched types
+  three_arg_repeat(1, 1, X {}); //~ ERROR mismatched types
+
+  three_arg_repeat(X {}, X {}, ""); //~ ERROR arguments to this function are incorrect
+  three_arg_repeat(X {}, 1, X {}); //~ ERROR arguments to this function are incorrect
+  three_arg_repeat(1, X {}, X{}); //~ ERROR arguments to this function are incorrect
+
+  three_arg_repeat(X {}, X {}, X {}); //~ ERROR arguments to this function are incorrect
+}
diff --git a/src/test/ui/argument-suggestions/invalid_arguments.stderr b/src/test/ui/argument-suggestions/invalid_arguments.stderr
new file mode 100644 (file)
index 0000000..33f27d4
--- /dev/null
@@ -0,0 +1,299 @@
+error[E0308]: mismatched types
+  --> $DIR/invalid_arguments.rs:13:11
+   |
+LL |   one_arg(1.0);
+   |   ------- ^^^ expected `i32`, found floating-point number
+   |   |
+   |   arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/invalid_arguments.rs:5:4
+   |
+LL | fn one_arg(_a: i32) {}
+   |    ^^^^^^^ -------
+
+error[E0308]: mismatched types
+  --> $DIR/invalid_arguments.rs:16:19
+   |
+LL |   two_arg_same(1, "");
+   |   ------------    ^^ expected `i32`, found `&str`
+   |   |
+   |   arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/invalid_arguments.rs:6:4
+   |
+LL | fn two_arg_same(_a: i32, _b: i32) {}
+   |    ^^^^^^^^^^^^ -------  -------
+
+error[E0308]: mismatched types
+  --> $DIR/invalid_arguments.rs:17:16
+   |
+LL |   two_arg_same("", 1);
+   |   ------------ ^^ expected `i32`, found `&str`
+   |   |
+   |   arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/invalid_arguments.rs:6:4
+   |
+LL | fn two_arg_same(_a: i32, _b: i32) {}
+   |    ^^^^^^^^^^^^ -------  -------
+
+error[E0308]: arguments to this function are incorrect
+  --> $DIR/invalid_arguments.rs:18:3
+   |
+LL |   two_arg_same("", "");
+   |   ^^^^^^^^^^^^ --  -- expected `i32`, found `&str`
+   |                |
+   |                expected `i32`, found `&str`
+   |
+note: function defined here
+  --> $DIR/invalid_arguments.rs:6:4
+   |
+LL | fn two_arg_same(_a: i32, _b: i32) {}
+   |    ^^^^^^^^^^^^ -------  -------
+
+error[E0308]: mismatched types
+  --> $DIR/invalid_arguments.rs:19:19
+   |
+LL |   two_arg_diff(1, "");
+   |   ------------    ^^ expected `f32`, found `&str`
+   |   |
+   |   arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/invalid_arguments.rs:7:4
+   |
+LL | fn two_arg_diff(_a: i32, _b: f32) {}
+   |    ^^^^^^^^^^^^ -------  -------
+
+error[E0308]: mismatched types
+  --> $DIR/invalid_arguments.rs:20:16
+   |
+LL |   two_arg_diff("", 1.0);
+   |   ------------ ^^ expected `i32`, found `&str`
+   |   |
+   |   arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/invalid_arguments.rs:7:4
+   |
+LL | fn two_arg_diff(_a: i32, _b: f32) {}
+   |    ^^^^^^^^^^^^ -------  -------
+
+error[E0308]: arguments to this function are incorrect
+  --> $DIR/invalid_arguments.rs:21:3
+   |
+LL |   two_arg_diff("", "");
+   |   ^^^^^^^^^^^^ --  -- expected `f32`, found `&str`
+   |                |
+   |                expected `i32`, found `&str`
+   |
+note: function defined here
+  --> $DIR/invalid_arguments.rs:7:4
+   |
+LL | fn two_arg_diff(_a: i32, _b: f32) {}
+   |    ^^^^^^^^^^^^ -------  -------
+
+error[E0308]: mismatched types
+  --> $DIR/invalid_arguments.rs:24:18
+   |
+LL |   three_arg_diff(X{}, 1.0, "");
+   |   -------------- ^^^ expected `i32`, found struct `X`
+   |   |
+   |   arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/invalid_arguments.rs:8:4
+   |
+LL | fn three_arg_diff(_a: i32, _b: f32, _c: &str) {}
+   |    ^^^^^^^^^^^^^^ -------  -------  --------
+
+error[E0308]: mismatched types
+  --> $DIR/invalid_arguments.rs:25:21
+   |
+LL |   three_arg_diff(1, X {}, "");
+   |   --------------    ^^^^ expected `f32`, found struct `X`
+   |   |
+   |   arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/invalid_arguments.rs:8:4
+   |
+LL | fn three_arg_diff(_a: i32, _b: f32, _c: &str) {}
+   |    ^^^^^^^^^^^^^^ -------  -------  --------
+
+error[E0308]: mismatched types
+  --> $DIR/invalid_arguments.rs:26:26
+   |
+LL |   three_arg_diff(1, 1.0, X {});
+   |   --------------         ^^^^ expected `&str`, found struct `X`
+   |   |
+   |   arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/invalid_arguments.rs:8:4
+   |
+LL | fn three_arg_diff(_a: i32, _b: f32, _c: &str) {}
+   |    ^^^^^^^^^^^^^^ -------  -------  --------
+
+error[E0308]: arguments to this function are incorrect
+  --> $DIR/invalid_arguments.rs:28:3
+   |
+LL |   three_arg_diff(X {}, X {}, "");
+   |   ^^^^^^^^^^^^^^ ----  ---- expected `f32`, found struct `X`
+   |                  |
+   |                  expected `i32`, found struct `X`
+   |
+note: function defined here
+  --> $DIR/invalid_arguments.rs:8:4
+   |
+LL | fn three_arg_diff(_a: i32, _b: f32, _c: &str) {}
+   |    ^^^^^^^^^^^^^^ -------  -------  --------
+
+error[E0308]: arguments to this function are incorrect
+  --> $DIR/invalid_arguments.rs:29:3
+   |
+LL |   three_arg_diff(X {}, 1.0, X {});
+   |   ^^^^^^^^^^^^^^ ----       ---- expected `&str`, found struct `X`
+   |                  |
+   |                  expected `i32`, found struct `X`
+   |
+note: function defined here
+  --> $DIR/invalid_arguments.rs:8:4
+   |
+LL | fn three_arg_diff(_a: i32, _b: f32, _c: &str) {}
+   |    ^^^^^^^^^^^^^^ -------  -------  --------
+
+error[E0308]: arguments to this function are incorrect
+  --> $DIR/invalid_arguments.rs:30:3
+   |
+LL |   three_arg_diff(1, X {}, X {});
+   |   ^^^^^^^^^^^^^^    ----  ---- expected `&str`, found struct `X`
+   |                     |
+   |                     expected `f32`, found struct `X`
+   |
+note: function defined here
+  --> $DIR/invalid_arguments.rs:8:4
+   |
+LL | fn three_arg_diff(_a: i32, _b: f32, _c: &str) {}
+   |    ^^^^^^^^^^^^^^ -------  -------  --------
+
+error[E0308]: arguments to this function are incorrect
+  --> $DIR/invalid_arguments.rs:32:3
+   |
+LL |   three_arg_diff(X {}, X {}, X {});
+   |   ^^^^^^^^^^^^^^ ----  ----  ---- expected `&str`, found struct `X`
+   |                  |     |
+   |                  |     expected `f32`, found struct `X`
+   |                  expected `i32`, found struct `X`
+   |
+note: function defined here
+  --> $DIR/invalid_arguments.rs:8:4
+   |
+LL | fn three_arg_diff(_a: i32, _b: f32, _c: &str) {}
+   |    ^^^^^^^^^^^^^^ -------  -------  --------
+
+error[E0308]: mismatched types
+  --> $DIR/invalid_arguments.rs:34:20
+   |
+LL |   three_arg_repeat(X {}, 1, "");
+   |   ---------------- ^^^^ expected `i32`, found struct `X`
+   |   |
+   |   arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/invalid_arguments.rs:9:4
+   |
+LL | fn three_arg_repeat(_a: i32, _b: i32, _c: &str) {}
+   |    ^^^^^^^^^^^^^^^^ -------  -------  --------
+
+error[E0308]: mismatched types
+  --> $DIR/invalid_arguments.rs:35:23
+   |
+LL |   three_arg_repeat(1, X {}, "");
+   |   ----------------    ^^^^ expected `i32`, found struct `X`
+   |   |
+   |   arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/invalid_arguments.rs:9:4
+   |
+LL | fn three_arg_repeat(_a: i32, _b: i32, _c: &str) {}
+   |    ^^^^^^^^^^^^^^^^ -------  -------  --------
+
+error[E0308]: mismatched types
+  --> $DIR/invalid_arguments.rs:36:26
+   |
+LL |   three_arg_repeat(1, 1, X {});
+   |   ----------------       ^^^^ expected `&str`, found struct `X`
+   |   |
+   |   arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/invalid_arguments.rs:9:4
+   |
+LL | fn three_arg_repeat(_a: i32, _b: i32, _c: &str) {}
+   |    ^^^^^^^^^^^^^^^^ -------  -------  --------
+
+error[E0308]: arguments to this function are incorrect
+  --> $DIR/invalid_arguments.rs:38:3
+   |
+LL |   three_arg_repeat(X {}, X {}, "");
+   |   ^^^^^^^^^^^^^^^^ ----  ---- expected `i32`, found struct `X`
+   |                    |
+   |                    expected `i32`, found struct `X`
+   |
+note: function defined here
+  --> $DIR/invalid_arguments.rs:9:4
+   |
+LL | fn three_arg_repeat(_a: i32, _b: i32, _c: &str) {}
+   |    ^^^^^^^^^^^^^^^^ -------  -------  --------
+
+error[E0308]: arguments to this function are incorrect
+  --> $DIR/invalid_arguments.rs:39:3
+   |
+LL |   three_arg_repeat(X {}, 1, X {});
+   |   ^^^^^^^^^^^^^^^^ ----     ---- expected `&str`, found struct `X`
+   |                    |
+   |                    expected `i32`, found struct `X`
+   |
+note: function defined here
+  --> $DIR/invalid_arguments.rs:9:4
+   |
+LL | fn three_arg_repeat(_a: i32, _b: i32, _c: &str) {}
+   |    ^^^^^^^^^^^^^^^^ -------  -------  --------
+
+error[E0308]: arguments to this function are incorrect
+  --> $DIR/invalid_arguments.rs:40:3
+   |
+LL |   three_arg_repeat(1, X {}, X{});
+   |   ^^^^^^^^^^^^^^^^    ----  --- expected `&str`, found struct `X`
+   |                       |
+   |                       expected `i32`, found struct `X`
+   |
+note: function defined here
+  --> $DIR/invalid_arguments.rs:9:4
+   |
+LL | fn three_arg_repeat(_a: i32, _b: i32, _c: &str) {}
+   |    ^^^^^^^^^^^^^^^^ -------  -------  --------
+
+error[E0308]: arguments to this function are incorrect
+  --> $DIR/invalid_arguments.rs:42:3
+   |
+LL |   three_arg_repeat(X {}, X {}, X {});
+   |   ^^^^^^^^^^^^^^^^ ----  ----  ---- expected `&str`, found struct `X`
+   |                    |     |
+   |                    |     expected `i32`, found struct `X`
+   |                    expected `i32`, found struct `X`
+   |
+note: function defined here
+  --> $DIR/invalid_arguments.rs:9:4
+   |
+LL | fn three_arg_repeat(_a: i32, _b: i32, _c: &str) {}
+   |    ^^^^^^^^^^^^^^^^ -------  -------  --------
+
+error: aborting due to 21 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/argument-suggestions/missing_arguments.rs b/src/test/ui/argument-suggestions/missing_arguments.rs
new file mode 100644 (file)
index 0000000..ae0dabf
--- /dev/null
@@ -0,0 +1,40 @@
+fn one_arg(_a: i32) {}
+fn two_same(_a: i32, _b: i32) {}
+fn two_diff(_a: i32, _b: f32) {}
+fn three_same(_a: i32, _b: i32, _c: i32) {}
+fn three_diff(_a: i32, _b: f32, _c: &str) {}
+fn four_repeated(_a: i32, _b: f32, _c: f32, _d: &str) {}
+fn complex(_a: i32, _b: f32, _c: i32, _d: f32, _e: &str) {}
+
+fn main() {
+  one_arg(); //~ ERROR this function takes
+  // The headers here show the types expected,
+  // with formatting to emphasize which arguments are missing
+  /*         i32     f32    */
+  two_same(               ); //~ ERROR this function takes
+  two_same(   1           ); //~ ERROR this function takes
+  two_diff(               ); //~ ERROR this function takes
+  two_diff(   1           ); //~ ERROR this function takes
+  two_diff(          1.0  ); //~ ERROR this function takes
+
+  /*           i32     i32     i32    */
+  three_same(                       ); //~ ERROR this function takes
+  three_same(   1                   ); //~ ERROR this function takes
+  three_same(   1,      1           ); //~ ERROR this function takes
+
+  /*           i32     f32     &str   */
+  three_diff(          1.0,     ""  ); //~ ERROR this function takes
+  three_diff(   1,              ""  ); //~ ERROR this function takes
+  three_diff(   1,     1.0          ); //~ ERROR this function takes
+  three_diff(                   ""  ); //~ ERROR this function takes
+  three_diff(          1.0          ); //~ ERROR this function takes
+  three_diff(   1                   ); //~ ERROR this function takes
+
+  /*              i32     f32     f32     &str   */
+  four_repeated(                               ); //~ ERROR this function takes
+  four_repeated(   1,                     ""   ); //~ ERROR this function takes
+
+  /*        i32   f32   i32   f32   &str   */
+  complex(                               ); //~ ERROR this function takes
+  complex(   1,                     ""   ); //~ ERROR this function takes
+}
diff --git a/src/test/ui/argument-suggestions/missing_arguments.stderr b/src/test/ui/argument-suggestions/missing_arguments.stderr
new file mode 100644 (file)
index 0000000..b4dadb1
--- /dev/null
@@ -0,0 +1,310 @@
+error[E0061]: this function takes 1 argument but 0 arguments were supplied
+  --> $DIR/missing_arguments.rs:10:3
+   |
+LL |   one_arg();
+   |   ^^^^^^^-- an argument of type `i32` is missing
+   |
+note: function defined here
+  --> $DIR/missing_arguments.rs:1:4
+   |
+LL | fn one_arg(_a: i32) {}
+   |    ^^^^^^^ -------
+help: provide the argument
+   |
+LL |   one_arg({i32});
+   |   ~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 2 arguments but 0 arguments were supplied
+  --> $DIR/missing_arguments.rs:14:3
+   |
+LL |   two_same(               );
+   |   ^^^^^^^^----------------- two arguments of type `i32` and `i32` are missing
+   |
+note: function defined here
+  --> $DIR/missing_arguments.rs:2:4
+   |
+LL | fn two_same(_a: i32, _b: i32) {}
+   |    ^^^^^^^^ -------  -------
+help: provide the arguments
+   |
+LL |   two_same({i32}, {i32});
+   |   ~~~~~~~~~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 2 arguments but 1 argument was supplied
+  --> $DIR/missing_arguments.rs:15:3
+   |
+LL |   two_same(   1           );
+   |   ^^^^^^^^----------------- an argument of type `i32` is missing
+   |
+note: function defined here
+  --> $DIR/missing_arguments.rs:2:4
+   |
+LL | fn two_same(_a: i32, _b: i32) {}
+   |    ^^^^^^^^ -------  -------
+help: provide the argument
+   |
+LL |   two_same(1, {i32});
+   |   ~~~~~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 2 arguments but 0 arguments were supplied
+  --> $DIR/missing_arguments.rs:16:3
+   |
+LL |   two_diff(               );
+   |   ^^^^^^^^----------------- two arguments of type `i32` and `f32` are missing
+   |
+note: function defined here
+  --> $DIR/missing_arguments.rs:3:4
+   |
+LL | fn two_diff(_a: i32, _b: f32) {}
+   |    ^^^^^^^^ -------  -------
+help: provide the arguments
+   |
+LL |   two_diff({i32}, {f32});
+   |   ~~~~~~~~~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 2 arguments but 1 argument was supplied
+  --> $DIR/missing_arguments.rs:17:3
+   |
+LL |   two_diff(   1           );
+   |   ^^^^^^^^----------------- an argument of type `f32` is missing
+   |
+note: function defined here
+  --> $DIR/missing_arguments.rs:3:4
+   |
+LL | fn two_diff(_a: i32, _b: f32) {}
+   |    ^^^^^^^^ -------  -------
+help: provide the argument
+   |
+LL |   two_diff(1, {f32});
+   |   ~~~~~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 2 arguments but 1 argument was supplied
+  --> $DIR/missing_arguments.rs:18:3
+   |
+LL |   two_diff(          1.0  );
+   |   ^^^^^^^^           --- an argument of type `i32` is missing
+   |
+note: function defined here
+  --> $DIR/missing_arguments.rs:3:4
+   |
+LL | fn two_diff(_a: i32, _b: f32) {}
+   |    ^^^^^^^^ -------  -------
+help: provide the argument
+   |
+LL |   two_diff({i32}, 1.0);
+   |   ~~~~~~~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 3 arguments but 0 arguments were supplied
+  --> $DIR/missing_arguments.rs:21:3
+   |
+LL |   three_same(                       );
+   |   ^^^^^^^^^^------------------------- three arguments of type `i32`, `i32`, and `i32` are missing
+   |
+note: function defined here
+  --> $DIR/missing_arguments.rs:4:4
+   |
+LL | fn three_same(_a: i32, _b: i32, _c: i32) {}
+   |    ^^^^^^^^^^ -------  -------  -------
+help: provide the arguments
+   |
+LL |   three_same({i32}, {i32}, {i32});
+   |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 3 arguments but 1 argument was supplied
+  --> $DIR/missing_arguments.rs:22:3
+   |
+LL |   three_same(   1                   );
+   |   ^^^^^^^^^^------------------------- two arguments of type `i32` and `i32` are missing
+   |
+note: function defined here
+  --> $DIR/missing_arguments.rs:4:4
+   |
+LL | fn three_same(_a: i32, _b: i32, _c: i32) {}
+   |    ^^^^^^^^^^ -------  -------  -------
+help: provide the arguments
+   |
+LL |   three_same(1, {i32}, {i32});
+   |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 3 arguments but 2 arguments were supplied
+  --> $DIR/missing_arguments.rs:23:3
+   |
+LL |   three_same(   1,      1           );
+   |   ^^^^^^^^^^------------------------- an argument of type `i32` is missing
+   |
+note: function defined here
+  --> $DIR/missing_arguments.rs:4:4
+   |
+LL | fn three_same(_a: i32, _b: i32, _c: i32) {}
+   |    ^^^^^^^^^^ -------  -------  -------
+help: provide the argument
+   |
+LL |   three_same(1, 1, {i32});
+   |   ~~~~~~~~~~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 3 arguments but 2 arguments were supplied
+  --> $DIR/missing_arguments.rs:26:3
+   |
+LL |   three_diff(          1.0,     ""  );
+   |   ^^^^^^^^^^           --- an argument of type `i32` is missing
+   |
+note: function defined here
+  --> $DIR/missing_arguments.rs:5:4
+   |
+LL | fn three_diff(_a: i32, _b: f32, _c: &str) {}
+   |    ^^^^^^^^^^ -------  -------  --------
+help: provide the argument
+   |
+LL |   three_diff({i32}, 1.0, "");
+   |   ~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 3 arguments but 2 arguments were supplied
+  --> $DIR/missing_arguments.rs:27:3
+   |
+LL |   three_diff(   1,              ""  );
+   |   ^^^^^^^^^^                    -- an argument of type `f32` is missing
+   |
+note: function defined here
+  --> $DIR/missing_arguments.rs:5:4
+   |
+LL | fn three_diff(_a: i32, _b: f32, _c: &str) {}
+   |    ^^^^^^^^^^ -------  -------  --------
+help: provide the argument
+   |
+LL |   three_diff(1, {f32}, "");
+   |   ~~~~~~~~~~~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 3 arguments but 2 arguments were supplied
+  --> $DIR/missing_arguments.rs:28:3
+   |
+LL |   three_diff(   1,     1.0          );
+   |   ^^^^^^^^^^------------------------- an argument of type `&str` is missing
+   |
+note: function defined here
+  --> $DIR/missing_arguments.rs:5:4
+   |
+LL | fn three_diff(_a: i32, _b: f32, _c: &str) {}
+   |    ^^^^^^^^^^ -------  -------  --------
+help: provide the argument
+   |
+LL |   three_diff(1, 1.0, {&str});
+   |   ~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 3 arguments but 1 argument was supplied
+  --> $DIR/missing_arguments.rs:29:3
+   |
+LL |   three_diff(                   ""  );
+   |   ^^^^^^^^^^------------------------- two arguments of type `i32` and `f32` are missing
+   |
+note: function defined here
+  --> $DIR/missing_arguments.rs:5:4
+   |
+LL | fn three_diff(_a: i32, _b: f32, _c: &str) {}
+   |    ^^^^^^^^^^ -------  -------  --------
+help: provide the arguments
+   |
+LL |   three_diff({i32}, {f32}, "");
+   |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 3 arguments but 1 argument was supplied
+  --> $DIR/missing_arguments.rs:30:3
+   |
+LL |   three_diff(          1.0          );
+   |   ^^^^^^^^^^-------------------------
+   |             |          |
+   |             |          an argument of type `i32` is missing
+   |             an argument of type `&str` is missing
+   |
+note: function defined here
+  --> $DIR/missing_arguments.rs:5:4
+   |
+LL | fn three_diff(_a: i32, _b: f32, _c: &str) {}
+   |    ^^^^^^^^^^ -------  -------  --------
+help: provide the arguments
+   |
+LL |   three_diff({i32}, 1.0, {&str});
+   |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 3 arguments but 1 argument was supplied
+  --> $DIR/missing_arguments.rs:31:3
+   |
+LL |   three_diff(   1                   );
+   |   ^^^^^^^^^^------------------------- two arguments of type `f32` and `&str` are missing
+   |
+note: function defined here
+  --> $DIR/missing_arguments.rs:5:4
+   |
+LL | fn three_diff(_a: i32, _b: f32, _c: &str) {}
+   |    ^^^^^^^^^^ -------  -------  --------
+help: provide the arguments
+   |
+LL |   three_diff(1, {f32}, {&str});
+   |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 4 arguments but 0 arguments were supplied
+  --> $DIR/missing_arguments.rs:34:3
+   |
+LL |   four_repeated(                               );
+   |   ^^^^^^^^^^^^^--------------------------------- multiple arguments are missing
+   |
+note: function defined here
+  --> $DIR/missing_arguments.rs:6:4
+   |
+LL | fn four_repeated(_a: i32, _b: f32, _c: f32, _d: &str) {}
+   |    ^^^^^^^^^^^^^ -------  -------  -------  --------
+help: provide the arguments
+   |
+LL |   four_repeated({i32}, {f32}, {f32}, {&str});
+   |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 4 arguments but 2 arguments were supplied
+  --> $DIR/missing_arguments.rs:35:3
+   |
+LL |   four_repeated(   1,                     ""   );
+   |   ^^^^^^^^^^^^^--------------------------------- two arguments of type `f32` and `f32` are missing
+   |
+note: function defined here
+  --> $DIR/missing_arguments.rs:6:4
+   |
+LL | fn four_repeated(_a: i32, _b: f32, _c: f32, _d: &str) {}
+   |    ^^^^^^^^^^^^^ -------  -------  -------  --------
+help: provide the arguments
+   |
+LL |   four_repeated(1, {f32}, {f32}, "");
+   |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 5 arguments but 0 arguments were supplied
+  --> $DIR/missing_arguments.rs:38:3
+   |
+LL |   complex(                               );
+   |   ^^^^^^^--------------------------------- multiple arguments are missing
+   |
+note: function defined here
+  --> $DIR/missing_arguments.rs:7:4
+   |
+LL | fn complex(_a: i32, _b: f32, _c: i32, _d: f32, _e: &str) {}
+   |    ^^^^^^^ -------  -------  -------  -------  --------
+help: provide the arguments
+   |
+LL |   complex({i32}, {f32}, {i32}, {f32}, {&str});
+   |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 5 arguments but 2 arguments were supplied
+  --> $DIR/missing_arguments.rs:39:3
+   |
+LL |   complex(   1,                     ""   );
+   |   ^^^^^^^--------------------------------- three arguments of type `f32`, `i32`, and `i32` are missing
+   |
+note: function defined here
+  --> $DIR/missing_arguments.rs:7:4
+   |
+LL | fn complex(_a: i32, _b: f32, _c: i32, _d: f32, _e: &str) {}
+   |    ^^^^^^^ -------  -------  -------  -------  --------
+help: provide the arguments
+   |
+LL |   complex(1, {f32}, {i32}, {f32}, "");
+   |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+error: aborting due to 19 previous errors
+
+For more information about this error, try `rustc --explain E0061`.
diff --git a/src/test/ui/argument-suggestions/mixed_cases.rs b/src/test/ui/argument-suggestions/mixed_cases.rs
new file mode 100644 (file)
index 0000000..7367848
--- /dev/null
@@ -0,0 +1,24 @@
+// Cases where multiple argument suggestions are mixed
+
+struct X {}
+
+fn two_args(_a: i32, _b: f32) {}
+fn three_args(_a: i32, _b: f32, _c: &str) {}
+
+fn main() {
+  // Extra + Invalid
+  two_args(1, "", X {}); //~ ERROR this function takes
+  three_args(1, "", X {}, ""); //~ ERROR this function takes
+
+  // Missing and Invalid
+  three_args(1, X {}); //~ ERROR this function takes
+
+  // Missing and Extra
+  three_args(1, "", X {}); //~ ERROR arguments to this function are incorrect
+
+  // Swapped and Invalid
+  three_args("", X {}, 1); //~ ERROR arguments to this function are incorrect
+
+  // Swapped and missing
+  three_args("", 1); //~ ERROR this function takes
+}
diff --git a/src/test/ui/argument-suggestions/mixed_cases.stderr b/src/test/ui/argument-suggestions/mixed_cases.stderr
new file mode 100644 (file)
index 0000000..61da02f
--- /dev/null
@@ -0,0 +1,117 @@
+error[E0061]: this function takes 2 arguments but 3 arguments were supplied
+  --> $DIR/mixed_cases.rs:10:3
+   |
+LL |   two_args(1, "", X {});
+   |   ^^^^^^^^    --  ---- argument unexpected
+   |               |
+   |               expected `f32`, found `&str`
+   |
+note: function defined here
+  --> $DIR/mixed_cases.rs:5:4
+   |
+LL | fn two_args(_a: i32, _b: f32) {}
+   |    ^^^^^^^^ -------  -------
+help: remove the extra argument
+   |
+LL |   two_args(1, {f32});
+   |   ~~~~~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 3 arguments but 4 arguments were supplied
+  --> $DIR/mixed_cases.rs:11:3
+   |
+LL |   three_args(1, "", X {}, "");
+   |   ^^^^^^^^^^    --  ----  -- argument unexpected
+   |                 |   |
+   |                 |   argument of type `&str` unexpected
+   |                 an argument of type `f32` is missing
+   |
+note: function defined here
+  --> $DIR/mixed_cases.rs:6:4
+   |
+LL | fn three_args(_a: i32, _b: f32, _c: &str) {}
+   |    ^^^^^^^^^^ -------  -------  --------
+help: did you mean
+   |
+LL |   three_args(1, {f32}, "");
+   |   ~~~~~~~~~~~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 3 arguments but 2 arguments were supplied
+  --> $DIR/mixed_cases.rs:14:3
+   |
+LL |   three_args(1, X {});
+   |   ^^^^^^^^^^---------
+   |             |   |
+   |             |   expected `f32`, found struct `X`
+   |             an argument of type `&str` is missing
+   |
+note: function defined here
+  --> $DIR/mixed_cases.rs:6:4
+   |
+LL | fn three_args(_a: i32, _b: f32, _c: &str) {}
+   |    ^^^^^^^^^^ -------  -------  --------
+help: provide the argument
+   |
+LL |   three_args(1, {f32}, {&str});
+   |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+error[E0308]: arguments to this function are incorrect
+  --> $DIR/mixed_cases.rs:17:3
+   |
+LL |   three_args(1, "", X {});
+   |   ^^^^^^^^^^    --  ---- argument of type `&str` unexpected
+   |                 |
+   |                 an argument of type `f32` is missing
+   |
+note: function defined here
+  --> $DIR/mixed_cases.rs:6:4
+   |
+LL | fn three_args(_a: i32, _b: f32, _c: &str) {}
+   |    ^^^^^^^^^^ -------  -------  --------
+help: did you mean
+   |
+LL |   three_args(1, {f32}, "");
+   |   ~~~~~~~~~~~~~~~~~~~~~~~~
+
+error[E0308]: arguments to this function are incorrect
+  --> $DIR/mixed_cases.rs:20:3
+   |
+LL |   three_args("", X {}, 1);
+   |   ^^^^^^^^^^ --  ----  - expected `&str`,found `{integer}`
+   |              |   |
+   |              |   expected `f32`, found struct `X`
+   |              expected `i32`,found `&'static str`
+   |
+note: function defined here
+  --> $DIR/mixed_cases.rs:6:4
+   |
+LL | fn three_args(_a: i32, _b: f32, _c: &str) {}
+   |    ^^^^^^^^^^ -------  -------  --------
+help: swap these arguments
+   |
+LL |   three_args(1, {f32}, "");
+   |   ~~~~~~~~~~~~~~~~~~~~~~~~
+
+error[E0061]: this function takes 3 arguments but 2 arguments were supplied
+  --> $DIR/mixed_cases.rs:23:3
+   |
+LL |   three_args("", 1);
+   |   ^^^^^^^^^^ --  -
+   |              |   |
+   |              |   an argument of type `f32` is missing
+   |              |   expected `&str`,found `{integer}`
+   |              expected `i32`,found `&'static str`
+   |
+note: function defined here
+  --> $DIR/mixed_cases.rs:6:4
+   |
+LL | fn three_args(_a: i32, _b: f32, _c: &str) {}
+   |    ^^^^^^^^^^ -------  -------  --------
+help: did you mean
+   |
+LL |   three_args(1, {f32}, "");
+   |   ~~~~~~~~~~~~~~~~~~~~~~~~
+
+error: aborting due to 6 previous errors
+
+Some errors have detailed explanations: E0061, E0308.
+For more information about an error, try `rustc --explain E0061`.
diff --git a/src/test/ui/argument-suggestions/permuted_arguments.rs b/src/test/ui/argument-suggestions/permuted_arguments.rs
new file mode 100644 (file)
index 0000000..f512fde
--- /dev/null
@@ -0,0 +1,13 @@
+// More complicated permutations
+struct X {}
+struct Y {}
+
+fn three_args(_a: i32, _b: f32, _c: &str) {}
+fn many_args(_a: i32, _b: f32, _c: &str, _d: X, _e: Y) {}
+
+fn main() {
+  // b, c, a
+  three_args(1.0, "", 1); //~ ERROR arguments to this function are incorrect
+  // d, e, b, a, c
+  many_args(X {}, Y {}, 1, 1.0, ""); //~ ERROR arguments to this function are incorrect
+}
diff --git a/src/test/ui/argument-suggestions/permuted_arguments.stderr b/src/test/ui/argument-suggestions/permuted_arguments.stderr
new file mode 100644 (file)
index 0000000..52890f4
--- /dev/null
@@ -0,0 +1,43 @@
+error[E0308]: arguments to this function are incorrect
+  --> $DIR/permuted_arguments.rs:10:3
+   |
+LL |   three_args(1.0, "", 1);
+   |   ^^^^^^^^^^ ---  --  - expected `&str`,found `{integer}`
+   |              |    |
+   |              |    expected `f32`,found `&'static str`
+   |              expected `i32`,found `{float}`
+   |
+note: function defined here
+  --> $DIR/permuted_arguments.rs:5:4
+   |
+LL | fn three_args(_a: i32, _b: f32, _c: &str) {}
+   |    ^^^^^^^^^^ -------  -------  --------
+help: reorder these arguments
+   |
+LL |   three_args(1, 1.0, "");
+   |   ~~~~~~~~~~~~~~~~~~~~~~
+
+error[E0308]: arguments to this function are incorrect
+  --> $DIR/permuted_arguments.rs:12:3
+   |
+LL |   many_args(X {}, Y {}, 1, 1.0, "");
+   |   ^^^^^^^^^ ----  ----  -  ---  -- expected `Y`,found `&'static str`
+   |             |     |     |  |
+   |             |     |     |  expected `X`,found `{float}`
+   |             |     |     expected `&str`,found `{integer}`
+   |             |     expected `f32`,found `Y`
+   |             expected `i32`,found `X`
+   |
+note: function defined here
+  --> $DIR/permuted_arguments.rs:6:4
+   |
+LL | fn many_args(_a: i32, _b: f32, _c: &str, _d: X, _e: Y) {}
+   |    ^^^^^^^^^ -------  -------  --------  -----  -----
+help: reorder these arguments
+   |
+LL |   many_args(1, 1.0, "", X {}, Y {});
+   |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/argument-suggestions/swapped_arguments.rs b/src/test/ui/argument-suggestions/swapped_arguments.rs
new file mode 100644 (file)
index 0000000..a21de61
--- /dev/null
@@ -0,0 +1,14 @@
+struct X {}
+
+fn two_args(_a: i32, _b: f32) {}
+fn three_args(_a: i32, _b: f32, _c: &str) {}
+fn four_args(_a: i32, _b: f32, _c: &str, _d: X) {}
+
+fn main() {
+  two_args(1.0, 1); //~ ERROR arguments to this function are incorrect
+  three_args(1.0,   1,  ""); //~ ERROR arguments to this function are incorrect
+  three_args(  1,  "", 1.0); //~ ERROR arguments to this function are incorrect
+  three_args( "", 1.0,   1); //~ ERROR arguments to this function are incorrect
+
+  four_args(1.0, 1, X {}, ""); //~ ERROR arguments to this function are incorrect
+}
diff --git a/src/test/ui/argument-suggestions/swapped_arguments.stderr b/src/test/ui/argument-suggestions/swapped_arguments.stderr
new file mode 100644 (file)
index 0000000..672f0d5
--- /dev/null
@@ -0,0 +1,95 @@
+error[E0308]: arguments to this function are incorrect
+  --> $DIR/swapped_arguments.rs:8:3
+   |
+LL |   two_args(1.0, 1);
+   |   ^^^^^^^^ ---  - expected `f32`,found `{integer}`
+   |            |
+   |            expected `i32`,found `{float}`
+   |
+note: function defined here
+  --> $DIR/swapped_arguments.rs:3:4
+   |
+LL | fn two_args(_a: i32, _b: f32) {}
+   |    ^^^^^^^^ -------  -------
+help: swap these arguments
+   |
+LL |   two_args(1, 1.0);
+   |   ~~~~~~~~~~~~~~~~
+
+error[E0308]: arguments to this function are incorrect
+  --> $DIR/swapped_arguments.rs:9:3
+   |
+LL |   three_args(1.0,   1,  "");
+   |   ^^^^^^^^^^ ---    - expected `f32`,found `{integer}`
+   |              |
+   |              expected `i32`,found `{float}`
+   |
+note: function defined here
+  --> $DIR/swapped_arguments.rs:4:4
+   |
+LL | fn three_args(_a: i32, _b: f32, _c: &str) {}
+   |    ^^^^^^^^^^ -------  -------  --------
+help: swap these arguments
+   |
+LL |   three_args(1, 1.0, "");
+   |   ~~~~~~~~~~~~~~~~~~~~~~
+
+error[E0308]: arguments to this function are incorrect
+  --> $DIR/swapped_arguments.rs:10:3
+   |
+LL |   three_args(  1,  "", 1.0);
+   |   ^^^^^^^^^^       --  --- expected `&str`,found `{float}`
+   |                    |
+   |                    expected `f32`,found `&'static str`
+   |
+note: function defined here
+  --> $DIR/swapped_arguments.rs:4:4
+   |
+LL | fn three_args(_a: i32, _b: f32, _c: &str) {}
+   |    ^^^^^^^^^^ -------  -------  --------
+help: swap these arguments
+   |
+LL |   three_args(1, 1.0, "");
+   |   ~~~~~~~~~~~~~~~~~~~~~~
+
+error[E0308]: arguments to this function are incorrect
+  --> $DIR/swapped_arguments.rs:11:3
+   |
+LL |   three_args( "", 1.0,   1);
+   |   ^^^^^^^^^^  --         - expected `&str`,found `{integer}`
+   |               |
+   |               expected `i32`,found `&'static str`
+   |
+note: function defined here
+  --> $DIR/swapped_arguments.rs:4:4
+   |
+LL | fn three_args(_a: i32, _b: f32, _c: &str) {}
+   |    ^^^^^^^^^^ -------  -------  --------
+help: swap these arguments
+   |
+LL |   three_args(1, 1.0, "");
+   |   ~~~~~~~~~~~~~~~~~~~~~~
+
+error[E0308]: arguments to this function are incorrect
+  --> $DIR/swapped_arguments.rs:13:3
+   |
+LL |   four_args(1.0, 1, X {}, "");
+   |   ^^^^^^^^^ ---  -  ----  -- expected `X`,found `&'static str`
+   |             |    |  |
+   |             |    |  expected `&str`,found `X`
+   |             |    expected `f32`,found `{integer}`
+   |             expected `i32`,found `{float}`
+   |
+note: function defined here
+  --> $DIR/swapped_arguments.rs:5:4
+   |
+LL | fn four_args(_a: i32, _b: f32, _c: &str, _d: X) {}
+   |    ^^^^^^^^^ -------  -------  --------  -----
+help: did you mean
+   |
+LL |   four_args(1, 1.0, "", X {});
+   |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+error: aborting due to 5 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
index 07f207627f4df2faadd79986c7a2d292c9b03446..b904ad102e97e794468a1281066144f9577e66ed 100644 (file)
@@ -2,25 +2,57 @@ error[E0308]: mismatched types
   --> $DIR/associated-type-projection-from-supertrait.rs:27:23
    |
 LL | fn b() { dent(ModelT, Blue); }
-   |                       ^^^^ expected struct `Black`, found struct `Blue`
+   |          ----         ^^^^ expected struct `Black`, found struct `Blue`
+   |          |
+   |          arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/associated-type-projection-from-supertrait.rs:25:4
+   |
+LL | fn dent<C:Car>(c: C, color: C::Color) { c.chip_paint(color) }
+   |    ^^^^        ----  ---------------
 
 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`
+   |          ----         ^^^^^ expected struct `Blue`, found struct `Black`
+   |          |
+   |          arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/associated-type-projection-from-supertrait.rs:25:4
+   |
+LL | fn dent<C:Car>(c: C, color: C::Color) { c.chip_paint(color) }
+   |    ^^^^        ----  ---------------
 
 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`
+   |                 ---------- ^^^^ expected struct `Black`, found struct `Blue`
+   |                 |
+   |                 arguments to this function are incorrect
+   |
+note: associated function defined here
+  --> $DIR/associated-type-projection-from-supertrait.rs:12:8
+   |
+LL |     fn chip_paint(&self, c: Self::Color) { }
+   |        ^^^^^^^^^^ -----  --------------
 
 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`
+   |                 ---------- ^^^^^ expected struct `Blue`, found struct `Black`
+   |                 |
+   |                 arguments to this function are incorrect
+   |
+note: associated function defined here
+  --> $DIR/associated-type-projection-from-supertrait.rs:12:8
+   |
+LL |     fn chip_paint(&self, c: Self::Color) { }
+   |        ^^^^^^^^^^ -----  --------------
 
 error: aborting due to 4 previous errors
 
index 2d8d513409d3a83dcc70f6343a05bc772a66272e..1d0b84d31d4104e4331424a3618ca45d7e07670a 100644 (file)
@@ -2,8 +2,15 @@ error[E0308]: mismatched types
   --> $DIR/associated-types-path-2.rs:19:14
    |
 LL |     f1(2i32, 4i32);
-   |              ^^^^ expected `u32`, found `i32`
+   |     --       ^^^^ expected `u32`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/associated-types-path-2.rs:13:8
    |
+LL | pub fn f1<T: Foo>(a: T, x: T::A) {}
+   |        ^^         ----  -------
 help: change the type of the numeric literal from `i32` to `u32`
    |
 LL |     f1(2i32, 4u32);
index 289a567209c4958ea5c50ca1b82c336d478eb423..627bf05bba2d9c77110d0f7b00af849089c8b5d1 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/dont-suggest-missing-await.rs:14:18
    |
 LL |         take_u32(x)
-   |                  ^ expected `u32`, found opaque type
+   |         -------- ^ expected `u32`, found opaque type
+   |         |
+   |         arguments to this function are incorrect
    |
 note: while checking the return type of the `async fn`
   --> $DIR/dont-suggest-missing-await.rs:7:24
@@ -11,6 +13,11 @@ LL | async fn make_u32() -> u32 {
    |                        ^^^ checked the `Output` of this `async fn`, found opaque type
    = note:     expected type `u32`
            found opaque type `impl Future<Output = u32>`
+note: function defined here
+  --> $DIR/dont-suggest-missing-await.rs:5:4
+   |
+LL | fn take_u32(x: u32) {}
+   |    ^^^^^^^^ ------
 help: consider `await`ing on the `Future`
    |
 LL |         take_u32(x.await)
index 3ebc4392f2c8d85a9a103eed8930fa7eb0b41056..b205fd619155e447de187a27327f1ef846728640 100644 (file)
@@ -2,52 +2,67 @@ error[E0308]: mismatched types
   --> $DIR/generator-desc.rs:10:25
    |
 LL |     fun(async {}, async {});
-   |               --        ^^ expected `async` block, found a different `async` block
-   |               |
+   |               --        ^^
+   |               |         |
+   |               |         expected `async` block, found a different `async` block
+   |               |         arguments to this function are incorrect
    |               the expected `async` block
    |
    = note: expected `async` block `[static generator@$DIR/generator-desc.rs:10:15: 10:17]`
               found `async` block `[static generator@$DIR/generator-desc.rs:10:25: 10:27]`
+note: function defined here
+  --> $SRC_DIR/core/src/future/mod.rs:LL:COL
+   |
+LL | pub const fn from_generator<T>(gen: T) -> impl Future<Output = T::Return>
+   |              ^^^^^^^^^^^^^^
 
 error[E0308]: mismatched types
   --> $DIR/generator-desc.rs:12:16
    |
 LL |     fun(one(), two());
-   |                ^^^^^ expected opaque type, found a different opaque type
-   |
-note: while checking the return type of the `async fn`
-  --> $DIR/generator-desc.rs:5:16
+   |     ---        ^^^^^ expected opaque type, found a different opaque type
+   |     |
+   |     arguments to this function are incorrect
    |
-LL | async fn one() {}
-   |                ^ checked the `Output` of this `async fn`, expected opaque type
 note: while checking the return type of the `async fn`
   --> $DIR/generator-desc.rs:6:16
    |
 LL | async fn two() {}
    |                ^ checked the `Output` of this `async fn`, found opaque type
-   = note: expected opaque type `impl Future<Output = ()>` (opaque type at <$DIR/generator-desc.rs:5:16>)
-              found opaque type `impl Future<Output = ()>` (opaque type at <$DIR/generator-desc.rs:6:16>)
+   = note:     expected type `impl Future<Output = ()>` (opaque type at <$DIR/generator-desc.rs:5:16>)
+           found opaque type `impl Future<Output = ()>` (opaque type at <$DIR/generator-desc.rs:6:16>)
    = help: consider `await`ing on both `Future`s
    = note: distinct uses of `impl Trait` result in different opaque types
+note: function defined here
+  --> $DIR/generator-desc.rs:8:4
+   |
+LL | fn fun<F: Future<Output = ()>>(f1: F, f2: F) {}
+   |    ^^^                         -----  -----
 
 error[E0308]: mismatched types
   --> $DIR/generator-desc.rs:14:26
    |
 LL |     fun((async || {})(), (async || {})());
-   |                   --     ^^^^^^^^^^^^^^^ expected `async` closure body, found a different `async` closure body
-   |                   |
-   |                   the expected `async` closure body
+   |     ---                  ^^^^^^^^^^^^^^^ expected `async` closure body, found a different `async` closure body
+   |     |
+   |     arguments to this function are incorrect
    |
   ::: $SRC_DIR/core/src/future/mod.rs:LL:COL
    |
 LL | pub const fn from_generator<T>(gen: T) -> impl Future<Output = T::Return>
-   |                                           -------------------------------
-   |                                           |
-   |                                           the expected opaque type
-   |                                           the found opaque type
+   |                                           ------------------------------- the found opaque type
+   |
+   = note:     expected type `impl Future<Output = ()>` (`async` closure body)
+           found opaque type `impl Future<Output = ()>` (`async` closure body)
+note: function defined here
+  --> $DIR/generator-desc.rs:8:4
+   |
+LL | fn fun<F: Future<Output = ()>>(f1: F, f2: F) {}
+   |    ^^^                         -----  -----
+help: consider `await`ing on the `Future`
    |
-   = note: expected opaque type `impl Future<Output = ()>` (`async` closure body)
-              found opaque type `impl Future<Output = ()>` (`async` closure body)
+LL |     fun((async || {})(), (async || {})().await);
+   |                                         ++++++
 
 error: aborting due to 3 previous errors
 
index d951c8ed094e703dd42041e9903a17a50fe2b580..a5958baffbaf72719eb8ba87c6f3f17163c2ea4b 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/suggest-missing-await-closure.rs:16:18
    |
 LL |         take_u32(x)
-   |                  ^ expected `u32`, found opaque type
+   |         -------- ^ expected `u32`, found opaque type
+   |         |
+   |         arguments to this function are incorrect
    |
 note: while checking the return type of the `async fn`
   --> $DIR/suggest-missing-await-closure.rs:8:24
@@ -11,6 +13,11 @@ LL | async fn make_u32() -> u32 {
    |                        ^^^ checked the `Output` of this `async fn`, found opaque type
    = note:     expected type `u32`
            found opaque type `impl Future<Output = u32>`
+note: function defined here
+  --> $DIR/suggest-missing-await-closure.rs:6:4
+   |
+LL | fn take_u32(_x: u32) {}
+   |    ^^^^^^^^ -------
 help: consider `await`ing on the `Future`
    |
 LL |         take_u32(x.await)
index 76073c4c879967d48a99ac596fc71ef10eb60665..ba9ed5cb65fc9b716ec4ae1285ec1a5a695a8783 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/suggest-missing-await.rs:12:14
    |
 LL |     take_u32(x)
-   |              ^ expected `u32`, found opaque type
+   |     -------- ^ expected `u32`, found opaque type
+   |     |
+   |     arguments to this function are incorrect
    |
 note: while checking the return type of the `async fn`
   --> $DIR/suggest-missing-await.rs:5:24
@@ -11,6 +13,11 @@ LL | async fn make_u32() -> u32 {
    |                        ^^^ checked the `Output` of this `async fn`, found opaque type
    = note:     expected type `u32`
            found opaque type `impl Future<Output = u32>`
+note: function defined here
+  --> $DIR/suggest-missing-await.rs:3:4
+   |
+LL | fn take_u32(_x: u32) {}
+   |    ^^^^^^^^ -------
 help: consider `await`ing on the `Future`
    |
 LL |     take_u32(x.await)
index 5b4e656d9dca147a55d638380c30ad360e02913f..9acf1e93b077395a4f2e65daea7d26c987eb5946 100644 (file)
@@ -8,29 +8,33 @@ error[E0060]: this function takes at least 2 arguments but 0 arguments were supp
   --> $DIR/variadic-ffi-1.rs:20:9
    |
 LL |         foo();
-   |         ^^^-- supplied 0 arguments
-   |         |
-   |         expected at least 2 arguments
+   |         ^^^-- two arguments of type `isize` and `u8` are missing
    |
 note: function defined here
   --> $DIR/variadic-ffi-1.rs:13:8
    |
 LL |     fn foo(f: isize, x: u8, ...);
    |        ^^^
+help: provide the arguments
+   |
+LL |         foo({isize}, {u8});
+   |         ~~~~~~~~~~~~~~~~~~
 
 error[E0060]: this function takes at least 2 arguments but 1 argument was supplied
   --> $DIR/variadic-ffi-1.rs:21:9
    |
 LL |         foo(1);
-   |         ^^^ - supplied 1 argument
-   |         |
-   |         expected at least 2 arguments
+   |         ^^^--- an argument of type `u8` is missing
    |
 note: function defined here
   --> $DIR/variadic-ffi-1.rs:13:8
    |
 LL |     fn foo(f: isize, x: u8, ...);
    |        ^^^
+help: provide the argument
+   |
+LL |         foo(1, {u8});
+   |         ~~~~~~~~~~~~
 
 error[E0308]: mismatched types
   --> $DIR/variadic-ffi-1.rs:23:56
index 55b9462db8df818e73bc23836bb26fa184ce2c81..ef606b6ae5fd4e5e687a7d72b615388b184373e3 100644 (file)
@@ -2,8 +2,15 @@ error[E0308]: mismatched types
   --> $DIR/cast-int-to-char.rs:4:16
    |
 LL |     foo::<u32>('0');
-   |                ^^^ expected `u32`, found `char`
+   |     ---------- ^^^ expected `u32`, found `char`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/cast-int-to-char.rs:1:4
+   |
+LL | fn foo<T>(_t: T) {}
+   |    ^^^    -----
 help: you can cast a `char` to a `u32`, since a `char` always occupies 4 bytes
    |
 LL |     foo::<u32>('0' as u32);
@@ -13,8 +20,15 @@ error[E0308]: mismatched types
   --> $DIR/cast-int-to-char.rs:5:16
    |
 LL |     foo::<i32>('0');
-   |                ^^^ expected `i32`, found `char`
+   |     ---------- ^^^ expected `i32`, found `char`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/cast-int-to-char.rs:1:4
    |
+LL | fn foo<T>(_t: T) {}
+   |    ^^^    -----
 help: you can cast a `char` to an `i32`, since a `char` always occupies 4 bytes
    |
 LL |     foo::<i32>('0' as i32);
@@ -24,8 +38,15 @@ error[E0308]: mismatched types
   --> $DIR/cast-int-to-char.rs:6:16
    |
 LL |     foo::<u64>('0');
-   |                ^^^ expected `u64`, found `char`
+   |     ---------- ^^^ expected `u64`, found `char`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/cast-int-to-char.rs:1:4
    |
+LL | fn foo<T>(_t: T) {}
+   |    ^^^    -----
 help: you can cast a `char` to a `u64`, since a `char` always occupies 4 bytes
    |
 LL |     foo::<u64>('0' as u64);
@@ -35,8 +56,15 @@ error[E0308]: mismatched types
   --> $DIR/cast-int-to-char.rs:7:16
    |
 LL |     foo::<i64>('0');
-   |                ^^^ expected `i64`, found `char`
+   |     ---------- ^^^ expected `i64`, found `char`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/cast-int-to-char.rs:1:4
+   |
+LL | fn foo<T>(_t: T) {}
+   |    ^^^    -----
 help: you can cast a `char` to an `i64`, since a `char` always occupies 4 bytes
    |
 LL |     foo::<i64>('0' as i64);
@@ -46,7 +74,15 @@ error[E0308]: mismatched types
   --> $DIR/cast-int-to-char.rs:8:17
    |
 LL |     foo::<char>(0u32);
-   |                 ^^^^ expected `char`, found `u32`
+   |     ----------- ^^^^ expected `char`, found `u32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/cast-int-to-char.rs:1:4
+   |
+LL | fn foo<T>(_t: T) {}
+   |    ^^^    -----
 
 error: aborting due to 5 previous errors
 
index 37813879ce7529d96fb4f656b6683c7654df9045..534828ab348fd32e09ba5d6b0583698272329c4b 100644 (file)
@@ -4,7 +4,9 @@ error[E0308]: mismatched types
 LL |     let f = |s: &str| println!("{}{}", s, string);
    |             ------------------------------------- the found closure
 LL |     call_bare(f)
-   |               ^ expected fn pointer, found closure
+   |     --------- ^ expected fn pointer, found closure
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected fn pointer `for<'r> fn(&'r str)`
                  found closure `[closure@$DIR/closure-reform-bad.rs:10:13: 10:50]`
@@ -13,6 +15,11 @@ note: closures can only be coerced to `fn` types if they do not capture any vari
    |
 LL |     let f = |s: &str| println!("{}{}", s, string);
    |                                           ^^^^^^ `string` captured here
+note: function defined here
+  --> $DIR/closure-reform-bad.rs:4:4
+   |
+LL | fn call_bare(f: fn(&str)) {
+   |    ^^^^^^^^^ -----------
 
 error: aborting due to previous error
 
index 70d9273ddf7ceb2af8dbd68ac158757b3d1ee232..09c44d261af0c449f373aeef4850a883f9d5761c 100644 (file)
@@ -2,13 +2,20 @@ error[E0308]: mismatched types
   --> $DIR/issue-84128.rs:13:13
    |
 LL |         Foo(())
-   |             ^^ expected integer, found `()`
+   |         --- ^^ expected integer, found `()`
+   |         |
+   |         arguments to this struct are incorrect
    |
 note: return type inferred to be `{integer}` here
   --> $DIR/issue-84128.rs:10:20
    |
 LL |             return Foo(0);
    |                    ^^^^^^
+note: tuple struct defined here
+  --> $DIR/issue-84128.rs:5:8
+   |
+LL | struct Foo<T>(T);
+   |        ^^^
 
 error: aborting due to previous error
 
index a3cff2c12124ae4fc533207fb0c3a8e304966a13..b35fa2b8c9aba0951f7547f2f0d8bb26eef2e611 100644 (file)
@@ -2,19 +2,25 @@ error[E0308]: mismatched types
   --> $DIR/issue-87461.rs:10:8
    |
 LL |     Ok(())
-   |        ^^ expected `u16`, found `()`
+   |     -- ^^ expected `u16`, found `()`
+   |     |
+   |     arguments to this enum variant are incorrect
 
 error[E0308]: mismatched types
   --> $DIR/issue-87461.rs:17:8
    |
 LL |     Ok(())
-   |        ^^ expected `u16`, found `()`
+   |     -- ^^ expected `u16`, found `()`
+   |     |
+   |     arguments to this enum variant are incorrect
 
 error[E0308]: mismatched types
   --> $DIR/issue-87461.rs:26:12
    |
 LL |         Ok(())
-   |            ^^ expected `u16`, found `()`
+   |         -- ^^ expected `u16`, found `()`
+   |         |
+   |         arguments to this enum variant are incorrect
 
 error: aborting due to 3 previous errors
 
index 2601ca5e91e5b4253a85258d7998dced020b674f..11a4f310154c539a8e40b72406e6639feef6c809 100644 (file)
@@ -2,10 +2,17 @@ error[E0308]: mismatched types
   --> $DIR/coerce-mut.rs:5:7
    |
 LL |     f(&x);
-   |       ^^ types differ in mutability
+   |     - ^^ types differ in mutability
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected mutable reference `&mut i32`
                       found reference `&{integer}`
+note: function defined here
+  --> $DIR/coerce-mut.rs:1:4
+   |
+LL | fn f(x: &mut i32) {}
+   |    ^ -----------
 
 error: aborting due to previous error
 
index 59b0ec496f16f5a2e4c721ee7d1f08883a964fb7..4f266b166d6987753d81957f2371962a8121661e 100644 (file)
@@ -2,10 +2,17 @@ error[E0308]: mismatched types
   --> $DIR/coerce-reborrow-multi-arg-fail.rs:4:18
    |
 LL |     test(&mut 7, &7);
-   |                  ^^ types differ in mutability
+   |     ----         ^^ types differ in mutability
+   |     |
+   |     arguments to this function are incorrect
    |
-   = note: expected mutable reference `&mut {integer}`
-                      found reference `&{integer}`
+   = note:   expected type `&mut {integer}`
+           found reference `&{integer}`
+note: function defined here
+  --> $DIR/coerce-reborrow-multi-arg-fail.rs:1:4
+   |
+LL | fn test<T>(_a: T, _b: T) {}
+   |    ^^^^    -----  -----
 
 error: aborting due to previous error
 
index 390aa7c692d1860829d15cf95521858fb82b7b77..add8f14cfa591884a3ee3fb8805313d85ec8144b 100644 (file)
@@ -2,46 +2,81 @@ error[E0308]: mismatched types
   --> $DIR/coerce-to-bang.rs:6:17
    |
 LL |     foo(return, 22, 44);
-   |                 ^^ expected `!`, found integer
+   |     ---         ^^ expected `!`, found integer
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected type `!`
               found type `{integer}`
+note: function defined here
+  --> $DIR/coerce-to-bang.rs:3:4
+   |
+LL | fn foo(x: usize, y: !, z: usize) { }
+   |    ^^^ --------  ----  --------
 
 error[E0308]: mismatched types
   --> $DIR/coerce-to-bang.rs:18:13
    |
 LL |     foo(22, 44, return);
-   |             ^^ expected `!`, found integer
+   |     ---     ^^ expected `!`, found integer
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected type `!`
               found type `{integer}`
+note: function defined here
+  --> $DIR/coerce-to-bang.rs:3:4
+   |
+LL | fn foo(x: usize, y: !, z: usize) { }
+   |    ^^^ --------  ----  --------
 
 error[E0308]: mismatched types
   --> $DIR/coerce-to-bang.rs:26:12
    |
 LL |     foo(a, b, c); // ... and hence a reference to `a` is expected to diverge.
-   |            ^ expected `!`, found integer
+   |     ---    ^ expected `!`, found integer
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected type `!`
               found type `{integer}`
+note: function defined here
+  --> $DIR/coerce-to-bang.rs:3:4
+   |
+LL | fn foo(x: usize, y: !, z: usize) { }
+   |    ^^^ --------  ----  --------
 
 error[E0308]: mismatched types
   --> $DIR/coerce-to-bang.rs:36:12
    |
 LL |     foo(a, b, c);
-   |            ^ expected `!`, found integer
+   |     ---    ^ expected `!`, found integer
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected type `!`
               found type `{integer}`
+note: function defined here
+  --> $DIR/coerce-to-bang.rs:3:4
+   |
+LL | fn foo(x: usize, y: !, z: usize) { }
+   |    ^^^ --------  ----  --------
 
 error[E0308]: mismatched types
   --> $DIR/coerce-to-bang.rs:45:12
    |
 LL |     foo(a, b, c);
-   |            ^ expected `!`, found integer
+   |     ---    ^ expected `!`, found integer
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected type `!`
               found type `{integer}`
+note: function defined here
+  --> $DIR/coerce-to-bang.rs:3:4
+   |
+LL | fn foo(x: usize, y: !, z: usize) { }
+   |    ^^^ --------  ----  --------
 
 error[E0308]: mismatched types
   --> $DIR/coerce-to-bang.rs:50:21
diff --git a/src/test/ui/const-generics/const-argument-cross-crate-mismatch.min.stderr b/src/test/ui/const-generics/const-argument-cross-crate-mismatch.min.stderr
new file mode 100644 (file)
index 0000000..e9854f0
--- /dev/null
@@ -0,0 +1,29 @@
+error[E0308]: arguments to this function are incorrect
+  --> $DIR/const-argument-cross-crate-mismatch.rs:7:41
+   |
+LL |     let _ = const_generic_lib::function(const_generic_lib::Struct([0u8, 1u8]));
+   |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^----------^
+   |                                                                   |
+   |                                                                   expected `[u8; 3]`, found `[u8; 2]`
+   |
+help: provide an argument of the correct type
+   |
+LL |     let _ = const_generic_lib::function(({[u8; 3]}));
+   |                                         ^^^^^^^^^^^
+
+error[E0308]: arguments to this function are incorrect
+  --> $DIR/const-argument-cross-crate-mismatch.rs:9:39
+   |
+LL |     let _: const_generic_lib::Alias = const_generic_lib::Struct([0u8, 1u8, 2u8]);
+   |                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^---------------^
+   |                                                                 |
+   |                                                                 expected `[u8; 2]`, found `[u8; 3]`
+   |
+help: provide an argument of the correct type
+   |
+LL |     let _: const_generic_lib::Alias = ({[u8; 2]});
+   |                                       ^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
index aefd514f7a68ec65bb145a5ab9a33a9428f321f6..42f469d9817813c0a5fdec0a33d6f42562ab2f01 100644 (file)
@@ -2,13 +2,17 @@ error[E0308]: mismatched types
   --> $DIR/const-argument-cross-crate-mismatch.rs:6:67
    |
 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
+   |                                         ------------------------- ^^^^^^^^^^ expected an array with a fixed size of 3 elements, found one with 2 elements
+   |                                         |
+   |                                         arguments to this struct are incorrect
 
 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
+   |                                       ------------------------- ^^^^^^^^^^^^^^^ expected an array with a fixed size of 2 elements, found one with 3 elements
+   |                                       |
+   |                                       arguments to this struct are incorrect
 
 error: aborting due to 2 previous errors
 
index 5d45e302888d424895cb88f12ac906c75de013ea..9bea4105d58b06099a7a07cfe46e581acea61060 100644 (file)
@@ -1,19 +1,26 @@
+error: constant expression depends on a generic parameter
+  --> $DIR/issue-62504.rs:18:25
+   |
+LL |         ArrayHolder([0; Self::SIZE])
+   |                         ^^^^^^^^^^
+   |
+   = note: this may fail depending on what value the parameter takes
+
 error[E0308]: mismatched types
   --> $DIR/issue-62504.rs:18:21
    |
 LL |         ArrayHolder([0; Self::SIZE])
-   |                     ^^^^^^^^^^^^^^^ expected `X`, found `Self::SIZE`
+   |         ----------- ^^^^^^^^^^^^^^^ expected `X`, found `Self::SIZE`
+   |         |
+   |         arguments to this struct are incorrect
    |
    = note: expected array `[u32; X]`
               found array `[u32; _]`
-
-error: constant expression depends on a generic parameter
-  --> $DIR/issue-62504.rs:18:25
+note: tuple struct defined here
+  --> $DIR/issue-62504.rs:14:8
    |
-LL |         ArrayHolder([0; Self::SIZE])
-   |                         ^^^^^^^^^^
-   |
-   = note: this may fail depending on what value the parameter takes
+LL | struct ArrayHolder<const X: usize>([u32; X]);
+   |        ^^^^^^^^^^^
 
 error: aborting due to 2 previous errors
 
index dbe46704b9320224edc810d5b2488f9a5ca0deef..95b572133c5f7a5248549d12f1accfd7a322c66b 100644 (file)
@@ -2,10 +2,17 @@ error[E0308]: mismatched types
   --> $DIR/issue-42764.rs:11:43
    |
 LL |     this_function_expects_a_double_option(n);
-   |                                           ^ expected enum `DoubleOption`, found `usize`
+   |     ------------------------------------- ^ expected enum `DoubleOption`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected enum `DoubleOption<_>`
               found type `usize`
+note: function defined here
+  --> $DIR/issue-42764.rs:7:4
+   |
+LL | fn this_function_expects_a_double_option<T>(d: DoubleOption<T>) {}
+   |    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^    ------------------
 help: try wrapping the expression in a variant of `DoubleOption`
    |
 LL |     this_function_expects_a_double_option(DoubleOption::FirstSome(n));
index 0c6bd9379f7539a1f64107e94d41b68287e27e1a..42925cfed5507f2ec6cc2e3b8fa4dc79eb20003d 100644 (file)
@@ -2,10 +2,17 @@ error[E0308]: mismatched types
   --> $DIR/disambiguate-identical-names.rs:13:10
    |
 LL |     test(&v);
-   |          ^^ expected struct `std::vec::Vec`, found struct `HashMap`
+   |     ---- ^^ expected struct `std::vec::Vec`, found struct `HashMap`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&std::vec::Vec<std::vec::Vec<u32>>`
               found reference `&HashMap<u8, u8>`
+note: function defined here
+  --> $DIR/disambiguate-identical-names.rs:6:4
+   |
+LL | fn test(_v: &Vec<Vec<u32>>) {
+   |    ^^^^ ------------------
 
 error: aborting due to previous error
 
index 31579e282896402d067d47b61d507c0921f252ae..a151b20f865b22866e7e6ed8ee906486b145f241 100644 (file)
@@ -2,17 +2,23 @@ error[E0057]: this function takes 1 argument but 0 arguments were supplied
   --> $DIR/E0057.rs:3:13
    |
 LL |     let a = f();
-   |             ^-- supplied 0 arguments
-   |             |
-   |             expected 1 argument
+   |             ^-- an argument is missing
+   |
+help: provide the argument
+   |
+LL |     let a = f({_});
+   |             ~~~~~~
 
 error[E0057]: this function takes 1 argument but 2 arguments were supplied
   --> $DIR/E0057.rs:5:13
    |
 LL |     let c = f(2, 3);
-   |             ^ -  - supplied 2 arguments
-   |             |
-   |             expected 1 argument
+   |             ^    - argument unexpected
+   |
+help: remove the extra argument
+   |
+LL |     let c = f(2);
+   |             ~~~~
 
 error: aborting due to 2 previous errors
 
index 941eb2a210bf37b0ab7c77d38f8c7c9d158d83b5..7050a1dff6c2faa54225ed4deef9d46a3626eaa6 100644 (file)
@@ -5,5 +5,4 @@
 fn main() {
     unsafe { printf(); }
     //~^ ERROR E0060
-    //~| expected at least 1 argument
 }
index c80014d14763bb420e8397e42545acbe2a8654ce..9dd649239e29f9ca1397d27fa322588314ddfb03 100644 (file)
@@ -2,15 +2,17 @@ error[E0060]: this function takes at least 1 argument but 0 arguments were suppl
   --> $DIR/E0060.rs:6:14
    |
 LL |     unsafe { printf(); }
-   |              ^^^^^^-- supplied 0 arguments
-   |              |
-   |              expected at least 1 argument
+   |              ^^^^^^-- an argument of type `*const u8` is missing
    |
 note: function defined here
   --> $DIR/E0060.rs:2:8
    |
 LL |     fn printf(_: *const u8, ...) -> u32;
    |        ^^^^^^
+help: provide the argument
+   |
+LL |     unsafe { printf({*const u8}); }
+   |              ~~~~~~~~~~~~~~~~~~~
 
 error: aborting due to previous error
 
index c7b5fe4310e9328f5c7de0cb1bbbd20bc2732fa7..b6fae6c63d77a10cfe49a11793bc453b384d196b 100644 (file)
@@ -5,9 +5,7 @@ fn f2(a: u16) {}
 fn main() {
     f(0);
     //~^ ERROR E0061
-    //~| expected 2 arguments
 
     f2();
     //~^ ERROR E0061
-    //~| expected 1 argument
 }
index 98488a2d298b90182d861a9ddabd6ad3caeee7c9..f92c548f2de1f2ec67060d583fc18498d6400dd4 100644 (file)
@@ -2,29 +2,33 @@ error[E0061]: this function takes 2 arguments but 1 argument was supplied
   --> $DIR/E0061.rs:6:5
    |
 LL |     f(0);
-   |     ^ - supplied 1 argument
-   |     |
-   |     expected 2 arguments
+   |     ^--- an argument of type `&str` is missing
    |
 note: function defined here
   --> $DIR/E0061.rs:1:4
    |
 LL | fn f(a: u16, b: &str) {}
    |    ^ ------  -------
+help: provide the argument
+   |
+LL |     f(0, {&str});
+   |     ~~~~~~~~~~~~
 
 error[E0061]: this function takes 1 argument but 0 arguments were supplied
-  --> $DIR/E0061.rs:10:5
+  --> $DIR/E0061.rs:9:5
    |
 LL |     f2();
-   |     ^^-- supplied 0 arguments
-   |     |
-   |     expected 1 argument
+   |     ^^-- an argument of type `u16` is missing
    |
 note: function defined here
   --> $DIR/E0061.rs:3:4
    |
 LL | fn f2(a: u16) {}
    |    ^^ ------
+help: provide the argument
+   |
+LL |     f2({u16});
+   |     ~~~~~~~~~
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/estr-subtyping.rs b/src/test/ui/estr-subtyping.rs
new file mode 100644 (file)
index 0000000..9c5825f
--- /dev/null
@@ -0,0 +1,15 @@
+fn wants_uniq(x: String) { }
+fn wants_slice(x: &str) { }
+
+fn has_uniq(x: String) {
+   wants_uniq(x);
+   wants_slice(&*x);
+}
+
+fn has_slice(x: &str) {
+   wants_uniq(x); //~ ERROR mismatched types
+   wants_slice(x);
+}
+
+fn main() {
+}
diff --git a/src/test/ui/estr-subtyping.stderr b/src/test/ui/estr-subtyping.stderr
new file mode 100644 (file)
index 0000000..adebb7d
--- /dev/null
@@ -0,0 +1,18 @@
+error[E0308]: mismatched types
+  --> $DIR/estr-subtyping.rs:10:15
+   |
+LL |    wants_uniq(x);
+   |    ---------- ^- help: try using a conversion method: `.to_string()`
+   |    |          |
+   |    |          expected struct `String`, found `&str`
+   |    arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/estr-subtyping.rs:1:4
+   |
+LL | fn wants_uniq(x: String) { }
+   |    ^^^^^^^^^^ ---------
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
index 3f1f1006713ba46d9ffbdbee1af523e4ddfcb635..c25da900951cc658dda6fc7fe9da6c058a7685c1 100644 (file)
@@ -296,20 +296,36 @@ error[E0308]: mismatched types
   --> $DIR/ifmt-bad-arg.rs:78:32
    |
 LL |     println!("{} {:.*} {}", 1, 3.2, 4);
-   |                                ^^^ expected `usize`, found floating-point number
+   |     ---------------------------^^^----
+   |     |                          |
+   |     |                          expected `usize`, found floating-point number
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&usize`
               found reference `&{float}`
+note: associated function defined here
+  --> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
+   |
+LL |     pub fn from_usize(x: &usize) -> ArgumentV1<'_> {
+   |            ^^^^^^^^^^
    = note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0308]: mismatched types
   --> $DIR/ifmt-bad-arg.rs:81:35
    |
 LL |     println!("{} {:07$.*} {}", 1, 3.2, 4);
-   |                                   ^^^ expected `usize`, found floating-point number
+   |     ------------------------------^^^----
+   |     |                             |
+   |     |                             expected `usize`, found floating-point number
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&usize`
               found reference `&{float}`
+note: associated function defined here
+  --> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
+   |
+LL |     pub fn from_usize(x: &usize) -> ArgumentV1<'_> {
+   |            ^^^^^^^^^^
    = note: this error originates in the macro `$crate::format_args_nl` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: aborting due to 36 previous errors
index 415e87b42fad23ce72e6ec12e9eb8ab38635e32f..16a0c10ea3a3a8f3d8ac7702953bbb72a0bab97b 100644 (file)
@@ -12,7 +12,7 @@ impl<T> Foo for T { /* `foo` is still default here */ }
 fn main() {
     eq(foo::<u8>, bar::<u8>);
     //~^ ERROR mismatched types
-    //~| expected fn item `fn(_) -> _ {foo::<u8>}`
+    //~| expected type `fn(_) -> _ {foo::<u8>}`
     //~| found fn item `fn(_) -> _ {bar::<u8>}`
     //~| expected fn item, found a different fn item
     //~| different `fn` items always have unique types, even if their signatures are the same
@@ -28,7 +28,7 @@ fn main() {
 
     eq(bar::<String>, bar::<Vec<u8>>);
     //~^ ERROR mismatched types
-    //~| expected fn item `fn(_) -> _ {bar::<String>}`
+    //~| expected type `fn(_) -> _ {bar::<String>}`
     //~| found fn item `fn(_) -> _ {bar::<Vec<u8>>}`
     //~| expected struct `String`, found struct `Vec`
     //~| different `fn` items always have unique types, even if their signatures are the same
@@ -45,7 +45,7 @@ fn main() {
 
     eq(foo::<u8>, bar::<u8> as fn(isize) -> isize);
     //~^ ERROR mismatched types
-    //~| expected fn item `fn(_) -> _ {foo::<u8>}`
+    //~| expected type `fn(_) -> _ {foo::<u8>}`
     //~| found fn pointer `fn(_) -> _`
     //~| expected fn item, found fn pointer
     //~| change the expected type to be function pointer
index 4bd51a668a6f7da358bd6e5a86c23d214877a7ee..1fb120eb7a77839cc708dde3f1b7b204789749bf 100644 (file)
@@ -2,60 +2,95 @@ error[E0308]: mismatched types
   --> $DIR/fn-item-type.rs:13:19
    |
 LL |     eq(foo::<u8>, bar::<u8>);
-   |                   ^^^^^^^^^ expected fn item, found a different fn item
+   |     --            ^^^^^^^^^ expected fn item, found a different fn item
+   |     |
+   |     arguments to this function are incorrect
    |
-   = note: expected fn item `fn(_) -> _ {foo::<u8>}`
-              found fn item `fn(_) -> _ {bar::<u8>}`
+   = note: expected type `fn(_) -> _ {foo::<u8>}`
+           found fn item `fn(_) -> _ {bar::<u8>}`
    = note: different `fn` items always have unique types, even if their signatures are the same
    = help: change the expected type to be function pointer `fn(isize) -> isize`
    = help: if the expected type is due to type inference, cast the expected `fn` to a function pointer: `foo::<u8> as fn(isize) -> isize`
+note: function defined here
+  --> $DIR/fn-item-type.rs:7:4
+   |
+LL | fn eq<T>(x: T, y: T) { }
+   |    ^^    ----  ----
 
 error[E0308]: mismatched types
   --> $DIR/fn-item-type.rs:22:19
    |
 LL |     eq(foo::<u8>, foo::<i8>);
-   |                   ^^^^^^^^^ expected `u8`, found `i8`
+   |     --            ^^^^^^^^^ expected `u8`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
    |
-   = note: expected fn item `fn(_) -> _ {foo::<u8>}`
-              found fn item `fn(_) -> _ {foo::<i8>}`
+   = note: expected type `fn(_) -> _ {foo::<u8>}`
+           found fn item `fn(_) -> _ {foo::<i8>}`
    = note: different `fn` items always have unique types, even if their signatures are the same
    = help: change the expected type to be function pointer `fn(isize) -> isize`
    = help: if the expected type is due to type inference, cast the expected `fn` to a function pointer: `foo::<u8> as fn(isize) -> isize`
+note: function defined here
+  --> $DIR/fn-item-type.rs:7:4
+   |
+LL | fn eq<T>(x: T, y: T) { }
+   |    ^^    ----  ----
 
 error[E0308]: mismatched types
   --> $DIR/fn-item-type.rs:29:23
    |
 LL |     eq(bar::<String>, bar::<Vec<u8>>);
-   |                       ^^^^^^^^^^^^^^ expected struct `String`, found struct `Vec`
+   |     --                ^^^^^^^^^^^^^^ expected struct `String`, found struct `Vec`
+   |     |
+   |     arguments to this function are incorrect
    |
-   = note: expected fn item `fn(_) -> _ {bar::<String>}`
-              found fn item `fn(_) -> _ {bar::<Vec<u8>>}`
+   = note: expected type `fn(_) -> _ {bar::<String>}`
+           found fn item `fn(_) -> _ {bar::<Vec<u8>>}`
    = note: different `fn` items always have unique types, even if their signatures are the same
    = help: change the expected type to be function pointer `fn(isize) -> isize`
    = help: if the expected type is due to type inference, cast the expected `fn` to a function pointer: `bar::<String> as fn(isize) -> isize`
+note: function defined here
+  --> $DIR/fn-item-type.rs:7:4
+   |
+LL | fn eq<T>(x: T, y: T) { }
+   |    ^^    ----  ----
 
 error[E0308]: mismatched types
   --> $DIR/fn-item-type.rs:39:26
    |
 LL |     eq(<u8 as Foo>::foo, <u16 as Foo>::foo);
-   |                          ^^^^^^^^^^^^^^^^^ expected `u8`, found `u16`
+   |     --                   ^^^^^^^^^^^^^^^^^ expected `u8`, found `u16`
+   |     |
+   |     arguments to this function are incorrect
    |
-   = note: expected fn item `fn() {<u8 as Foo>::foo}`
-              found fn item `fn() {<u16 as Foo>::foo}`
+   = note: expected type `fn() {<u8 as Foo>::foo}`
+           found fn item `fn() {<u16 as Foo>::foo}`
    = note: different `fn` items always have unique types, even if their signatures are the same
    = help: change the expected type to be function pointer `fn()`
    = help: if the expected type is due to type inference, cast the expected `fn` to a function pointer: `<u8 as Foo>::foo as fn()`
+note: function defined here
+  --> $DIR/fn-item-type.rs:7:4
+   |
+LL | fn eq<T>(x: T, y: T) { }
+   |    ^^    ----  ----
 
 error[E0308]: mismatched types
   --> $DIR/fn-item-type.rs:46:19
    |
 LL |     eq(foo::<u8>, bar::<u8> as fn(isize) -> isize);
-   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn item, found fn pointer
+   |     --            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn item, found fn pointer
+   |     |
+   |     arguments to this function are incorrect
    |
-   = note: expected fn item `fn(_) -> _ {foo::<u8>}`
+   = note:    expected type `fn(_) -> _ {foo::<u8>}`
            found fn pointer `fn(_) -> _`
    = help: change the expected type to be function pointer `fn(isize) -> isize`
    = help: if the expected type is due to type inference, cast the expected `fn` to a function pointer: `foo::<u8> as fn(isize) -> isize`
+note: function defined here
+  --> $DIR/fn-item-type.rs:7:4
+   |
+LL | fn eq<T>(x: T, y: T) { }
+   |    ^^    ----  ----
 
 error: aborting due to 5 previous errors
 
index 7a7d5a6c2313fbed08e806c66180b3ae643514e8..06c1efcd80b0df1ec52e304e13e30b67280a69c6 100644 (file)
@@ -4,10 +4,17 @@ error[E0308]: mismatched types
 LL | fn bug<'a, T: Fun<F<'a> = T>>(t: T) -> T::F<'a> {
    |            - this type parameter
 LL |     T::identity(())
-   |                 ^^ expected type parameter `T`, found `()`
+   |     ----------- ^^ expected type parameter `T`, found `()`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected type parameter `T`
                    found unit type `()`
+note: associated function defined here
+  --> $DIR/issue-68648-2.rs:6:8
+   |
+LL |     fn identity<'a>(t: Self::F<'a>) -> Self::F<'a> { t }
+   |        ^^^^^^^^     --------------
 
 error: aborting due to previous error
 
index c9603b8d1ea4a3bcebe045f1630099e1a08f51eb..240be93cf961708801d1b7af36267ba964f68485 100644 (file)
@@ -17,10 +17,17 @@ LL | impl<B> Add for A<B> where B: Add {
    |      - this type parameter
 ...
 LL |         A(self.0 + rhs.0)
-   |           ^^^^^^^^^^^^^^ expected type parameter `B`, found associated type
+   |         - ^^^^^^^^^^^^^^ expected type parameter `B`, found associated type
+   |         |
+   |         arguments to this struct are incorrect
    |
    = note: expected type parameter `B`
              found associated type `<B as Add>::Output`
+note: tuple struct defined here
+  --> $DIR/missing-bounds.rs:5:8
+   |
+LL | struct A<B>(B);
+   |        ^
 help: consider further restricting this bound
    |
 LL | impl<B> Add for A<B> where B: Add + Add<Output = B> {
@@ -33,10 +40,17 @@ LL | impl<B: Add> Add for C<B> {
    |      - this type parameter
 ...
 LL |         Self(self.0 + rhs.0)
-   |              ^^^^^^^^^^^^^^ expected type parameter `B`, found associated type
+   |         ---- ^^^^^^^^^^^^^^ expected type parameter `B`, found associated type
+   |         |
+   |         arguments to this function are incorrect
    |
    = note: expected type parameter `B`
              found associated type `<B as Add>::Output`
+note: tuple struct defined here
+  --> $DIR/missing-bounds.rs:15:8
+   |
+LL | struct C<B>(B);
+   |        ^
 help: consider further restricting this bound
    |
 LL | impl<B: Add + Add<Output = B>> Add for C<B> {
@@ -62,10 +76,17 @@ LL | impl<B: Add> Add for E<B> where <B as Add>::Output = B {
    |      - this type parameter
 ...
 LL |         Self(self.0 + rhs.0)
-   |              ^^^^^^^^^^^^^^ expected type parameter `B`, found associated type
+   |         ---- ^^^^^^^^^^^^^^ expected type parameter `B`, found associated type
+   |         |
+   |         arguments to this function are incorrect
    |
    = note: expected type parameter `B`
              found associated type `<B as Add>::Output`
+note: tuple struct defined here
+  --> $DIR/missing-bounds.rs:35:8
+   |
+LL | struct E<B>(B);
+   |        ^
 help: consider further restricting type parameter `B`
    |
 LL | impl<B: Add> Add for E<B> where <B as Add>::Output = B, B: Add<Output = B> {
index 2cc1c7a2e7269bec6d6ceb6d1570e6b17e1c2019..d2b3b1c2aa0e5c6c6e0f1e8b4fc4110eb5732827 100644 (file)
@@ -2,15 +2,17 @@ error[E0061]: this function takes 1 argument but 0 arguments were supplied
   --> $DIR/issue-58451.rs:12:9
    |
 LL |     f(&[f()]);
-   |         ^-- supplied 0 arguments
-   |         |
-   |         expected 1 argument
+   |         ^-- an argument is missing
    |
 note: function defined here
   --> $DIR/issue-58451.rs:5:4
    |
 LL | fn f<I>(i: I)
    |    ^    ----
+help: provide the argument
+   |
+LL |     f(&[f({_})]);
+   |         ~~~~~~
 
 error: aborting due to previous error
 
index 6e02a6b2b87b4c71d6abb2010b1ebf2a97a56a23..0f855ef57927ad55856780dd5f0a212df309318e 100644 (file)
@@ -5,7 +5,9 @@ LL |   type Closure = impl Fn() -> u64;
    |                  ---------------- the expected opaque type
 ...
 LL |       Anonymous(|| {
-   |  _______________^
+   |  _____---------_^
+   | |     |
+   | |     arguments to this struct are incorrect
 LL | |         3
 LL | |     })
    | |_____^ expected closure, found a different closure
@@ -14,6 +16,11 @@ LL | |     })
                   found closure `[closure@$DIR/issue-74282.rs:8:15: 10:6]`
    = note: no two closures, even if identical, have the same type
    = help: consider boxing your closure and/or using it as a trait object
+note: tuple struct defined here
+  --> $DIR/issue-74282.rs:4:8
+   |
+LL | struct Anonymous(Closure);
+   |        ^^^^^^^^^
 
 error[E0308]: mismatched types
   --> $DIR/issue-74282.rs:8:5
index dae11a702fb73aa62d3ff5a8aef4960c7ebd8684..a9adff4faded9e5f4913e204002ae3e218202ab4 100644 (file)
@@ -12,12 +12,15 @@ error[E0308]: mismatched types
   --> $DIR/indexing-requires-a-uint.rs:12:18
    |
 LL |     bar::<isize>(i);  // i should not be re-coerced back to an isize
-   |                  ^ expected `isize`, found `usize`
+   |     ------------ ^ expected `isize`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
    |
-help: you can convert a `usize` to an `isize` and panic if the converted value doesn't fit
+note: function defined here
+  --> $DIR/indexing-requires-a-uint.rs:5:8
    |
-LL |     bar::<isize>(i.try_into().unwrap());  // i should not be re-coerced back to an isize
-   |                   ++++++++++++++++++++
+LL |     fn bar<T>(_: T) {}
+   |        ^^^    ----
 
 error: aborting due to 2 previous errors
 
index 28c9afaa52c2299dbe987b84268e7e12628e5719..8ba9dacb4b21d35e6b167d62726b51c9b1326dc2 100644 (file)
@@ -2,16 +2,30 @@ error[E0308]: mismatched types
   --> $DIR/deref-suggestion.rs:8:9
    |
 LL |     foo(s);
-   |         ^- help: try using a conversion method: `.to_string()`
-   |         |
-   |         expected struct `String`, found `&String`
+   |     --- ^- help: try using a conversion method: `.to_string()`
+   |     |   |
+   |     |   expected struct `String`, found `&String`
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/deref-suggestion.rs:5:4
+   |
+LL | fn foo(_: String) {}
+   |    ^^^ ---------
 
 error[E0308]: mismatched types
   --> $DIR/deref-suggestion.rs:14:10
    |
 LL |     foo3(u);
-   |          ^ expected `u32`, found `&u32`
+   |     ---- ^ expected `u32`, found `&u32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/deref-suggestion.rs:12:4
    |
+LL | fn foo3(_: u32) {}
+   |    ^^^^ ------
 help: consider dereferencing the borrow
    |
 LL |     foo3(*u);
@@ -21,8 +35,15 @@ error[E0308]: mismatched types
   --> $DIR/deref-suggestion.rs:30:9
    |
 LL |     foo(&"aaa".to_owned());
-   |         ^^^^^^^^^^^^^^^^^ expected struct `String`, found `&String`
+   |     --- ^^^^^^^^^^^^^^^^^ expected struct `String`, found `&String`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/deref-suggestion.rs:5:4
+   |
+LL | fn foo(_: String) {}
+   |    ^^^ ---------
 help: consider removing the borrow
    |
 LL -     foo(&"aaa".to_owned());
@@ -33,8 +54,15 @@ error[E0308]: mismatched types
   --> $DIR/deref-suggestion.rs:32:9
    |
 LL |     foo(&mut "aaa".to_owned());
-   |         ^^^^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&mut String`
+   |     --- ^^^^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&mut String`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/deref-suggestion.rs:5:4
    |
+LL | fn foo(_: String) {}
+   |    ^^^ ---------
 help: consider removing the borrow
    |
 LL -     foo(&mut "aaa".to_owned());
@@ -48,8 +76,15 @@ LL |     ($x:expr) => { &$x }
    |                    ^^^ expected `u32`, found `&{integer}`
 ...
 LL |     foo3(borrow!(0));
-   |          ---------- in this macro invocation
+   |     ---- ---------- in this macro invocation
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/deref-suggestion.rs:12:4
    |
+LL | fn foo3(_: u32) {}
+   |    ^^^^ ------
    = note: this error originates in the macro `borrow` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0308]: mismatched types
index fbfbffbd24e2ff79892d16733d827015a408355a..d83a1367dbfae87816981dfeeeaa02edd2d9aa67 100644 (file)
@@ -2,8 +2,15 @@ error[E0308]: mismatched types
   --> $DIR/tutorial-suffix-inference-test.rs:9:18
    |
 LL |     identity_u16(x);
-   |                  ^ expected `u16`, found `u8`
+   |     ------------ ^ expected `u16`, found `u8`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/tutorial-suffix-inference-test.rs:6:8
+   |
+LL |     fn identity_u16(n: u16) -> u16 { n }
+   |        ^^^^^^^^^^^^ ------
 help: you can convert a `u8` to a `u16`
    |
 LL |     identity_u16(x.into());
@@ -13,8 +20,15 @@ error[E0308]: mismatched types
   --> $DIR/tutorial-suffix-inference-test.rs:12:18
    |
 LL |     identity_u16(y);
-   |                  ^ expected `u16`, found `i32`
+   |     ------------ ^ expected `u16`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/tutorial-suffix-inference-test.rs:6:8
    |
+LL |     fn identity_u16(n: u16) -> u16 { n }
+   |        ^^^^^^^^^^^^ ------
 help: you can convert an `i32` to a `u16` and panic if the converted value doesn't fit
    |
 LL |     identity_u16(y.try_into().unwrap());
@@ -24,8 +38,15 @@ error[E0308]: mismatched types
   --> $DIR/tutorial-suffix-inference-test.rs:21:18
    |
 LL |     identity_u16(a);
-   |                  ^ expected `u16`, found `isize`
+   |     ------------ ^ expected `u16`, found `isize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/tutorial-suffix-inference-test.rs:6:8
    |
+LL |     fn identity_u16(n: u16) -> u16 { n }
+   |        ^^^^^^^^^^^^ ------
 help: you can convert an `isize` to a `u16` and panic if the converted value doesn't fit
    |
 LL |     identity_u16(a.try_into().unwrap());
index b0bafc9942ee96dd73259ac93d5e7f1f251fe021..4d8a85a139715c8b52477ae56057f036d72e57da 100644 (file)
@@ -2,10 +2,17 @@ error[E0308]: mismatched types
   --> $DIR/issue-10764.rs:4:15
    |
 LL | fn main() { f(bar) }
-   |               ^^^ expected "Rust" fn, found "C" fn
+   |             - ^^^ expected "Rust" fn, found "C" fn
+   |             |
+   |             arguments to this function are incorrect
    |
    = note: expected fn pointer `fn()`
                  found fn item `extern "C" fn() {bar}`
+note: function defined here
+  --> $DIR/issue-10764.rs:1:4
+   |
+LL | fn f(_: extern "Rust" fn()) {}
+   |    ^ ---------------------
 
 error: aborting due to previous error
 
index d6a3e758de84a61da2de5847ef67130339504d29..3a1d43310e2fc30d3b8b5992e45392d233191ca7 100644 (file)
@@ -2,13 +2,19 @@ error[E0308]: mismatched types
   --> $DIR/issue-11374.rs:26:15
    |
 LL |     c.read_to(v);
-   |               ^
-   |               |
-   |               expected `&mut [u8]`, found struct `Vec`
-   |               help: consider mutably borrowing here: `&mut v`
+   |       ------- ^
+   |       |       |
+   |       |       expected `&mut [u8]`, found struct `Vec`
+   |       |       help: consider mutably borrowing here: `&mut v`
+   |       arguments to this function are incorrect
    |
    = note: expected mutable reference `&mut [u8]`
                          found struct `Vec<_>`
+note: associated function defined here
+  --> $DIR/issue-11374.rs:13:12
+   |
+LL |     pub fn read_to(&mut self, vec: &mut [u8]) {
+   |            ^^^^^^^ ---------  --------------
 
 error: aborting due to previous error
 
index 3b89e8bc451518b1714dfd14df5a1c5603977b25..2a3d0e3457b031ca24c92378fa01b94a6054a7d1 100644 (file)
@@ -4,8 +4,16 @@ error[E0308]: mismatched types
 LL | #[bench]
    | -------- in this procedural macro expansion
 LL | fn bar(x: isize) { }
-   | ^^^^^^^^^^^^^^^^^^^^ expected `isize`, found `&mut Bencher`
+   | ^^^^^^^^^^^^^^^^^^^^
+   | |
+   | expected `isize`, found `&mut Bencher`
+   | arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/issue-12997-2.rs:8:4
+   |
+LL | fn bar(x: isize) { }
+   |    ^^^ --------
    = note: this error originates in the attribute macro `bench` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: aborting due to previous error
index 075c92e65de820cb4c42e713e45ada488e7e7897..db6283ea11f506577305f91eabc5d5f56bec2423 100644 (file)
@@ -2,23 +2,29 @@ error[E0308]: mismatched types
   --> $DIR/issue-13359.rs:6:9
    |
 LL |     foo(1*(1 as isize));
-   |         ^^^^^^^^^^^^^^ expected `i16`, found `isize`
+   |     --- ^^^^^^^^^^^^^^ expected `i16`, found `isize`
+   |     |
+   |     arguments to this function are incorrect
    |
-help: you can convert an `isize` to an `i16` and panic if the converted value doesn't fit
+note: function defined here
+  --> $DIR/issue-13359.rs:1:4
    |
-LL |     foo((1*(1 as isize)).try_into().unwrap());
-   |         +              +++++++++++++++++++++
+LL | fn foo(_s: i16) { }
+   |    ^^^ -------
 
 error[E0308]: mismatched types
   --> $DIR/issue-13359.rs:10:9
    |
 LL |     bar(1*(1 as usize));
-   |         ^^^^^^^^^^^^^^ expected `u32`, found `usize`
+   |     --- ^^^^^^^^^^^^^^ expected `u32`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
    |
-help: you can convert a `usize` to a `u32` and panic if the converted value doesn't fit
+note: function defined here
+  --> $DIR/issue-13359.rs:3:4
    |
-LL |     bar((1*(1 as usize)).try_into().unwrap());
-   |         +              +++++++++++++++++++++
+LL | fn bar(_s: u32) { }
+   |    ^^^ -------
 
 error: aborting due to 2 previous errors
 
index 527e0225eb9761317649b3c05d619fd323e9b277..657bda5f62b3f2605ec329981c7f442a10ea130f 100644 (file)
@@ -20,13 +20,19 @@ error[E0308]: mismatched types
   --> $DIR/issue-13853.rs:37:13
    |
 LL |     iterate(graph);
-   |             ^^^^^
-   |             |
-   |             expected reference, found struct `Vec`
-   |             help: consider borrowing here: `&graph`
+   |     ------- ^^^^^
+   |     |       |
+   |     |       expected reference, found struct `Vec`
+   |     |       help: consider borrowing here: `&graph`
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&_`
                  found struct `Vec<Stuff>`
+note: function defined here
+  --> $DIR/issue-13853.rs:26:4
+   |
+LL | fn iterate<N: Node, G: Graph<N>>(graph: &G) {
+   |    ^^^^^^^                       ---------
 
 error: aborting due to 3 previous errors
 
index da44566d075c4c5530a9414189ea8e2cea537e2c..203dd92c9fb022953fee9b9de1825ed4da0d3e01 100644 (file)
@@ -2,8 +2,15 @@ error[E0308]: mismatched types
   --> $DIR/issue-1448-2.rs:6:24
    |
 LL |     println!("{}", foo(10i32));
-   |                        ^^^^^ expected `u32`, found `i32`
+   |                    --- ^^^^^ expected `u32`, found `i32`
+   |                    |
+   |                    arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/issue-1448-2.rs:3:4
+   |
+LL | fn foo(a: u32) -> u32 { a }
+   |    ^^^ ------
 help: change the type of the numeric literal from `i32` to `u32`
    |
 LL |     println!("{}", foo(10u32));
index 0b09751676e9c5dfb128386cc9e9bf401d938bad..660dfe9ed3d51bc7617b139fd900ba1b773f3137 100644 (file)
@@ -2,10 +2,17 @@ error[E0308]: mismatched types
   --> $DIR/issue-15783.rs:8:19
    |
 LL |     let msg = foo(x);
-   |                   ^ expected slice `[&str]`, found array `[&str; 1]`
+   |               --- ^ expected slice `[&str]`, found array `[&str; 1]`
+   |               |
+   |               arguments to this function are incorrect
    |
    = note: expected enum `Option<&[&str]>`
               found enum `Option<&[&str; 1]>`
+note: function defined here
+  --> $DIR/issue-15783.rs:1:8
+   |
+LL | pub fn foo(params: Option<&[&str]>) -> usize {
+   |        ^^^ -----------------------
 
 error: aborting due to previous error
 
index 8e4237039fad742c4b7b448238cc1da91f6e08af..294524f0b6148de09fbe98c04247f78f4dc0ad71 100644 (file)
@@ -2,15 +2,17 @@ error[E0057]: this function takes 0 arguments but 1 argument was supplied
   --> $DIR/issue-16939.rs:5:9
    |
 LL |     |t| f(t);
-   |         ^ - supplied 1 argument
-   |         |
-   |         expected 0 arguments
+   |         ^ - argument unexpected
    |
 note: associated function defined here
   --> $SRC_DIR/core/src/ops/function.rs:LL:COL
    |
 LL |     extern "rust-call" fn call(&self, args: Args) -> Self::Output;
    |                           ^^^^
+help: remove the extra argument
+   |
+LL |     |t| f();
+   |         ~~~
 
 error: aborting due to previous error
 
index 518fc30142c9421be62eaafa861f0b3a3a5cb4bf..f26bee5ff45d0154a37873367afe0c8d3ed46a1f 100644 (file)
@@ -2,10 +2,11 @@ error[E0308]: mismatched types
   --> $DIR/issue-17033.rs:2:10
    |
 LL |     (*p)(())
-   |          ^^
-   |          |
-   |          expected `&mut ()`, found `()`
-   |          help: consider mutably borrowing here: `&mut ()`
+   |     ---- ^^
+   |     |    |
+   |     |    expected `&mut ()`, found `()`
+   |     |    help: consider mutably borrowing here: `&mut ()`
+   |     arguments to this function are incorrect
 
 error: aborting due to previous error
 
index b10d26abe348584260c9a3c2052d1dcbbe2685e9..db228fded6e409f14a816d4390d41de561d82569 100644 (file)
@@ -2,15 +2,26 @@ error[E0061]: this function takes 2 arguments but 1 argument was supplied
   --> $DIR/issue-18819.rs:16:5
    |
 LL |     print_x(X);
-   |     ^^^^^^^ - supplied 1 argument
-   |     |
-   |     expected 2 arguments
+   |     ^^^^^^^---
+   |            ||
+   |            |expected reference, found struct `X`
+   |            an argument of type `&str` is missing
    |
+   = note: expected reference `&dyn Foo<Item = bool>`
+                 found struct `X`
 note: function defined here
   --> $DIR/issue-18819.rs:11:4
    |
 LL | fn print_x(_: &dyn Foo<Item=bool>, extra: &str) {
    |    ^^^^^^^ ----------------------  -----------
+help: consider borrowing here
+   |
+LL |     print_x(&X);
+   |             ~~
+help: provide the argument
+   |
+LL |     print_x({&dyn Foo<Item = bool>}, {&str});
+   |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 error: aborting due to previous error
 
index 2f931e59d594257e5ad09b7e44f84fb761b8cd9e..982a11fef80e896fd4683c5ec6d3d2111570c84d 100644 (file)
@@ -2,10 +2,17 @@ error[E0308]: mismatched types
   --> $DIR/issue-24819.rs:5:9
    |
 LL |     foo(&mut v);
-   |         ^^^^^^ expected struct `HashSet`, found struct `Vec`
+   |     --- ^^^^^^ expected struct `HashSet`, found struct `Vec`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected mutable reference `&mut HashSet<u32>`
               found mutable reference `&mut Vec<_>`
+note: function defined here
+  --> $DIR/issue-24819.rs:10:4
+   |
+LL | fn foo(h: &mut HashSet<u32>) {
+   |    ^^^ --------------------
 
 error: aborting due to previous error
 
index 78fb0491d82ddd6a548d50f4fc9d66134814a1f8..981c3abb4bae0379ab83f451f423d7f18823b389 100644 (file)
@@ -1,6 +1,6 @@
 macro_rules! some_macro {
     ($other: expr) => ({
-        $other(None) //~ NOTE supplied 1 argument
+        $other(None) //~ NOTE argument unexpected
     })
 }
 
@@ -9,5 +9,5 @@ fn some_function() {} //~ NOTE defined here
 fn main() {
     some_macro!(some_function);
     //~^ ERROR this function takes 0 arguments but 1 argument was supplied
-    //~| NOTE expected 0 arguments
+    //~| NOTE in this expansion of some_macro!
 }
index a6f1ac9286cdac1d343358bb4a1f19df10ae198a..1013518e1dad3f6b5161a1f3e446de848cf99c35 100644 (file)
@@ -2,16 +2,20 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied
   --> $DIR/issue-26094.rs:10:17
    |
 LL |         $other(None)
-   |                ---- supplied 1 argument
+   |                ---- argument unexpected
 ...
 LL |     some_macro!(some_function);
-   |                 ^^^^^^^^^^^^^ expected 0 arguments
+   |                 ^^^^^^^^^^^^^
    |
 note: function defined here
   --> $DIR/issue-26094.rs:7:4
    |
 LL | fn some_function() {}
    |    ^^^^^^^^^^^^^
+help: remove the extra argument
+   |
+LL |         some_function()
+   |         ~~~~~~~~~~~~~~~
 
 error: aborting due to previous error
 
index 81d76a90eb0ac42ab2f63936e838b418dfd8ec76..7363cae8370ab26981fb163ed3d7c9de6f0ceb15 100644 (file)
@@ -2,5 +2,6 @@ fn main() {
     let needlesArr: Vec<char> = vec!['a', 'f'];
     needlesArr.iter().fold(|x, y| {
     });
-    //~^^ ERROR this function takes 2 arguments but 1 argument was supplied
+    //~^^ ERROR mismatched types
+    //~| ERROR this function takes 2 arguments but 1 argument was supplied
 }
index b93aeade95e42d37e1fba71104252081c6e74724..5bb07cfda214286eeb8b8d99877166f84d26c09d 100644 (file)
@@ -1,19 +1,34 @@
+error[E0308]: mismatched types
+  --> $DIR/issue-3044.rs:3:35
+   |
+LL |       needlesArr.iter().fold(|x, y| {
+   |  ___________________________________^
+LL | |     });
+   | |_____^ expected closure, found `()`
+   |
+   = note: expected closure `[closure@$DIR/issue-3044.rs:3:28: 4:6]`
+            found unit type `()`
+
 error[E0061]: this function takes 2 arguments but 1 argument was supplied
   --> $DIR/issue-3044.rs:3:23
    |
 LL |       needlesArr.iter().fold(|x, y| {
-   |  _______________________^^^^_-
-   | |                       |
-   | |                       expected 2 arguments
+   |  _______________________^^^^-
 LL | |     });
-   | |_____- supplied 1 argument
+   | |______- an argument is missing
    |
 note: associated function defined here
   --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
    |
 LL |     fn fold<B, F>(mut self, init: B, mut f: F) -> B
    |        ^^^^
+help: provide the argument
+   |
+LL ~     needlesArr.iter().fold(|x, y| {
+LL ~     }, {_});
+   |
 
-error: aborting due to previous error
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0061`.
+Some errors have detailed explanations: E0061, E0308.
+For more information about an error, try `rustc --explain E0061`.
index 77d52f6ecab115cbe662bad998e0ac39d6d03a35..58fd1121a6b99df48ba8ede83f2735c86a66a465 100644 (file)
@@ -2,10 +2,17 @@ error[E0308]: mismatched types
   --> $DIR/issue-43420-no-over-suggest.rs:8:9
    |
 LL |     foo(&a);
-   |         ^^ expected slice `[u16]`, found struct `Vec`
+   |     --- ^^ expected slice `[u16]`, found struct `Vec`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&[u16]`
               found reference `&Vec<u8>`
+note: function defined here
+  --> $DIR/issue-43420-no-over-suggest.rs:4:4
+   |
+LL | fn foo(b: &[u16]) {}
+   |    ^^^ ---------
 
 error: aborting due to previous error
 
index 1ae97b69c6caca66254d01bc944bf79c267dc92d..70b4ca5ec496b2c49a5a150f9e74dadc6ea5dbbc 100644 (file)
@@ -2,7 +2,15 @@ error[E0308]: mismatched types
   --> $DIR/issue-4517.rs:5:9
    |
 LL |     bar(foo);
-   |         ^^^ expected `usize`, found array `[u8; 4]`
+   |     --- ^^^ expected `usize`, found array `[u8; 4]`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/issue-4517.rs:1:4
+   |
+LL | fn bar(int_param: usize) {}
+   |    ^^^ ----------------
 
 error: aborting due to previous error
 
index 2d666e2b66c25ca05e546d33b5b6f58f42e1842d..e874ded8ec54e2699d1708e6601432c19800d9a7 100644 (file)
@@ -2,19 +2,33 @@ error[E0308]: mismatched types
   --> $DIR/issue-46756-consider-borrowing-cast-or-binexpr.rs:12:42
    |
 LL |     light_flows_our_war_of_mocking_words(behold as usize);
-   |                                          ^^^^^^^^^^^^^^^
-   |                                          |
-   |                                          expected `&usize`, found `usize`
-   |                                          help: consider borrowing here: `&(behold as usize)`
+   |     ------------------------------------ ^^^^^^^^^^^^^^^
+   |     |                                    |
+   |     |                                    expected `&usize`, found `usize`
+   |     |                                    help: consider borrowing here: `&(behold as usize)`
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/issue-46756-consider-borrowing-cast-or-binexpr.rs:5:4
+   |
+LL | fn light_flows_our_war_of_mocking_words(and_yet: &usize) -> usize {
+   |    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ---------------
 
 error[E0308]: mismatched types
   --> $DIR/issue-46756-consider-borrowing-cast-or-binexpr.rs:14:42
    |
 LL |     light_flows_our_war_of_mocking_words(with_tears + 4);
-   |                                          ^^^^^^^^^^^^^^
-   |                                          |
-   |                                          expected `&usize`, found `usize`
-   |                                          help: consider borrowing here: `&(with_tears + 4)`
+   |     ------------------------------------ ^^^^^^^^^^^^^^
+   |     |                                    |
+   |     |                                    expected `&usize`, found `usize`
+   |     |                                    help: consider borrowing here: `&(with_tears + 4)`
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/issue-46756-consider-borrowing-cast-or-binexpr.rs:5:4
+   |
+LL | fn light_flows_our_war_of_mocking_words(and_yet: &usize) -> usize {
+   |    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ---------------
 
 error: aborting due to 2 previous errors
 
index 37a42d2382d6be7b5bbd02c22a03fe01c9cf0fb7..7fd36676df8c17c15d84ab81d3609bd13661f8bb 100644 (file)
@@ -2,10 +2,17 @@ error[E0308]: mismatched types
   --> $DIR/issue-48364.rs:2:21
    |
 LL |     b"".starts_with(stringify!(foo))
-   |                     ^^^^^^^^^^^^^^^ expected slice `[u8]`, found `str`
+   |         ----------- ^^^^^^^^^^^^^^^ expected slice `[u8]`, found `str`
+   |         |
+   |         arguments to this function are incorrect
    |
    = note: expected reference `&[u8]`
               found reference `&'static str`
+note: associated function defined here
+  --> $SRC_DIR/core/src/slice/mod.rs:LL:COL
+   |
+LL |     pub fn starts_with(&self, needle: &[T]) -> bool
+   |            ^^^^^^^^^^^
    = note: this error originates in the macro `stringify` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: aborting due to previous error
index 03b9b91edefb2e61a582ebb2db3bf37fa03ab491..b4cebe2a68b5756d9f55805cf457c5b59e89a5c8 100644 (file)
@@ -2,15 +2,17 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied
   --> $DIR/issue-4935.rs:5:13
    |
 LL | fn main() { foo(5, 6) }
-   |             ^^^ -  - supplied 2 arguments
-   |             |
-   |             expected 1 argument
+   |             ^^^    - argument unexpected
    |
 note: function defined here
   --> $DIR/issue-4935.rs:3:4
    |
 LL | fn foo(a: usize) {}
    |    ^^^ --------
+help: remove the extra argument
+   |
+LL | fn main() { foo(5) }
+   |             ~~~~~~
 
 error: aborting due to previous error
 
index 3c3428f3096a8d282912dc512fe28bd1db9c2646..f2cbc3e6feb78d761f305a63b27de263003bbf5c 100644 (file)
@@ -4,11 +4,18 @@ error[E0308]: mismatched types
 LL | fn foo<F: FnMut()>() {
    |        - this type parameter
 LL |     let _: Box<F> = Box::new(|| ());
-   |                              ^^^^^ expected type parameter `F`, found closure
+   |                     -------- ^^^^^ expected type parameter `F`, found closure
+   |                     |
+   |                     arguments to this function are incorrect
    |
    = note: expected type parameter `F`
                      found closure `[closure@$DIR/issue-51154.rs:2:30: 2:35]`
    = help: every closure has a distinct type and so could not always match the caller-chosen type of parameter `F`
+note: associated function defined here
+  --> $SRC_DIR/alloc/src/boxed.rs:LL:COL
+   |
+LL |     pub fn new(x: T) -> Self {
+   |            ^^^
 
 error: aborting due to previous error
 
index 29c95e4fb62b89f4206e0ccf144549423b43ec29..1afff28f0b4e1dc16349d3e2ac52347908024bcd 100644 (file)
@@ -2,10 +2,17 @@ error[E0308]: mismatched types
   --> $DIR/issue-5216.rs:3:21
    |
 LL | pub static C: S = S(f);
-   |                     ^ expected struct `Box`, found fn item
+   |                   - ^ expected struct `Box`, found fn item
+   |                   |
+   |                   arguments to this struct are incorrect
    |
    = note: expected struct `Box<(dyn FnMut() + Sync + 'static)>`
              found fn item `fn() {f}`
+note: tuple struct defined here
+  --> $DIR/issue-5216.rs:2:8
+   |
+LL | struct S(Box<dyn FnMut() + Sync>);
+   |        ^
 
 error[E0308]: mismatched types
   --> $DIR/issue-5216.rs:8:19
index 2d841d28ee26d8aa478d7fb38592f77df71cdf30..2bc09234116b1171e2465b4492771242473480bc 100644 (file)
@@ -2,10 +2,17 @@ error[E0308]: mismatched types
   --> $DIR/issue-61106.rs:3:9
    |
 LL |     foo(x.clone());
-   |         ^^^^^^^^^
-   |         |
-   |         expected `&str`, found struct `String`
-   |         help: consider borrowing here: `&x`
+   |     --- ^^^^^^^^^
+   |     |   |
+   |     |   expected `&str`, found struct `String`
+   |     |   help: consider borrowing here: `&x`
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/issue-61106.rs:6:4
+   |
+LL | fn foo(_: &str) {}
+   |    ^^^ -------
 
 error: aborting due to previous error
 
index 58e85ec700d2df9ef2f93a20fe4846e456d885e5..61ec5d3180cc3ea96f449bd5f5a6bf9e1be36008 100644 (file)
@@ -4,10 +4,17 @@ error[E0308]: mismatched types
 LL | impl<T> S0<T> {
    |      - this type parameter
 LL |     const C: S0<u8> = Self(0);
-   |                            ^ expected type parameter `T`, found integer
+   |                       ---- ^ expected type parameter `T`, found integer
+   |                       |
+   |                       arguments to this function are incorrect
    |
    = note: expected type parameter `T`
                         found type `{integer}`
+note: tuple struct defined here
+  --> $DIR/issue-69306.rs:3:8
+   |
+LL | struct S0<T>(T);
+   |        ^^
 
 error[E0308]: mismatched types
   --> $DIR/issue-69306.rs:5:23
@@ -27,10 +34,17 @@ LL | impl<T> S0<T> {
    |      - this type parameter
 ...
 LL |         Self(0);
-   |              ^ expected type parameter `T`, found integer
+   |         ---- ^ expected type parameter `T`, found integer
+   |         |
+   |         arguments to this function are incorrect
    |
    = note: expected type parameter `T`
                         found type `{integer}`
+note: tuple struct defined here
+  --> $DIR/issue-69306.rs:3:8
+   |
+LL | struct S0<T>(T);
+   |        ^^
 
 error[E0308]: mismatched types
   --> $DIR/issue-69306.rs:27:14
@@ -39,10 +53,17 @@ LL | impl<T> Foo<T> for <S0<T> as Fun>::Out {
    |      - this type parameter
 LL |     fn foo() {
 LL |         Self(0);
-   |              ^ expected type parameter `T`, found integer
+   |         ---- ^ expected type parameter `T`, found integer
+   |         |
+   |         arguments to this function are incorrect
    |
    = note: expected type parameter `T`
                         found type `{integer}`
+note: tuple struct defined here
+  --> $DIR/issue-69306.rs:3:8
+   |
+LL | struct S0<T>(T);
+   |        ^^
 
 error[E0308]: mismatched types
   --> $DIR/issue-69306.rs:33:32
@@ -50,10 +71,17 @@ error[E0308]: mismatched types
 LL | impl<T> S1<T, u8> {
    |      - this type parameter
 LL |     const C: S1<u8, u8> = Self(0, 1);
-   |                                ^ expected type parameter `T`, found integer
+   |                           ---- ^ expected type parameter `T`, found integer
+   |                           |
+   |                           arguments to this function are incorrect
    |
    = note: expected type parameter `T`
                         found type `{integer}`
+note: tuple struct defined here
+  --> $DIR/issue-69306.rs:31:8
+   |
+LL | struct S1<T, U>(T, U);
+   |        ^^
 
 error[E0308]: mismatched types
   --> $DIR/issue-69306.rs:33:27
@@ -74,12 +102,19 @@ LL | impl<T> S2<T> {
 LL |     fn map<U>(x: U) -> S2<U> {
    |            - found type parameter
 LL |         Self(x)
-   |              ^ expected type parameter `T`, found type parameter `U`
+   |         ---- ^ expected type parameter `T`, found type parameter `U`
+   |         |
+   |         arguments to this function are incorrect
    |
    = note: expected type parameter `T`
               found type parameter `U`
    = note: a type parameter was expected, but a different one was found; you might be missing a type parameter or trait bound
    = note: for more information, visit https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters
+note: tuple struct defined here
+  --> $DIR/issue-69306.rs:38:8
+   |
+LL | struct S2<T>(T);
+   |        ^^
 
 error[E0308]: mismatched types
   --> $DIR/issue-69306.rs:41:9
index a973e23e29e4c93e716fead16c726b718e8aebff..f83e192130bdb207d950b7c17b20e24db8df8805 100644 (file)
@@ -2,11 +2,21 @@ error[E0308]: mismatched types
   --> $DIR/issue-29084.rs:4:13
    |
 LL |         bar(&mut $d);
-   |             ^^^^^^^ expected `u8`, found `&mut u8`
+   |         --- ^^^^^^^ expected `u8`, found `&mut u8`
+   |         |
+   |         arguments to this function are incorrect
 ...
 LL |     foo!(0u8);
    |     --------- in this macro invocation
    |
+note: function defined here
+  --> $DIR/issue-29084.rs:3:12
+   |
+LL |         fn bar(d: u8) { }
+   |            ^^^ -----
+...
+LL |     foo!(0u8);
+   |     --------- in this macro invocation
    = note: this error originates in the macro `foo` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: aborting due to previous error
index c410e076dde2655babda04452050473b7cdc44d2..53e582f7f13a4ecb819c2d81ee4879aec4b4cd1d 100644 (file)
@@ -2,43 +2,49 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied
   --> $DIR/method-call-err-msg.rs:13:7
    |
 LL |     x.zero(0)
-   |       ^^^^ - supplied 1 argument
-   |       |
-   |       expected 0 arguments
+   |       ^^^^ - argument unexpected
    |
 note: associated function defined here
   --> $DIR/method-call-err-msg.rs:5:8
    |
 LL |     fn zero(self) -> Foo { self }
    |        ^^^^ ----
+help: remove the extra argument
+   |
+LL |     x.zero()
+   |       ~~~~~~
 
 error[E0061]: this function takes 1 argument but 0 arguments were supplied
   --> $DIR/method-call-err-msg.rs:14:7
    |
 LL |      .one()
-   |       ^^^- supplied 0 arguments
-   |       |
-   |       expected 1 argument
+   |       ^^^-- an argument of type `isize` is missing
    |
 note: associated function defined here
   --> $DIR/method-call-err-msg.rs:6:8
    |
 LL |     fn one(self, _: isize) -> Foo { self }
    |        ^^^ ----  --------
+help: provide the argument
+   |
+LL |      .one({isize})
+   |       ~~~~~~~~~~~~
 
 error[E0061]: this function takes 2 arguments but 1 argument was supplied
   --> $DIR/method-call-err-msg.rs:15:7
    |
 LL |      .two(0);
-   |       ^^^ - supplied 1 argument
-   |       |
-   |       expected 2 arguments
+   |       ^^^--- an argument of type `isize` is missing
    |
 note: associated function defined here
   --> $DIR/method-call-err-msg.rs:7:8
    |
 LL |     fn two(self, _: isize, _: isize) -> Foo { self }
    |        ^^^ ----  --------  --------
+help: provide the argument
+   |
+LL |      .two(0, {isize});
+   |       ~~~~~~~~~~~~~~~
 
 error[E0599]: `Foo` is not an iterator
   --> $DIR/method-call-err-msg.rs:19:7
@@ -74,15 +80,17 @@ error[E0061]: this function takes 3 arguments but 0 arguments were supplied
   --> $DIR/method-call-err-msg.rs:21:7
    |
 LL |     y.three::<usize>();
-   |       ^^^^^--------- supplied 0 arguments
-   |       |
-   |       expected 3 arguments
+   |       ^^^^^^^^^^^^^^-- three arguments of type `usize`, `usize`, and `usize` are missing
    |
 note: associated function defined here
   --> $DIR/method-call-err-msg.rs:8:8
    |
 LL |     fn three<T>(self, _: T, _: T, _: T) -> Foo { self }
    |        ^^^^^    ----  ----  ----  ----
+help: provide the arguments
+   |
+LL |     y.three::<usize>({usize}, {usize}, {usize});
+   |       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 error: aborting due to 5 previous errors
 
index 17ea61fc4bddb5de20986d94d26c54273c074d4f..01fec6fcaaeece48207829be7ef86e1ea118c0d4 100644 (file)
@@ -2,19 +2,33 @@ error[E0308]: mismatched types
   --> $DIR/method-self-arg-1.rs:11:14
    |
 LL |     Foo::bar(x);
-   |              ^
-   |              |
-   |              expected `&Foo`, found struct `Foo`
-   |              help: consider borrowing here: `&x`
+   |     -------- ^
+   |     |        |
+   |     |        expected `&Foo`, found struct `Foo`
+   |     |        help: consider borrowing here: `&x`
+   |     arguments to this function are incorrect
+   |
+note: associated function defined here
+  --> $DIR/method-self-arg-1.rs:6:8
+   |
+LL |     fn bar(&self) {}
+   |        ^^^ -----
 
 error[E0308]: mismatched types
   --> $DIR/method-self-arg-1.rs:13:14
    |
 LL |     Foo::bar(&42);
-   |              ^^^ expected struct `Foo`, found integer
+   |     -------- ^^^ expected struct `Foo`, found integer
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&Foo`
               found reference `&{integer}`
+note: associated function defined here
+  --> $DIR/method-self-arg-1.rs:6:8
+   |
+LL |     fn bar(&self) {}
+   |        ^^^ -----
 
 error: aborting due to 2 previous errors
 
index da8a976daaf1a77f4037e1b8b35f981f51aabe2e..579a5b7ecb98ceec6f58c6b28aa1e726b38a7532 100644 (file)
@@ -1,17 +1,20 @@
 error[E0308]: mismatched types
   --> $DIR/issue-26480.rs:16:19
    |
+LL |             write(stdout, $arr.as_ptr() as *const i8,
+   |             ----- arguments to this function are incorrect
 LL |                   $arr.len() * size_of($arr[0]));
    |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u64`, found `usize`
 ...
 LL |     write!(hello);
    |     ------------- in this macro invocation
    |
-   = note: this error originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
-help: you can convert a `usize` to a `u64` and panic if the converted value doesn't fit
+note: function defined here
+  --> $DIR/issue-26480.rs:2:8
    |
-LL |                   ($arr.len() * size_of($arr[0])).try_into().unwrap());
-   |                   +                             +++++++++++++++++++++
+LL |     fn write(fildes: i32, buf: *const i8, nbyte: u64) -> i64;
+   |        ^^^^^
+   = note: this error originates in the macro `write` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0605]: non-primitive cast: `{integer}` as `()`
   --> $DIR/issue-26480.rs:22:19
index 9f4e4398984aed92cd5507aafdb11c567b9f0964..f0dea75001c2ce7cca6ffd46cfd5bc822a8f8323 100644 (file)
@@ -5,7 +5,9 @@ LL | impl<bool> Parser<bool> for bool {
    |      ---- this type parameter
 LL |     fn parse(text: &str) -> Option<bool> {
 LL |         Some(true)
-   |              ^^^^ expected type parameter `bool`, found `bool`
+   |         ---- ^^^^ expected type parameter `bool`, found `bool`
+   |         |
+   |         arguments to this enum variant are incorrect
    |
    = note: expected type parameter `bool` (type parameter `bool`)
                         found type `bool` (`bool`)
index 55e45a8f1625a6aa2d0d2b66e36f1e37038bc3f9..fcf3eccbcba2be9b2cbcd90bf2c36149bf369667 100644 (file)
@@ -2,8 +2,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-literal-cast.rs:6:9
    |
 LL |     foo(1u8);
-   |         ^^^ expected `u16`, found `u8`
+   |     --- ^^^ expected `u16`, found `u8`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-literal-cast.rs:1:4
+   |
+LL | fn foo(_: u16) {}
+   |    ^^^ ------
 help: change the type of the numeric literal from `u8` to `u16`
    |
 LL |     foo(1u16);
@@ -13,8 +20,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-literal-cast.rs:8:10
    |
 LL |     foo1(2f32);
-   |          ^^^^ expected `f64`, found `f32`
+   |     ---- ^^^^ expected `f64`, found `f32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-literal-cast.rs:2:4
    |
+LL | fn foo1(_: f64) {}
+   |    ^^^^ ------
 help: change the type of the numeric literal from `f32` to `f64`
    |
 LL |     foo1(2f64);
@@ -24,8 +38,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-literal-cast.rs:10:10
    |
 LL |     foo2(3i16);
-   |          ^^^^ expected `i32`, found `i16`
+   |     ---- ^^^^ expected `i32`, found `i16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-literal-cast.rs:3:4
    |
+LL | fn foo2(_: i32) {}
+   |    ^^^^ ------
 help: change the type of the numeric literal from `i16` to `i32`
    |
 LL |     foo2(3i32);
index d62625faaaa083b1bf6a907ecfb645c72768c263..902a6ec81d60b9cd87d328c50e1a3c89f6495382 100644 (file)
@@ -30,5 +30,4 @@ fn main() {
     //~^ ERROR this function takes 1 argument but 0 arguments were supplied
     let ans = s("burma", "shave");
     //~^ ERROR this function takes 1 argument but 2 arguments were supplied
-    //~| ERROR mismatched types
 }
index 9ae9c474162d94c4c221b4b312260253a781af40..a5742d6fe8c36e9e9ef85f90e76c28d906b3764b 100644 (file)
@@ -2,43 +2,51 @@ error[E0308]: mismatched types
   --> $DIR/overloaded-calls-bad.rs:28:17
    |
 LL |     let ans = s("what");
-   |                 ^^^^^^ expected `isize`, found `&str`
+   |               - ^^^^^^ expected `isize`, found `&str`
+   |               |
+   |               arguments to this function are incorrect
+   |
+note: associated function defined here
+  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
+   |
+LL |     extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output;
+   |                           ^^^^^^^^
 
 error[E0057]: this function takes 1 argument but 0 arguments were supplied
   --> $DIR/overloaded-calls-bad.rs:29:15
    |
 LL |     let ans = s();
-   |               ^-- supplied 0 arguments
-   |               |
-   |               expected 1 argument
+   |               ^-- an argument of type `isize` is missing
    |
 note: associated function defined here
   --> $SRC_DIR/core/src/ops/function.rs:LL:COL
    |
 LL |     extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output;
    |                           ^^^^^^^^
-
-error[E0308]: mismatched types
-  --> $DIR/overloaded-calls-bad.rs:31:17
+help: provide the argument
    |
-LL |     let ans = s("burma", "shave");
-   |                 ^^^^^^^ expected `isize`, found `&str`
+LL |     let ans = s({isize});
+   |               ~~~~~~~~~~
 
 error[E0057]: this function takes 1 argument but 2 arguments were supplied
   --> $DIR/overloaded-calls-bad.rs:31:15
    |
 LL |     let ans = s("burma", "shave");
-   |               ^ -------  ------- supplied 2 arguments
-   |               |
-   |               expected 1 argument
+   |               ^ -------  ------- argument unexpected
+   |                 |
+   |                 expected `isize`, found `&str`
    |
 note: associated function defined here
   --> $SRC_DIR/core/src/ops/function.rs:LL:COL
    |
 LL |     extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output;
    |                           ^^^^^^^^
+help: remove the extra argument
+   |
+LL |     let ans = s({isize});
+   |               ~~~~~~~~~~
 
-error: aborting due to 4 previous errors
+error: aborting due to 3 previous errors
 
 Some errors have detailed explanations: E0057, E0308.
 For more information about an error, try `rustc --explain E0057`.
index 485fae6d4d9ff36c731df41a3c65b3af965db222..80aef7fcbe8e2fcd785f219e9a857e52961b7d2d 100644 (file)
@@ -2,10 +2,17 @@ error[E0308]: mismatched types
   --> $DIR/trait-bounds-cant-coerce.rs:13:7
    |
 LL |     a(x);
-   |       ^ expected trait `Foo + Send`, found trait `Foo`
+   |     - ^ expected trait `Foo + Send`, found trait `Foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `Box<(dyn Foo + Send + 'static)>`
               found struct `Box<(dyn Foo + 'static)>`
+note: function defined here
+  --> $DIR/trait-bounds-cant-coerce.rs:5:4
+   |
+LL | fn a(_x: Box<dyn Foo + Send>) {
+   |    ^ -----------------------
 
 error: aborting due to previous error
 
index b77813f8af0b4a5b590401bb6e80b5f1316db9d1..ee739d6286a51d632330f3d7275a1e8c4a8e8b64 100644 (file)
@@ -2,13 +2,19 @@ error[E0308]: mismatched types
   --> $DIR/mut-cross-borrowing.rs:7:7
    |
 LL |     f(x)
-   |       ^
-   |       |
-   |       expected `&mut isize`, found struct `Box`
-   |       help: consider mutably borrowing here: `&mut x`
+   |     - ^
+   |     | |
+   |     | expected `&mut isize`, found struct `Box`
+   |     | help: consider mutably borrowing here: `&mut x`
+   |     arguments to this function are incorrect
    |
    = note: expected mutable reference `&mut isize`
                          found struct `Box<{integer}>`
+note: function defined here
+  --> $DIR/mut-cross-borrowing.rs:1:4
+   |
+LL | fn f(_: &mut isize) {}
+   |    ^ -------------
 
 error: aborting due to previous error
 
index eacef1dc3302d1facfca65bfafd225ba632fa782..fa3db33c9606f1d38aafd0c47c40ed0abd754ca4 100644 (file)
@@ -2,10 +2,17 @@ error[E0308]: mismatched types
   --> $DIR/call-fn-never-arg-wrong-type.rs:10:9
    |
 LL |     foo("wow");
-   |         ^^^^^ expected `!`, found `&str`
+   |     --- ^^^^^ expected `!`, found `&str`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note:   expected type `!`
            found reference `&'static str`
+note: function defined here
+  --> $DIR/call-fn-never-arg-wrong-type.rs:5:4
+   |
+LL | fn foo(x: !) -> ! {
+   |    ^^^ ----
 
 error: aborting due to previous error
 
index df957837241489ce4d36a2356c85b1b9bc674d1e..4f502acc95cbe654face1516b30ad294f8cd6881 100644 (file)
@@ -2,23 +2,23 @@ error[E0061]: this function takes 4 arguments but 3 arguments were supplied
   --> $DIR/not-enough-arguments.rs:27:3
    |
 LL |   foo(1, 2, 3);
-   |   ^^^ -  -  - supplied 3 arguments
-   |   |
-   |   expected 4 arguments
+   |   ^^^--------- an argument of type `isize` is missing
    |
 note: function defined here
   --> $DIR/not-enough-arguments.rs:5:4
    |
 LL | fn foo(a: isize, b: isize, c: isize, d:isize) {
    |    ^^^ --------  --------  --------  -------
+help: provide the argument
+   |
+LL |   foo(1, 2, 3, {isize});
+   |   ~~~~~~~~~~~~~~~~~~~~~
 
 error[E0061]: this function takes 6 arguments but 3 arguments were supplied
   --> $DIR/not-enough-arguments.rs:29:3
    |
 LL |   bar(1, 2, 3);
-   |   ^^^ -  -  - supplied 3 arguments
-   |   |
-   |   expected 6 arguments
+   |   ^^^--------- three arguments of type `i32`, `i32`, and `i32` are missing
    |
 note: function defined here
   --> $DIR/not-enough-arguments.rs:10:4
@@ -37,6 +37,10 @@ LL |     e: i32,
    |     ------
 LL |     f: i32,
    |     ------
+help: provide the arguments
+   |
+LL |   bar(1, 2, 3, {i32}, {i32}, {i32});
+   |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 error: aborting due to 2 previous errors
 
index 4c29c4a1cb05c6af7160603f4c854000470f7c15..5045f584c8977886ac002c53e385c9e1067af8d1 100644 (file)
@@ -2,8 +2,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:38:11
    |
 LL |     id_i8(a16);
-   |           ^^^ expected `i8`, found `i16`
+   |     ----- ^^^ expected `i8`, found `i16`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:15:8
+   |
+LL |     fn id_i8(n: i8) -> i8 { n }
+   |        ^^^^^ -----
 help: you can convert an `i16` to an `i8` and panic if the converted value doesn't fit
    |
 LL |     id_i8(a16.try_into().unwrap());
@@ -13,8 +20,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:41:11
    |
 LL |     id_i8(a32);
-   |           ^^^ expected `i8`, found `i32`
+   |     ----- ^^^ expected `i8`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:15:8
    |
+LL |     fn id_i8(n: i8) -> i8 { n }
+   |        ^^^^^ -----
 help: you can convert an `i32` to an `i8` and panic if the converted value doesn't fit
    |
 LL |     id_i8(a32.try_into().unwrap());
@@ -24,8 +38,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:44:11
    |
 LL |     id_i8(a64);
-   |           ^^^ expected `i8`, found `i64`
+   |     ----- ^^^ expected `i8`, found `i64`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:15:8
+   |
+LL |     fn id_i8(n: i8) -> i8 { n }
+   |        ^^^^^ -----
 help: you can convert an `i64` to an `i8` and panic if the converted value doesn't fit
    |
 LL |     id_i8(a64.try_into().unwrap());
@@ -35,8 +56,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:47:11
    |
 LL |     id_i8(asize);
-   |           ^^^^^ expected `i8`, found `isize`
+   |     ----- ^^^^^ expected `i8`, found `isize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:15:8
    |
+LL |     fn id_i8(n: i8) -> i8 { n }
+   |        ^^^^^ -----
 help: you can convert an `isize` to an `i8` and panic if the converted value doesn't fit
    |
 LL |     id_i8(asize.try_into().unwrap());
@@ -46,8 +74,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:51:12
    |
 LL |     id_i16(a8);
-   |            ^^ expected `i16`, found `i8`
+   |     ------ ^^ expected `i16`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:16:8
+   |
+LL |     fn id_i16(n: i16) -> i16 { n }
+   |        ^^^^^^ ------
 help: you can convert an `i8` to an `i16`
    |
 LL |     id_i16(a8.into());
@@ -57,8 +92,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:55:12
    |
 LL |     id_i16(a32);
-   |            ^^^ expected `i16`, found `i32`
+   |     ------ ^^^ expected `i16`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:16:8
    |
+LL |     fn id_i16(n: i16) -> i16 { n }
+   |        ^^^^^^ ------
 help: you can convert an `i32` to an `i16` and panic if the converted value doesn't fit
    |
 LL |     id_i16(a32.try_into().unwrap());
@@ -68,8 +110,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:58:12
    |
 LL |     id_i16(a64);
-   |            ^^^ expected `i16`, found `i64`
+   |     ------ ^^^ expected `i16`, found `i64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:16:8
    |
+LL |     fn id_i16(n: i16) -> i16 { n }
+   |        ^^^^^^ ------
 help: you can convert an `i64` to an `i16` and panic if the converted value doesn't fit
    |
 LL |     id_i16(a64.try_into().unwrap());
@@ -79,8 +128,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:61:12
    |
 LL |     id_i16(asize);
-   |            ^^^^^ expected `i16`, found `isize`
+   |     ------ ^^^^^ expected `i16`, found `isize`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:16:8
+   |
+LL |     fn id_i16(n: i16) -> i16 { n }
+   |        ^^^^^^ ------
 help: you can convert an `isize` to an `i16` and panic if the converted value doesn't fit
    |
 LL |     id_i16(asize.try_into().unwrap());
@@ -90,8 +146,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:65:12
    |
 LL |     id_i32(a8);
-   |            ^^ expected `i32`, found `i8`
+   |     ------ ^^ expected `i32`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:17:8
    |
+LL |     fn id_i32(n: i32) -> i32 { n }
+   |        ^^^^^^ ------
 help: you can convert an `i8` to an `i32`
    |
 LL |     id_i32(a8.into());
@@ -101,8 +164,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:68:12
    |
 LL |     id_i32(a16);
-   |            ^^^ expected `i32`, found `i16`
+   |     ------ ^^^ expected `i32`, found `i16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:17:8
    |
+LL |     fn id_i32(n: i32) -> i32 { n }
+   |        ^^^^^^ ------
 help: you can convert an `i16` to an `i32`
    |
 LL |     id_i32(a16.into());
@@ -112,8 +182,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:72:12
    |
 LL |     id_i32(a64);
-   |            ^^^ expected `i32`, found `i64`
+   |     ------ ^^^ expected `i32`, found `i64`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:17:8
+   |
+LL |     fn id_i32(n: i32) -> i32 { n }
+   |        ^^^^^^ ------
 help: you can convert an `i64` to an `i32` and panic if the converted value doesn't fit
    |
 LL |     id_i32(a64.try_into().unwrap());
@@ -123,8 +200,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:75:12
    |
 LL |     id_i32(asize);
-   |            ^^^^^ expected `i32`, found `isize`
+   |     ------ ^^^^^ expected `i32`, found `isize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:17:8
    |
+LL |     fn id_i32(n: i32) -> i32 { n }
+   |        ^^^^^^ ------
 help: you can convert an `isize` to an `i32` and panic if the converted value doesn't fit
    |
 LL |     id_i32(asize.try_into().unwrap());
@@ -134,8 +218,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:79:12
    |
 LL |     id_i64(a8);
-   |            ^^ expected `i64`, found `i8`
+   |     ------ ^^ expected `i64`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:18:8
    |
+LL |     fn id_i64(n: i64) -> i64 { n }
+   |        ^^^^^^ ------
 help: you can convert an `i8` to an `i64`
    |
 LL |     id_i64(a8.into());
@@ -145,8 +236,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:82:12
    |
 LL |     id_i64(a16);
-   |            ^^^ expected `i64`, found `i16`
+   |     ------ ^^^ expected `i64`, found `i16`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:18:8
+   |
+LL |     fn id_i64(n: i64) -> i64 { n }
+   |        ^^^^^^ ------
 help: you can convert an `i16` to an `i64`
    |
 LL |     id_i64(a16.into());
@@ -156,8 +254,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:85:12
    |
 LL |     id_i64(a32);
-   |            ^^^ expected `i64`, found `i32`
+   |     ------ ^^^ expected `i64`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:18:8
    |
+LL |     fn id_i64(n: i64) -> i64 { n }
+   |        ^^^^^^ ------
 help: you can convert an `i32` to an `i64`
    |
 LL |     id_i64(a32.into());
@@ -167,8 +272,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:89:12
    |
 LL |     id_i64(asize);
-   |            ^^^^^ expected `i64`, found `isize`
+   |     ------ ^^^^^ expected `i64`, found `isize`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:18:8
+   |
+LL |     fn id_i64(n: i64) -> i64 { n }
+   |        ^^^^^^ ------
 help: you can convert an `isize` to an `i64` and panic if the converted value doesn't fit
    |
 LL |     id_i64(asize.try_into().unwrap());
@@ -178,8 +290,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:93:14
    |
 LL |     id_isize(a8);
-   |              ^^ expected `isize`, found `i8`
+   |     -------- ^^ expected `isize`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:19:8
    |
+LL |     fn id_isize(n: isize) -> isize { n }
+   |        ^^^^^^^^ --------
 help: you can convert an `i8` to an `isize`
    |
 LL |     id_isize(a8.into());
@@ -189,8 +308,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:96:14
    |
 LL |     id_isize(a16);
-   |              ^^^ expected `isize`, found `i16`
+   |     -------- ^^^ expected `isize`, found `i16`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:19:8
+   |
+LL |     fn id_isize(n: isize) -> isize { n }
+   |        ^^^^^^^^ --------
 help: you can convert an `i16` to an `isize`
    |
 LL |     id_isize(a16.into());
@@ -200,8 +326,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:99:14
    |
 LL |     id_isize(a32);
-   |              ^^^ expected `isize`, found `i32`
+   |     -------- ^^^ expected `isize`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:19:8
    |
+LL |     fn id_isize(n: isize) -> isize { n }
+   |        ^^^^^^^^ --------
 help: you can convert an `i32` to an `isize` and panic if the converted value doesn't fit
    |
 LL |     id_isize(a32.try_into().unwrap());
@@ -211,8 +344,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:102:14
    |
 LL |     id_isize(a64);
-   |              ^^^ expected `isize`, found `i64`
+   |     -------- ^^^ expected `isize`, found `i64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:19:8
    |
+LL |     fn id_isize(n: isize) -> isize { n }
+   |        ^^^^^^^^ --------
 help: you can convert an `i64` to an `isize` and panic if the converted value doesn't fit
    |
 LL |     id_isize(a64.try_into().unwrap());
@@ -222,8 +362,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:108:11
    |
 LL |     id_i8(c16);
-   |           ^^^ expected `i8`, found `i16`
+   |     ----- ^^^ expected `i8`, found `i16`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:15:8
+   |
+LL |     fn id_i8(n: i8) -> i8 { n }
+   |        ^^^^^ -----
 help: you can convert an `i16` to an `i8` and panic if the converted value doesn't fit
    |
 LL |     id_i8(c16.try_into().unwrap());
@@ -233,8 +380,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:111:11
    |
 LL |     id_i8(c32);
-   |           ^^^ expected `i8`, found `i32`
+   |     ----- ^^^ expected `i8`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:15:8
    |
+LL |     fn id_i8(n: i8) -> i8 { n }
+   |        ^^^^^ -----
 help: you can convert an `i32` to an `i8` and panic if the converted value doesn't fit
    |
 LL |     id_i8(c32.try_into().unwrap());
@@ -244,8 +398,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:114:11
    |
 LL |     id_i8(c64);
-   |           ^^^ expected `i8`, found `i64`
+   |     ----- ^^^ expected `i8`, found `i64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:15:8
    |
+LL |     fn id_i8(n: i8) -> i8 { n }
+   |        ^^^^^ -----
 help: you can convert an `i64` to an `i8` and panic if the converted value doesn't fit
    |
 LL |     id_i8(c64.try_into().unwrap());
@@ -255,8 +416,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:118:12
    |
 LL |     id_i16(c8);
-   |            ^^ expected `i16`, found `i8`
+   |     ------ ^^ expected `i16`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:16:8
+   |
+LL |     fn id_i16(n: i16) -> i16 { n }
+   |        ^^^^^^ ------
 help: you can convert an `i8` to an `i16`
    |
 LL |     id_i16(c8.into());
@@ -266,8 +434,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:122:12
    |
 LL |     id_i16(c32);
-   |            ^^^ expected `i16`, found `i32`
+   |     ------ ^^^ expected `i16`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:16:8
    |
+LL |     fn id_i16(n: i16) -> i16 { n }
+   |        ^^^^^^ ------
 help: you can convert an `i32` to an `i16` and panic if the converted value doesn't fit
    |
 LL |     id_i16(c32.try_into().unwrap());
@@ -277,8 +452,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:125:12
    |
 LL |     id_i16(c64);
-   |            ^^^ expected `i16`, found `i64`
+   |     ------ ^^^ expected `i16`, found `i64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:16:8
    |
+LL |     fn id_i16(n: i16) -> i16 { n }
+   |        ^^^^^^ ------
 help: you can convert an `i64` to an `i16` and panic if the converted value doesn't fit
    |
 LL |     id_i16(c64.try_into().unwrap());
@@ -288,8 +470,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:129:12
    |
 LL |     id_i32(c8);
-   |            ^^ expected `i32`, found `i8`
+   |     ------ ^^ expected `i32`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:17:8
+   |
+LL |     fn id_i32(n: i32) -> i32 { n }
+   |        ^^^^^^ ------
 help: you can convert an `i8` to an `i32`
    |
 LL |     id_i32(c8.into());
@@ -299,8 +488,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:132:12
    |
 LL |     id_i32(c16);
-   |            ^^^ expected `i32`, found `i16`
+   |     ------ ^^^ expected `i32`, found `i16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:17:8
    |
+LL |     fn id_i32(n: i32) -> i32 { n }
+   |        ^^^^^^ ------
 help: you can convert an `i16` to an `i32`
    |
 LL |     id_i32(c16.into());
@@ -310,8 +506,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:136:12
    |
 LL |     id_i32(c64);
-   |            ^^^ expected `i32`, found `i64`
+   |     ------ ^^^ expected `i32`, found `i64`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:17:8
+   |
+LL |     fn id_i32(n: i32) -> i32 { n }
+   |        ^^^^^^ ------
 help: you can convert an `i64` to an `i32` and panic if the converted value doesn't fit
    |
 LL |     id_i32(c64.try_into().unwrap());
@@ -321,8 +524,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:140:12
    |
 LL |     id_i64(a8);
-   |            ^^ expected `i64`, found `i8`
+   |     ------ ^^ expected `i64`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:18:8
    |
+LL |     fn id_i64(n: i64) -> i64 { n }
+   |        ^^^^^^ ------
 help: you can convert an `i8` to an `i64`
    |
 LL |     id_i64(a8.into());
@@ -332,8 +542,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:143:12
    |
 LL |     id_i64(a16);
-   |            ^^^ expected `i64`, found `i16`
+   |     ------ ^^^ expected `i64`, found `i16`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:18:8
+   |
+LL |     fn id_i64(n: i64) -> i64 { n }
+   |        ^^^^^^ ------
 help: you can convert an `i16` to an `i64`
    |
 LL |     id_i64(a16.into());
@@ -343,8 +560,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:146:12
    |
 LL |     id_i64(a32);
-   |            ^^^ expected `i64`, found `i32`
+   |     ------ ^^^ expected `i64`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:18:8
    |
+LL |     fn id_i64(n: i64) -> i64 { n }
+   |        ^^^^^^ ------
 help: you can convert an `i32` to an `i64`
    |
 LL |     id_i64(a32.into());
@@ -354,8 +578,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:152:11
    |
 LL |     id_u8(b16);
-   |           ^^^ expected `u8`, found `u16`
+   |     ----- ^^^ expected `u8`, found `u16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:27:8
    |
+LL |     fn id_u8(n: u8) -> u8 { n }
+   |        ^^^^^ -----
 help: you can convert a `u16` to a `u8` and panic if the converted value doesn't fit
    |
 LL |     id_u8(b16.try_into().unwrap());
@@ -365,8 +596,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:155:11
    |
 LL |     id_u8(b32);
-   |           ^^^ expected `u8`, found `u32`
+   |     ----- ^^^ expected `u8`, found `u32`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:27:8
+   |
+LL |     fn id_u8(n: u8) -> u8 { n }
+   |        ^^^^^ -----
 help: you can convert a `u32` to a `u8` and panic if the converted value doesn't fit
    |
 LL |     id_u8(b32.try_into().unwrap());
@@ -376,8 +614,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:158:11
    |
 LL |     id_u8(b64);
-   |           ^^^ expected `u8`, found `u64`
+   |     ----- ^^^ expected `u8`, found `u64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:27:8
    |
+LL |     fn id_u8(n: u8) -> u8 { n }
+   |        ^^^^^ -----
 help: you can convert a `u64` to a `u8` and panic if the converted value doesn't fit
    |
 LL |     id_u8(b64.try_into().unwrap());
@@ -387,8 +632,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:161:11
    |
 LL |     id_u8(bsize);
-   |           ^^^^^ expected `u8`, found `usize`
+   |     ----- ^^^^^ expected `u8`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:27:8
    |
+LL |     fn id_u8(n: u8) -> u8 { n }
+   |        ^^^^^ -----
 help: you can convert a `usize` to a `u8` and panic if the converted value doesn't fit
    |
 LL |     id_u8(bsize.try_into().unwrap());
@@ -398,8 +650,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:165:12
    |
 LL |     id_u16(b8);
-   |            ^^ expected `u16`, found `u8`
+   |     ------ ^^ expected `u16`, found `u8`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:28:8
+   |
+LL |     fn id_u16(n: u16) -> u16 { n }
+   |        ^^^^^^ ------
 help: you can convert a `u8` to a `u16`
    |
 LL |     id_u16(b8.into());
@@ -409,8 +668,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:169:12
    |
 LL |     id_u16(b32);
-   |            ^^^ expected `u16`, found `u32`
+   |     ------ ^^^ expected `u16`, found `u32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:28:8
    |
+LL |     fn id_u16(n: u16) -> u16 { n }
+   |        ^^^^^^ ------
 help: you can convert a `u32` to a `u16` and panic if the converted value doesn't fit
    |
 LL |     id_u16(b32.try_into().unwrap());
@@ -420,8 +686,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:172:12
    |
 LL |     id_u16(b64);
-   |            ^^^ expected `u16`, found `u64`
+   |     ------ ^^^ expected `u16`, found `u64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:28:8
    |
+LL |     fn id_u16(n: u16) -> u16 { n }
+   |        ^^^^^^ ------
 help: you can convert a `u64` to a `u16` and panic if the converted value doesn't fit
    |
 LL |     id_u16(b64.try_into().unwrap());
@@ -431,8 +704,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:175:12
    |
 LL |     id_u16(bsize);
-   |            ^^^^^ expected `u16`, found `usize`
+   |     ------ ^^^^^ expected `u16`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:28:8
+   |
+LL |     fn id_u16(n: u16) -> u16 { n }
+   |        ^^^^^^ ------
 help: you can convert a `usize` to a `u16` and panic if the converted value doesn't fit
    |
 LL |     id_u16(bsize.try_into().unwrap());
@@ -442,8 +722,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:179:12
    |
 LL |     id_u32(b8);
-   |            ^^ expected `u32`, found `u8`
+   |     ------ ^^ expected `u32`, found `u8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:29:8
    |
+LL |     fn id_u32(n: u32) -> u32 { n }
+   |        ^^^^^^ ------
 help: you can convert a `u8` to a `u32`
    |
 LL |     id_u32(b8.into());
@@ -453,8 +740,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:182:12
    |
 LL |     id_u32(b16);
-   |            ^^^ expected `u32`, found `u16`
+   |     ------ ^^^ expected `u32`, found `u16`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:29:8
+   |
+LL |     fn id_u32(n: u32) -> u32 { n }
+   |        ^^^^^^ ------
 help: you can convert a `u16` to a `u32`
    |
 LL |     id_u32(b16.into());
@@ -464,8 +758,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:186:12
    |
 LL |     id_u32(b64);
-   |            ^^^ expected `u32`, found `u64`
+   |     ------ ^^^ expected `u32`, found `u64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:29:8
    |
+LL |     fn id_u32(n: u32) -> u32 { n }
+   |        ^^^^^^ ------
 help: you can convert a `u64` to a `u32` and panic if the converted value doesn't fit
    |
 LL |     id_u32(b64.try_into().unwrap());
@@ -475,8 +776,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:189:12
    |
 LL |     id_u32(bsize);
-   |            ^^^^^ expected `u32`, found `usize`
+   |     ------ ^^^^^ expected `u32`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:29:8
+   |
+LL |     fn id_u32(n: u32) -> u32 { n }
+   |        ^^^^^^ ------
 help: you can convert a `usize` to a `u32` and panic if the converted value doesn't fit
    |
 LL |     id_u32(bsize.try_into().unwrap());
@@ -486,8 +794,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:193:12
    |
 LL |     id_u64(b8);
-   |            ^^ expected `u64`, found `u8`
+   |     ------ ^^ expected `u64`, found `u8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:30:8
    |
+LL |     fn id_u64(n: u64) -> u64 { n }
+   |        ^^^^^^ ------
 help: you can convert a `u8` to a `u64`
    |
 LL |     id_u64(b8.into());
@@ -497,8 +812,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:196:12
    |
 LL |     id_u64(b16);
-   |            ^^^ expected `u64`, found `u16`
+   |     ------ ^^^ expected `u64`, found `u16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:30:8
    |
+LL |     fn id_u64(n: u64) -> u64 { n }
+   |        ^^^^^^ ------
 help: you can convert a `u16` to a `u64`
    |
 LL |     id_u64(b16.into());
@@ -508,8 +830,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:199:12
    |
 LL |     id_u64(b32);
-   |            ^^^ expected `u64`, found `u32`
+   |     ------ ^^^ expected `u64`, found `u32`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:30:8
+   |
+LL |     fn id_u64(n: u64) -> u64 { n }
+   |        ^^^^^^ ------
 help: you can convert a `u32` to a `u64`
    |
 LL |     id_u64(b32.into());
@@ -519,8 +848,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:203:12
    |
 LL |     id_u64(bsize);
-   |            ^^^^^ expected `u64`, found `usize`
+   |     ------ ^^^^^ expected `u64`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:30:8
    |
+LL |     fn id_u64(n: u64) -> u64 { n }
+   |        ^^^^^^ ------
 help: you can convert a `usize` to a `u64` and panic if the converted value doesn't fit
    |
 LL |     id_u64(bsize.try_into().unwrap());
@@ -530,8 +866,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:207:14
    |
 LL |     id_usize(b8);
-   |              ^^ expected `usize`, found `u8`
+   |     -------- ^^ expected `usize`, found `u8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:31:8
    |
+LL |     fn id_usize(n: usize) -> usize { n }
+   |        ^^^^^^^^ --------
 help: you can convert a `u8` to a `usize`
    |
 LL |     id_usize(b8.into());
@@ -541,8 +884,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:210:14
    |
 LL |     id_usize(b16);
-   |              ^^^ expected `usize`, found `u16`
+   |     -------- ^^^ expected `usize`, found `u16`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:31:8
+   |
+LL |     fn id_usize(n: usize) -> usize { n }
+   |        ^^^^^^^^ --------
 help: you can convert a `u16` to a `usize`
    |
 LL |     id_usize(b16.into());
@@ -552,8 +902,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:213:14
    |
 LL |     id_usize(b32);
-   |              ^^^ expected `usize`, found `u32`
+   |     -------- ^^^ expected `usize`, found `u32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:31:8
    |
+LL |     fn id_usize(n: usize) -> usize { n }
+   |        ^^^^^^^^ --------
 help: you can convert a `u32` to a `usize` and panic if the converted value doesn't fit
    |
 LL |     id_usize(b32.try_into().unwrap());
@@ -563,8 +920,15 @@ error[E0308]: mismatched types
   --> $DIR/integer-literal-suffix-inference.rs:216:14
    |
 LL |     id_usize(b64);
-   |              ^^^ expected `usize`, found `u64`
+   |     -------- ^^^ expected `usize`, found `u64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/integer-literal-suffix-inference.rs:31:8
    |
+LL |     fn id_usize(n: usize) -> usize { n }
+   |        ^^^^^^^^ --------
 help: you can convert a `u64` to a `usize` and panic if the converted value doesn't fit
    |
 LL |     id_usize(b64.try_into().unwrap());
index 6319c1ead24eec010e171885528287437653288b..55a61b5e443792e395e7c7627afc40e5f37689c6 100644 (file)
@@ -2,8 +2,15 @@ error[E0308]: mismatched types
   --> $DIR/len.rs:3:10
    |
 LL |     test(array.len());
-   |          ^^^^^^^^^^^ expected `u32`, found `usize`
+   |     ---- ^^^^^^^^^^^ expected `u32`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/len.rs:6:4
+   |
+LL | fn test(length: u32) {
+   |    ^^^^ -----------
 help: you can convert a `usize` to a `u32` and panic if the converted value doesn't fit
    |
 LL |     test(array.len().try_into().unwrap());
index a96518a34342d43b6c88fde7c9ddc4477c6b4ef9..581b548abcac4e83795b20289bc4c268d369fb55 100644 (file)
@@ -2,127 +2,295 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast-without-suggestion.rs:17:18
    |
 LL |     foo::<usize>(x_f64);
-   |                  ^^^^^ expected `usize`, found `f64`
+   |     ------------ ^^^^^ expected `usize`, found `f64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast-without-suggestion.rs:1:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 
 error[E0308]: mismatched types
   --> $DIR/numeric-cast-without-suggestion.rs:18:18
    |
 LL |     foo::<usize>(x_f32);
-   |                  ^^^^^ expected `usize`, found `f32`
+   |     ------------ ^^^^^ expected `usize`, found `f32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast-without-suggestion.rs:1:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 
 error[E0308]: mismatched types
   --> $DIR/numeric-cast-without-suggestion.rs:19:18
    |
 LL |     foo::<isize>(x_f64);
-   |                  ^^^^^ expected `isize`, found `f64`
+   |     ------------ ^^^^^ expected `isize`, found `f64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast-without-suggestion.rs:1:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 
 error[E0308]: mismatched types
   --> $DIR/numeric-cast-without-suggestion.rs:20:18
    |
 LL |     foo::<isize>(x_f32);
-   |                  ^^^^^ expected `isize`, found `f32`
+   |     ------------ ^^^^^ expected `isize`, found `f32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast-without-suggestion.rs:1:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 
 error[E0308]: mismatched types
   --> $DIR/numeric-cast-without-suggestion.rs:21:16
    |
 LL |     foo::<u64>(x_f64);
-   |                ^^^^^ expected `u64`, found `f64`
+   |     ---------- ^^^^^ expected `u64`, found `f64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast-without-suggestion.rs:1:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 
 error[E0308]: mismatched types
   --> $DIR/numeric-cast-without-suggestion.rs:22:16
    |
 LL |     foo::<u64>(x_f32);
-   |                ^^^^^ expected `u64`, found `f32`
+   |     ---------- ^^^^^ expected `u64`, found `f32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast-without-suggestion.rs:1:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 
 error[E0308]: mismatched types
   --> $DIR/numeric-cast-without-suggestion.rs:23:16
    |
 LL |     foo::<i64>(x_f64);
-   |                ^^^^^ expected `i64`, found `f64`
+   |     ---------- ^^^^^ expected `i64`, found `f64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast-without-suggestion.rs:1:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 
 error[E0308]: mismatched types
   --> $DIR/numeric-cast-without-suggestion.rs:24:16
    |
 LL |     foo::<i64>(x_f32);
-   |                ^^^^^ expected `i64`, found `f32`
+   |     ---------- ^^^^^ expected `i64`, found `f32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast-without-suggestion.rs:1:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 
 error[E0308]: mismatched types
   --> $DIR/numeric-cast-without-suggestion.rs:25:16
    |
 LL |     foo::<u32>(x_f64);
-   |                ^^^^^ expected `u32`, found `f64`
+   |     ---------- ^^^^^ expected `u32`, found `f64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast-without-suggestion.rs:1:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 
 error[E0308]: mismatched types
   --> $DIR/numeric-cast-without-suggestion.rs:26:16
    |
 LL |     foo::<u32>(x_f32);
-   |                ^^^^^ expected `u32`, found `f32`
+   |     ---------- ^^^^^ expected `u32`, found `f32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast-without-suggestion.rs:1:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 
 error[E0308]: mismatched types
   --> $DIR/numeric-cast-without-suggestion.rs:27:16
    |
 LL |     foo::<i32>(x_f64);
-   |                ^^^^^ expected `i32`, found `f64`
+   |     ---------- ^^^^^ expected `i32`, found `f64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast-without-suggestion.rs:1:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 
 error[E0308]: mismatched types
   --> $DIR/numeric-cast-without-suggestion.rs:28:16
    |
 LL |     foo::<i32>(x_f32);
-   |                ^^^^^ expected `i32`, found `f32`
+   |     ---------- ^^^^^ expected `i32`, found `f32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast-without-suggestion.rs:1:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 
 error[E0308]: mismatched types
   --> $DIR/numeric-cast-without-suggestion.rs:29:16
    |
 LL |     foo::<u16>(x_f64);
-   |                ^^^^^ expected `u16`, found `f64`
+   |     ---------- ^^^^^ expected `u16`, found `f64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast-without-suggestion.rs:1:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 
 error[E0308]: mismatched types
   --> $DIR/numeric-cast-without-suggestion.rs:30:16
    |
 LL |     foo::<u16>(x_f32);
-   |                ^^^^^ expected `u16`, found `f32`
+   |     ---------- ^^^^^ expected `u16`, found `f32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast-without-suggestion.rs:1:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 
 error[E0308]: mismatched types
   --> $DIR/numeric-cast-without-suggestion.rs:31:16
    |
 LL |     foo::<i16>(x_f64);
-   |                ^^^^^ expected `i16`, found `f64`
+   |     ---------- ^^^^^ expected `i16`, found `f64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast-without-suggestion.rs:1:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 
 error[E0308]: mismatched types
   --> $DIR/numeric-cast-without-suggestion.rs:32:16
    |
 LL |     foo::<i16>(x_f32);
-   |                ^^^^^ expected `i16`, found `f32`
+   |     ---------- ^^^^^ expected `i16`, found `f32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast-without-suggestion.rs:1:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 
 error[E0308]: mismatched types
   --> $DIR/numeric-cast-without-suggestion.rs:33:15
    |
 LL |     foo::<u8>(x_f64);
-   |               ^^^^^ expected `u8`, found `f64`
+   |     --------- ^^^^^ expected `u8`, found `f64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast-without-suggestion.rs:1:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 
 error[E0308]: mismatched types
   --> $DIR/numeric-cast-without-suggestion.rs:34:15
    |
 LL |     foo::<u8>(x_f32);
-   |               ^^^^^ expected `u8`, found `f32`
+   |     --------- ^^^^^ expected `u8`, found `f32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast-without-suggestion.rs:1:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 
 error[E0308]: mismatched types
   --> $DIR/numeric-cast-without-suggestion.rs:35:15
    |
 LL |     foo::<i8>(x_f64);
-   |               ^^^^^ expected `i8`, found `f64`
+   |     --------- ^^^^^ expected `i8`, found `f64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast-without-suggestion.rs:1:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 
 error[E0308]: mismatched types
   --> $DIR/numeric-cast-without-suggestion.rs:36:15
    |
 LL |     foo::<i8>(x_f32);
-   |               ^^^^^ expected `i8`, found `f32`
+   |     --------- ^^^^^ expected `i8`, found `f32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast-without-suggestion.rs:1:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 
 error[E0308]: mismatched types
   --> $DIR/numeric-cast-without-suggestion.rs:37:16
    |
 LL |     foo::<f32>(x_f64);
-   |                ^^^^^ expected `f32`, found `f64`
+   |     ---------- ^^^^^ expected `f32`, found `f64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast-without-suggestion.rs:1:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 
 error: aborting due to 21 previous errors
 
index b8f2d88ab4957e9fb246700d708eab9f34528959..d347875d5a947df9231cc54cb60b3a642b69efa9 100644 (file)
@@ -2,8 +2,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:23:18
    |
 LL |     foo::<usize>(x_u64);
-   |                  ^^^^^ expected `usize`, found `u64`
+   |     ------------ ^^^^^ expected `usize`, found `u64`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u64` to a `usize` and panic if the converted value doesn't fit
    |
 LL |     foo::<usize>(x_u64.try_into().unwrap());
@@ -13,8 +20,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:25:18
    |
 LL |     foo::<usize>(x_u32);
-   |                  ^^^^^ expected `usize`, found `u32`
+   |     ------------ ^^^^^ expected `usize`, found `u32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u32` to a `usize` and panic if the converted value doesn't fit
    |
 LL |     foo::<usize>(x_u32.try_into().unwrap());
@@ -24,8 +38,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:27:18
    |
 LL |     foo::<usize>(x_u16);
-   |                  ^^^^^ expected `usize`, found `u16`
+   |     ------------ ^^^^^ expected `usize`, found `u16`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u16` to a `usize`
    |
 LL |     foo::<usize>(x_u16.into());
@@ -35,8 +56,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:29:18
    |
 LL |     foo::<usize>(x_u8);
-   |                  ^^^^ expected `usize`, found `u8`
+   |     ------------ ^^^^ expected `usize`, found `u8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u8` to a `usize`
    |
 LL |     foo::<usize>(x_u8.into());
@@ -46,8 +74,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:31:18
    |
 LL |     foo::<usize>(x_isize);
-   |                  ^^^^^^^ expected `usize`, found `isize`
+   |     ------------ ^^^^^^^ expected `usize`, found `isize`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `isize` to a `usize` and panic if the converted value doesn't fit
    |
 LL |     foo::<usize>(x_isize.try_into().unwrap());
@@ -57,8 +92,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:33:18
    |
 LL |     foo::<usize>(x_i64);
-   |                  ^^^^^ expected `usize`, found `i64`
+   |     ------------ ^^^^^ expected `usize`, found `i64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i64` to a `usize` and panic if the converted value doesn't fit
    |
 LL |     foo::<usize>(x_i64.try_into().unwrap());
@@ -68,8 +110,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:35:18
    |
 LL |     foo::<usize>(x_i32);
-   |                  ^^^^^ expected `usize`, found `i32`
+   |     ------------ ^^^^^ expected `usize`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i32` to a `usize` and panic if the converted value doesn't fit
    |
 LL |     foo::<usize>(x_i32.try_into().unwrap());
@@ -79,8 +128,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:37:18
    |
 LL |     foo::<usize>(x_i16);
-   |                  ^^^^^ expected `usize`, found `i16`
+   |     ------------ ^^^^^ expected `usize`, found `i16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i16` to a `usize` and panic if the converted value doesn't fit
    |
 LL |     foo::<usize>(x_i16.try_into().unwrap());
@@ -90,8 +146,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:39:18
    |
 LL |     foo::<usize>(x_i8);
-   |                  ^^^^ expected `usize`, found `i8`
+   |     ------------ ^^^^ expected `usize`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i8` to a `usize` and panic if the converted value doesn't fit
    |
 LL |     foo::<usize>(x_i8.try_into().unwrap());
@@ -101,8 +164,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:44:18
    |
 LL |     foo::<isize>(x_usize);
-   |                  ^^^^^^^ expected `isize`, found `usize`
+   |     ------------ ^^^^^^^ expected `isize`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `usize` to an `isize` and panic if the converted value doesn't fit
    |
 LL |     foo::<isize>(x_usize.try_into().unwrap());
@@ -112,8 +182,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:46:18
    |
 LL |     foo::<isize>(x_u64);
-   |                  ^^^^^ expected `isize`, found `u64`
+   |     ------------ ^^^^^ expected `isize`, found `u64`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u64` to an `isize` and panic if the converted value doesn't fit
    |
 LL |     foo::<isize>(x_u64.try_into().unwrap());
@@ -123,8 +200,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:48:18
    |
 LL |     foo::<isize>(x_u32);
-   |                  ^^^^^ expected `isize`, found `u32`
+   |     ------------ ^^^^^ expected `isize`, found `u32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u32` to an `isize` and panic if the converted value doesn't fit
    |
 LL |     foo::<isize>(x_u32.try_into().unwrap());
@@ -134,8 +218,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:50:18
    |
 LL |     foo::<isize>(x_u16);
-   |                  ^^^^^ expected `isize`, found `u16`
+   |     ------------ ^^^^^ expected `isize`, found `u16`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u16` to an `isize` and panic if the converted value doesn't fit
    |
 LL |     foo::<isize>(x_u16.try_into().unwrap());
@@ -145,8 +236,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:52:18
    |
 LL |     foo::<isize>(x_u8);
-   |                  ^^^^ expected `isize`, found `u8`
+   |     ------------ ^^^^ expected `isize`, found `u8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u8` to an `isize`
    |
 LL |     foo::<isize>(x_u8.into());
@@ -156,8 +254,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:55:18
    |
 LL |     foo::<isize>(x_i64);
-   |                  ^^^^^ expected `isize`, found `i64`
+   |     ------------ ^^^^^ expected `isize`, found `i64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i64` to an `isize` and panic if the converted value doesn't fit
    |
 LL |     foo::<isize>(x_i64.try_into().unwrap());
@@ -167,8 +272,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:57:18
    |
 LL |     foo::<isize>(x_i32);
-   |                  ^^^^^ expected `isize`, found `i32`
+   |     ------------ ^^^^^ expected `isize`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i32` to an `isize` and panic if the converted value doesn't fit
    |
 LL |     foo::<isize>(x_i32.try_into().unwrap());
@@ -178,8 +290,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:59:18
    |
 LL |     foo::<isize>(x_i16);
-   |                  ^^^^^ expected `isize`, found `i16`
+   |     ------------ ^^^^^ expected `isize`, found `i16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i16` to an `isize`
    |
 LL |     foo::<isize>(x_i16.into());
@@ -189,8 +308,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:61:18
    |
 LL |     foo::<isize>(x_i8);
-   |                  ^^^^ expected `isize`, found `i8`
+   |     ------------ ^^^^ expected `isize`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i8` to an `isize`
    |
 LL |     foo::<isize>(x_i8.into());
@@ -200,8 +326,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:66:16
    |
 LL |     foo::<u64>(x_usize);
-   |                ^^^^^^^ expected `u64`, found `usize`
+   |     ---------- ^^^^^^^ expected `u64`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `usize` to a `u64` and panic if the converted value doesn't fit
    |
 LL |     foo::<u64>(x_usize.try_into().unwrap());
@@ -211,8 +344,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:69:16
    |
 LL |     foo::<u64>(x_u32);
-   |                ^^^^^ expected `u64`, found `u32`
+   |     ---------- ^^^^^ expected `u64`, found `u32`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u32` to a `u64`
    |
 LL |     foo::<u64>(x_u32.into());
@@ -222,8 +362,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:71:16
    |
 LL |     foo::<u64>(x_u16);
-   |                ^^^^^ expected `u64`, found `u16`
+   |     ---------- ^^^^^ expected `u64`, found `u16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u16` to a `u64`
    |
 LL |     foo::<u64>(x_u16.into());
@@ -233,8 +380,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:73:16
    |
 LL |     foo::<u64>(x_u8);
-   |                ^^^^ expected `u64`, found `u8`
+   |     ---------- ^^^^ expected `u64`, found `u8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u8` to a `u64`
    |
 LL |     foo::<u64>(x_u8.into());
@@ -244,8 +398,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:75:16
    |
 LL |     foo::<u64>(x_isize);
-   |                ^^^^^^^ expected `u64`, found `isize`
+   |     ---------- ^^^^^^^ expected `u64`, found `isize`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `isize` to a `u64` and panic if the converted value doesn't fit
    |
 LL |     foo::<u64>(x_isize.try_into().unwrap());
@@ -255,8 +416,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:77:16
    |
 LL |     foo::<u64>(x_i64);
-   |                ^^^^^ expected `u64`, found `i64`
+   |     ---------- ^^^^^ expected `u64`, found `i64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i64` to a `u64` and panic if the converted value doesn't fit
    |
 LL |     foo::<u64>(x_i64.try_into().unwrap());
@@ -266,8 +434,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:79:16
    |
 LL |     foo::<u64>(x_i32);
-   |                ^^^^^ expected `u64`, found `i32`
+   |     ---------- ^^^^^ expected `u64`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i32` to a `u64` and panic if the converted value doesn't fit
    |
 LL |     foo::<u64>(x_i32.try_into().unwrap());
@@ -277,8 +452,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:81:16
    |
 LL |     foo::<u64>(x_i16);
-   |                ^^^^^ expected `u64`, found `i16`
+   |     ---------- ^^^^^ expected `u64`, found `i16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i16` to a `u64` and panic if the converted value doesn't fit
    |
 LL |     foo::<u64>(x_i16.try_into().unwrap());
@@ -288,8 +470,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:83:16
    |
 LL |     foo::<u64>(x_i8);
-   |                ^^^^ expected `u64`, found `i8`
+   |     ---------- ^^^^ expected `u64`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i8` to a `u64` and panic if the converted value doesn't fit
    |
 LL |     foo::<u64>(x_i8.try_into().unwrap());
@@ -299,8 +488,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:88:16
    |
 LL |     foo::<i64>(x_usize);
-   |                ^^^^^^^ expected `i64`, found `usize`
+   |     ---------- ^^^^^^^ expected `i64`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `usize` to an `i64` and panic if the converted value doesn't fit
    |
 LL |     foo::<i64>(x_usize.try_into().unwrap());
@@ -310,8 +506,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:90:16
    |
 LL |     foo::<i64>(x_u64);
-   |                ^^^^^ expected `i64`, found `u64`
+   |     ---------- ^^^^^ expected `i64`, found `u64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u64` to an `i64` and panic if the converted value doesn't fit
    |
 LL |     foo::<i64>(x_u64.try_into().unwrap());
@@ -321,8 +524,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:92:16
    |
 LL |     foo::<i64>(x_u32);
-   |                ^^^^^ expected `i64`, found `u32`
+   |     ---------- ^^^^^ expected `i64`, found `u32`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u32` to an `i64`
    |
 LL |     foo::<i64>(x_u32.into());
@@ -332,8 +542,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:94:16
    |
 LL |     foo::<i64>(x_u16);
-   |                ^^^^^ expected `i64`, found `u16`
+   |     ---------- ^^^^^ expected `i64`, found `u16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u16` to an `i64`
    |
 LL |     foo::<i64>(x_u16.into());
@@ -343,8 +560,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:96:16
    |
 LL |     foo::<i64>(x_u8);
-   |                ^^^^ expected `i64`, found `u8`
+   |     ---------- ^^^^ expected `i64`, found `u8`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u8` to an `i64`
    |
 LL |     foo::<i64>(x_u8.into());
@@ -354,8 +578,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:98:16
    |
 LL |     foo::<i64>(x_isize);
-   |                ^^^^^^^ expected `i64`, found `isize`
+   |     ---------- ^^^^^^^ expected `i64`, found `isize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `isize` to an `i64` and panic if the converted value doesn't fit
    |
 LL |     foo::<i64>(x_isize.try_into().unwrap());
@@ -365,8 +596,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:101:16
    |
 LL |     foo::<i64>(x_i32);
-   |                ^^^^^ expected `i64`, found `i32`
+   |     ---------- ^^^^^ expected `i64`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i32` to an `i64`
    |
 LL |     foo::<i64>(x_i32.into());
@@ -376,8 +614,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:103:16
    |
 LL |     foo::<i64>(x_i16);
-   |                ^^^^^ expected `i64`, found `i16`
+   |     ---------- ^^^^^ expected `i64`, found `i16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i16` to an `i64`
    |
 LL |     foo::<i64>(x_i16.into());
@@ -387,8 +632,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:105:16
    |
 LL |     foo::<i64>(x_i8);
-   |                ^^^^ expected `i64`, found `i8`
+   |     ---------- ^^^^ expected `i64`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i8` to an `i64`
    |
 LL |     foo::<i64>(x_i8.into());
@@ -398,8 +650,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:110:16
    |
 LL |     foo::<u32>(x_usize);
-   |                ^^^^^^^ expected `u32`, found `usize`
+   |     ---------- ^^^^^^^ expected `u32`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `usize` to a `u32` and panic if the converted value doesn't fit
    |
 LL |     foo::<u32>(x_usize.try_into().unwrap());
@@ -409,8 +668,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:112:16
    |
 LL |     foo::<u32>(x_u64);
-   |                ^^^^^ expected `u32`, found `u64`
+   |     ---------- ^^^^^ expected `u32`, found `u64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u64` to a `u32` and panic if the converted value doesn't fit
    |
 LL |     foo::<u32>(x_u64.try_into().unwrap());
@@ -420,8 +686,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:115:16
    |
 LL |     foo::<u32>(x_u16);
-   |                ^^^^^ expected `u32`, found `u16`
+   |     ---------- ^^^^^ expected `u32`, found `u16`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u16` to a `u32`
    |
 LL |     foo::<u32>(x_u16.into());
@@ -431,8 +704,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:117:16
    |
 LL |     foo::<u32>(x_u8);
-   |                ^^^^ expected `u32`, found `u8`
+   |     ---------- ^^^^ expected `u32`, found `u8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u8` to a `u32`
    |
 LL |     foo::<u32>(x_u8.into());
@@ -442,8 +722,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:119:16
    |
 LL |     foo::<u32>(x_isize);
-   |                ^^^^^^^ expected `u32`, found `isize`
+   |     ---------- ^^^^^^^ expected `u32`, found `isize`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `isize` to a `u32` and panic if the converted value doesn't fit
    |
 LL |     foo::<u32>(x_isize.try_into().unwrap());
@@ -453,8 +740,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:121:16
    |
 LL |     foo::<u32>(x_i64);
-   |                ^^^^^ expected `u32`, found `i64`
+   |     ---------- ^^^^^ expected `u32`, found `i64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i64` to a `u32` and panic if the converted value doesn't fit
    |
 LL |     foo::<u32>(x_i64.try_into().unwrap());
@@ -464,8 +758,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:123:16
    |
 LL |     foo::<u32>(x_i32);
-   |                ^^^^^ expected `u32`, found `i32`
+   |     ---------- ^^^^^ expected `u32`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i32` to a `u32` and panic if the converted value doesn't fit
    |
 LL |     foo::<u32>(x_i32.try_into().unwrap());
@@ -475,8 +776,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:125:16
    |
 LL |     foo::<u32>(x_i16);
-   |                ^^^^^ expected `u32`, found `i16`
+   |     ---------- ^^^^^ expected `u32`, found `i16`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i16` to a `u32` and panic if the converted value doesn't fit
    |
 LL |     foo::<u32>(x_i16.try_into().unwrap());
@@ -486,8 +794,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:127:16
    |
 LL |     foo::<u32>(x_i8);
-   |                ^^^^ expected `u32`, found `i8`
+   |     ---------- ^^^^ expected `u32`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i8` to a `u32` and panic if the converted value doesn't fit
    |
 LL |     foo::<u32>(x_i8.try_into().unwrap());
@@ -497,8 +812,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:132:16
    |
 LL |     foo::<i32>(x_usize);
-   |                ^^^^^^^ expected `i32`, found `usize`
+   |     ---------- ^^^^^^^ expected `i32`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `usize` to an `i32` and panic if the converted value doesn't fit
    |
 LL |     foo::<i32>(x_usize.try_into().unwrap());
@@ -508,8 +830,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:134:16
    |
 LL |     foo::<i32>(x_u64);
-   |                ^^^^^ expected `i32`, found `u64`
+   |     ---------- ^^^^^ expected `i32`, found `u64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u64` to an `i32` and panic if the converted value doesn't fit
    |
 LL |     foo::<i32>(x_u64.try_into().unwrap());
@@ -519,8 +848,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:136:16
    |
 LL |     foo::<i32>(x_u32);
-   |                ^^^^^ expected `i32`, found `u32`
+   |     ---------- ^^^^^ expected `i32`, found `u32`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u32` to an `i32` and panic if the converted value doesn't fit
    |
 LL |     foo::<i32>(x_u32.try_into().unwrap());
@@ -530,8 +866,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:138:16
    |
 LL |     foo::<i32>(x_u16);
-   |                ^^^^^ expected `i32`, found `u16`
+   |     ---------- ^^^^^ expected `i32`, found `u16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u16` to an `i32`
    |
 LL |     foo::<i32>(x_u16.into());
@@ -541,8 +884,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:140:16
    |
 LL |     foo::<i32>(x_u8);
-   |                ^^^^ expected `i32`, found `u8`
+   |     ---------- ^^^^ expected `i32`, found `u8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u8` to an `i32`
    |
 LL |     foo::<i32>(x_u8.into());
@@ -552,8 +902,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:142:16
    |
 LL |     foo::<i32>(x_isize);
-   |                ^^^^^^^ expected `i32`, found `isize`
+   |     ---------- ^^^^^^^ expected `i32`, found `isize`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `isize` to an `i32` and panic if the converted value doesn't fit
    |
 LL |     foo::<i32>(x_isize.try_into().unwrap());
@@ -563,8 +920,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:144:16
    |
 LL |     foo::<i32>(x_i64);
-   |                ^^^^^ expected `i32`, found `i64`
+   |     ---------- ^^^^^ expected `i32`, found `i64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i64` to an `i32` and panic if the converted value doesn't fit
    |
 LL |     foo::<i32>(x_i64.try_into().unwrap());
@@ -574,8 +938,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:147:16
    |
 LL |     foo::<i32>(x_i16);
-   |                ^^^^^ expected `i32`, found `i16`
+   |     ---------- ^^^^^ expected `i32`, found `i16`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i16` to an `i32`
    |
 LL |     foo::<i32>(x_i16.into());
@@ -585,8 +956,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:149:16
    |
 LL |     foo::<i32>(x_i8);
-   |                ^^^^ expected `i32`, found `i8`
+   |     ---------- ^^^^ expected `i32`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i8` to an `i32`
    |
 LL |     foo::<i32>(x_i8.into());
@@ -596,8 +974,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:154:16
    |
 LL |     foo::<u16>(x_usize);
-   |                ^^^^^^^ expected `u16`, found `usize`
+   |     ---------- ^^^^^^^ expected `u16`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `usize` to a `u16` and panic if the converted value doesn't fit
    |
 LL |     foo::<u16>(x_usize.try_into().unwrap());
@@ -607,8 +992,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:156:16
    |
 LL |     foo::<u16>(x_u64);
-   |                ^^^^^ expected `u16`, found `u64`
+   |     ---------- ^^^^^ expected `u16`, found `u64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u64` to a `u16` and panic if the converted value doesn't fit
    |
 LL |     foo::<u16>(x_u64.try_into().unwrap());
@@ -618,8 +1010,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:158:16
    |
 LL |     foo::<u16>(x_u32);
-   |                ^^^^^ expected `u16`, found `u32`
+   |     ---------- ^^^^^ expected `u16`, found `u32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u32` to a `u16` and panic if the converted value doesn't fit
    |
 LL |     foo::<u16>(x_u32.try_into().unwrap());
@@ -629,8 +1028,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:161:16
    |
 LL |     foo::<u16>(x_u8);
-   |                ^^^^ expected `u16`, found `u8`
+   |     ---------- ^^^^ expected `u16`, found `u8`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u8` to a `u16`
    |
 LL |     foo::<u16>(x_u8.into());
@@ -640,8 +1046,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:163:16
    |
 LL |     foo::<u16>(x_isize);
-   |                ^^^^^^^ expected `u16`, found `isize`
+   |     ---------- ^^^^^^^ expected `u16`, found `isize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `isize` to a `u16` and panic if the converted value doesn't fit
    |
 LL |     foo::<u16>(x_isize.try_into().unwrap());
@@ -651,8 +1064,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:165:16
    |
 LL |     foo::<u16>(x_i64);
-   |                ^^^^^ expected `u16`, found `i64`
+   |     ---------- ^^^^^ expected `u16`, found `i64`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i64` to a `u16` and panic if the converted value doesn't fit
    |
 LL |     foo::<u16>(x_i64.try_into().unwrap());
@@ -662,8 +1082,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:167:16
    |
 LL |     foo::<u16>(x_i32);
-   |                ^^^^^ expected `u16`, found `i32`
+   |     ---------- ^^^^^ expected `u16`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i32` to a `u16` and panic if the converted value doesn't fit
    |
 LL |     foo::<u16>(x_i32.try_into().unwrap());
@@ -673,8 +1100,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:169:16
    |
 LL |     foo::<u16>(x_i16);
-   |                ^^^^^ expected `u16`, found `i16`
+   |     ---------- ^^^^^ expected `u16`, found `i16`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i16` to a `u16` and panic if the converted value doesn't fit
    |
 LL |     foo::<u16>(x_i16.try_into().unwrap());
@@ -684,8 +1118,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:171:16
    |
 LL |     foo::<u16>(x_i8);
-   |                ^^^^ expected `u16`, found `i8`
+   |     ---------- ^^^^ expected `u16`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i8` to a `u16` and panic if the converted value doesn't fit
    |
 LL |     foo::<u16>(x_i8.try_into().unwrap());
@@ -695,8 +1136,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:176:16
    |
 LL |     foo::<i16>(x_usize);
-   |                ^^^^^^^ expected `i16`, found `usize`
+   |     ---------- ^^^^^^^ expected `i16`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `usize` to an `i16` and panic if the converted value doesn't fit
    |
 LL |     foo::<i16>(x_usize.try_into().unwrap());
@@ -706,8 +1154,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:178:16
    |
 LL |     foo::<i16>(x_u64);
-   |                ^^^^^ expected `i16`, found `u64`
+   |     ---------- ^^^^^ expected `i16`, found `u64`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u64` to an `i16` and panic if the converted value doesn't fit
    |
 LL |     foo::<i16>(x_u64.try_into().unwrap());
@@ -717,8 +1172,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:180:16
    |
 LL |     foo::<i16>(x_u32);
-   |                ^^^^^ expected `i16`, found `u32`
+   |     ---------- ^^^^^ expected `i16`, found `u32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u32` to an `i16` and panic if the converted value doesn't fit
    |
 LL |     foo::<i16>(x_u32.try_into().unwrap());
@@ -728,8 +1190,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:182:16
    |
 LL |     foo::<i16>(x_u16);
-   |                ^^^^^ expected `i16`, found `u16`
+   |     ---------- ^^^^^ expected `i16`, found `u16`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u16` to an `i16` and panic if the converted value doesn't fit
    |
 LL |     foo::<i16>(x_u16.try_into().unwrap());
@@ -739,8 +1208,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:184:16
    |
 LL |     foo::<i16>(x_u8);
-   |                ^^^^ expected `i16`, found `u8`
+   |     ---------- ^^^^ expected `i16`, found `u8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u8` to an `i16`
    |
 LL |     foo::<i16>(x_u8.into());
@@ -750,8 +1226,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:186:16
    |
 LL |     foo::<i16>(x_isize);
-   |                ^^^^^^^ expected `i16`, found `isize`
+   |     ---------- ^^^^^^^ expected `i16`, found `isize`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `isize` to an `i16` and panic if the converted value doesn't fit
    |
 LL |     foo::<i16>(x_isize.try_into().unwrap());
@@ -761,8 +1244,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:188:16
    |
 LL |     foo::<i16>(x_i64);
-   |                ^^^^^ expected `i16`, found `i64`
+   |     ---------- ^^^^^ expected `i16`, found `i64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i64` to an `i16` and panic if the converted value doesn't fit
    |
 LL |     foo::<i16>(x_i64.try_into().unwrap());
@@ -772,8 +1262,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:190:16
    |
 LL |     foo::<i16>(x_i32);
-   |                ^^^^^ expected `i16`, found `i32`
+   |     ---------- ^^^^^ expected `i16`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i32` to an `i16` and panic if the converted value doesn't fit
    |
 LL |     foo::<i16>(x_i32.try_into().unwrap());
@@ -783,8 +1280,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:193:16
    |
 LL |     foo::<i16>(x_i8);
-   |                ^^^^ expected `i16`, found `i8`
+   |     ---------- ^^^^ expected `i16`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i8` to an `i16`
    |
 LL |     foo::<i16>(x_i8.into());
@@ -794,8 +1298,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:198:15
    |
 LL |     foo::<u8>(x_usize);
-   |               ^^^^^^^ expected `u8`, found `usize`
+   |     --------- ^^^^^^^ expected `u8`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `usize` to a `u8` and panic if the converted value doesn't fit
    |
 LL |     foo::<u8>(x_usize.try_into().unwrap());
@@ -805,8 +1316,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:200:15
    |
 LL |     foo::<u8>(x_u64);
-   |               ^^^^^ expected `u8`, found `u64`
+   |     --------- ^^^^^ expected `u8`, found `u64`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u64` to a `u8` and panic if the converted value doesn't fit
    |
 LL |     foo::<u8>(x_u64.try_into().unwrap());
@@ -816,8 +1334,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:202:15
    |
 LL |     foo::<u8>(x_u32);
-   |               ^^^^^ expected `u8`, found `u32`
+   |     --------- ^^^^^ expected `u8`, found `u32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u32` to a `u8` and panic if the converted value doesn't fit
    |
 LL |     foo::<u8>(x_u32.try_into().unwrap());
@@ -827,8 +1352,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:204:15
    |
 LL |     foo::<u8>(x_u16);
-   |               ^^^^^ expected `u8`, found `u16`
+   |     --------- ^^^^^ expected `u8`, found `u16`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u16` to a `u8` and panic if the converted value doesn't fit
    |
 LL |     foo::<u8>(x_u16.try_into().unwrap());
@@ -838,8 +1370,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:207:15
    |
 LL |     foo::<u8>(x_isize);
-   |               ^^^^^^^ expected `u8`, found `isize`
+   |     --------- ^^^^^^^ expected `u8`, found `isize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `isize` to a `u8` and panic if the converted value doesn't fit
    |
 LL |     foo::<u8>(x_isize.try_into().unwrap());
@@ -849,8 +1388,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:209:15
    |
 LL |     foo::<u8>(x_i64);
-   |               ^^^^^ expected `u8`, found `i64`
+   |     --------- ^^^^^ expected `u8`, found `i64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i64` to a `u8` and panic if the converted value doesn't fit
    |
 LL |     foo::<u8>(x_i64.try_into().unwrap());
@@ -860,8 +1406,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:211:15
    |
 LL |     foo::<u8>(x_i32);
-   |               ^^^^^ expected `u8`, found `i32`
+   |     --------- ^^^^^ expected `u8`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i32` to a `u8` and panic if the converted value doesn't fit
    |
 LL |     foo::<u8>(x_i32.try_into().unwrap());
@@ -871,8 +1424,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:213:15
    |
 LL |     foo::<u8>(x_i16);
-   |               ^^^^^ expected `u8`, found `i16`
+   |     --------- ^^^^^ expected `u8`, found `i16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i16` to a `u8` and panic if the converted value doesn't fit
    |
 LL |     foo::<u8>(x_i16.try_into().unwrap());
@@ -882,8 +1442,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:215:15
    |
 LL |     foo::<u8>(x_i8);
-   |               ^^^^ expected `u8`, found `i8`
+   |     --------- ^^^^ expected `u8`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i8` to a `u8` and panic if the converted value doesn't fit
    |
 LL |     foo::<u8>(x_i8.try_into().unwrap());
@@ -893,8 +1460,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:220:15
    |
 LL |     foo::<i8>(x_usize);
-   |               ^^^^^^^ expected `i8`, found `usize`
+   |     --------- ^^^^^^^ expected `i8`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `usize` to an `i8` and panic if the converted value doesn't fit
    |
 LL |     foo::<i8>(x_usize.try_into().unwrap());
@@ -904,8 +1478,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:222:15
    |
 LL |     foo::<i8>(x_u64);
-   |               ^^^^^ expected `i8`, found `u64`
+   |     --------- ^^^^^ expected `i8`, found `u64`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u64` to an `i8` and panic if the converted value doesn't fit
    |
 LL |     foo::<i8>(x_u64.try_into().unwrap());
@@ -915,8 +1496,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:224:15
    |
 LL |     foo::<i8>(x_u32);
-   |               ^^^^^ expected `i8`, found `u32`
+   |     --------- ^^^^^ expected `i8`, found `u32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u32` to an `i8` and panic if the converted value doesn't fit
    |
 LL |     foo::<i8>(x_u32.try_into().unwrap());
@@ -926,8 +1514,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:226:15
    |
 LL |     foo::<i8>(x_u16);
-   |               ^^^^^ expected `i8`, found `u16`
+   |     --------- ^^^^^ expected `i8`, found `u16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u16` to an `i8` and panic if the converted value doesn't fit
    |
 LL |     foo::<i8>(x_u16.try_into().unwrap());
@@ -937,8 +1532,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:228:15
    |
 LL |     foo::<i8>(x_u8);
-   |               ^^^^ expected `i8`, found `u8`
+   |     --------- ^^^^ expected `i8`, found `u8`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u8` to an `i8` and panic if the converted value doesn't fit
    |
 LL |     foo::<i8>(x_u8.try_into().unwrap());
@@ -948,8 +1550,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:230:15
    |
 LL |     foo::<i8>(x_isize);
-   |               ^^^^^^^ expected `i8`, found `isize`
+   |     --------- ^^^^^^^ expected `i8`, found `isize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `isize` to an `i8` and panic if the converted value doesn't fit
    |
 LL |     foo::<i8>(x_isize.try_into().unwrap());
@@ -959,8 +1568,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:232:15
    |
 LL |     foo::<i8>(x_i64);
-   |               ^^^^^ expected `i8`, found `i64`
+   |     --------- ^^^^^ expected `i8`, found `i64`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i64` to an `i8` and panic if the converted value doesn't fit
    |
 LL |     foo::<i8>(x_i64.try_into().unwrap());
@@ -970,8 +1586,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:234:15
    |
 LL |     foo::<i8>(x_i32);
-   |               ^^^^^ expected `i8`, found `i32`
+   |     --------- ^^^^^ expected `i8`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i32` to an `i8` and panic if the converted value doesn't fit
    |
 LL |     foo::<i8>(x_i32.try_into().unwrap());
@@ -981,8 +1604,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:236:15
    |
 LL |     foo::<i8>(x_i16);
-   |               ^^^^^ expected `i8`, found `i16`
+   |     --------- ^^^^^ expected `i8`, found `i16`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i16` to an `i8` and panic if the converted value doesn't fit
    |
 LL |     foo::<i8>(x_i16.try_into().unwrap());
@@ -992,8 +1622,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:242:16
    |
 LL |     foo::<f64>(x_usize);
-   |                ^^^^^^^ expected `f64`, found `usize`
+   |     ---------- ^^^^^^^ expected `f64`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can cast a `usize` to an `f64`, producing the floating point representation of the integer, rounded if necessary
    |
 LL |     foo::<f64>(x_usize as f64);
@@ -1003,8 +1640,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:244:16
    |
 LL |     foo::<f64>(x_u64);
-   |                ^^^^^ expected `f64`, found `u64`
+   |     ---------- ^^^^^ expected `f64`, found `u64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can cast a `u64` to an `f64`, producing the floating point representation of the integer, rounded if necessary
    |
 LL |     foo::<f64>(x_u64 as f64);
@@ -1014,8 +1658,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:246:16
    |
 LL |     foo::<f64>(x_u32);
-   |                ^^^^^ expected `f64`, found `u32`
+   |     ---------- ^^^^^ expected `f64`, found `u32`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u32` to an `f64`, producing the floating point representation of the integer
    |
 LL |     foo::<f64>(x_u32.into());
@@ -1025,8 +1676,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:248:16
    |
 LL |     foo::<f64>(x_u16);
-   |                ^^^^^ expected `f64`, found `u16`
+   |     ---------- ^^^^^ expected `f64`, found `u16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u16` to an `f64`, producing the floating point representation of the integer
    |
 LL |     foo::<f64>(x_u16.into());
@@ -1036,8 +1694,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:250:16
    |
 LL |     foo::<f64>(x_u8);
-   |                ^^^^ expected `f64`, found `u8`
+   |     ---------- ^^^^ expected `f64`, found `u8`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u8` to an `f64`, producing the floating point representation of the integer
    |
 LL |     foo::<f64>(x_u8.into());
@@ -1047,8 +1712,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:252:16
    |
 LL |     foo::<f64>(x_isize);
-   |                ^^^^^^^ expected `f64`, found `isize`
+   |     ---------- ^^^^^^^ expected `f64`, found `isize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `isize` to an `f64`, producing the floating point representation of the integer, rounded if necessary
    |
 LL |     foo::<f64>(x_isize as f64);
@@ -1058,8 +1730,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:254:16
    |
 LL |     foo::<f64>(x_i64);
-   |                ^^^^^ expected `f64`, found `i64`
+   |     ---------- ^^^^^ expected `f64`, found `i64`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i64` to an `f64`, producing the floating point representation of the integer, rounded if necessary
    |
 LL |     foo::<f64>(x_i64 as f64);
@@ -1069,8 +1748,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:256:16
    |
 LL |     foo::<f64>(x_i32);
-   |                ^^^^^ expected `f64`, found `i32`
+   |     ---------- ^^^^^ expected `f64`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i32` to an `f64`, producing the floating point representation of the integer
    |
 LL |     foo::<f64>(x_i32.into());
@@ -1080,8 +1766,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:258:16
    |
 LL |     foo::<f64>(x_i16);
-   |                ^^^^^ expected `f64`, found `i16`
+   |     ---------- ^^^^^ expected `f64`, found `i16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i16` to an `f64`, producing the floating point representation of the integer
    |
 LL |     foo::<f64>(x_i16.into());
@@ -1091,8 +1784,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:260:16
    |
 LL |     foo::<f64>(x_i8);
-   |                ^^^^ expected `f64`, found `i8`
+   |     ---------- ^^^^ expected `f64`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i8` to an `f64`, producing the floating point representation of the integer
    |
 LL |     foo::<f64>(x_i8.into());
@@ -1102,8 +1802,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:263:16
    |
 LL |     foo::<f64>(x_f32);
-   |                ^^^^^ expected `f64`, found `f32`
+   |     ---------- ^^^^^ expected `f64`, found `f32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `f32` to an `f64`
    |
 LL |     foo::<f64>(x_f32.into());
@@ -1113,8 +1820,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:266:16
    |
 LL |     foo::<f32>(x_usize);
-   |                ^^^^^^^ expected `f32`, found `usize`
+   |     ---------- ^^^^^^^ expected `f32`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can cast a `usize` to an `f32`, producing the floating point representation of the integer, rounded if necessary
    |
 LL |     foo::<f32>(x_usize as f32);
@@ -1124,8 +1838,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:268:16
    |
 LL |     foo::<f32>(x_u64);
-   |                ^^^^^ expected `f32`, found `u64`
+   |     ---------- ^^^^^ expected `f32`, found `u64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can cast a `u64` to an `f32`, producing the floating point representation of the integer, rounded if necessary
    |
 LL |     foo::<f32>(x_u64 as f32);
@@ -1135,8 +1856,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:270:16
    |
 LL |     foo::<f32>(x_u32);
-   |                ^^^^^ expected `f32`, found `u32`
+   |     ---------- ^^^^^ expected `f32`, found `u32`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can cast a `u32` to an `f32`, producing the floating point representation of the integer, rounded if necessary
    |
 LL |     foo::<f32>(x_u32 as f32);
@@ -1146,8 +1874,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:272:16
    |
 LL |     foo::<f32>(x_u16);
-   |                ^^^^^ expected `f32`, found `u16`
+   |     ---------- ^^^^^ expected `f32`, found `u16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u16` to an `f32`, producing the floating point representation of the integer
    |
 LL |     foo::<f32>(x_u16.into());
@@ -1157,8 +1892,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:274:16
    |
 LL |     foo::<f32>(x_u8);
-   |                ^^^^ expected `f32`, found `u8`
+   |     ---------- ^^^^ expected `f32`, found `u8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u8` to an `f32`, producing the floating point representation of the integer
    |
 LL |     foo::<f32>(x_u8.into());
@@ -1168,8 +1910,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:276:16
    |
 LL |     foo::<f32>(x_isize);
-   |                ^^^^^^^ expected `f32`, found `isize`
+   |     ---------- ^^^^^^^ expected `f32`, found `isize`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `isize` to an `f32`, producing the floating point representation of the integer, rounded if necessary
    |
 LL |     foo::<f32>(x_isize as f32);
@@ -1179,8 +1928,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:278:16
    |
 LL |     foo::<f32>(x_i64);
-   |                ^^^^^ expected `f32`, found `i64`
+   |     ---------- ^^^^^ expected `f32`, found `i64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i64` to an `f32`, producing the floating point representation of the integer, rounded if necessary
    |
 LL |     foo::<f32>(x_i64 as f32);
@@ -1190,8 +1946,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:280:16
    |
 LL |     foo::<f32>(x_i32);
-   |                ^^^^^ expected `f32`, found `i32`
+   |     ---------- ^^^^^ expected `f32`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i32` to an `f32`, producing the floating point representation of the integer, rounded if necessary
    |
 LL |     foo::<f32>(x_i32 as f32);
@@ -1201,8 +1964,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:282:16
    |
 LL |     foo::<f32>(x_i16);
-   |                ^^^^^ expected `f32`, found `i16`
+   |     ---------- ^^^^^ expected `f32`, found `i16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i16` to an `f32`, producing the floating point representation of the integer
    |
 LL |     foo::<f32>(x_i16.into());
@@ -1212,8 +1982,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:284:16
    |
 LL |     foo::<f32>(x_i8);
-   |                ^^^^ expected `f32`, found `i8`
+   |     ---------- ^^^^ expected `f32`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i8` to an `f32`, producing the floating point representation of the integer
    |
 LL |     foo::<f32>(x_i8.into());
@@ -1223,8 +2000,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:289:16
    |
 LL |     foo::<u32>(x_u8 as u16);
-   |                ^^^^^^^^^^^ expected `u32`, found `u16`
+   |     ---------- ^^^^^^^^^^^ expected `u32`, found `u16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert a `u16` to a `u32`
    |
 LL |     foo::<u32>((x_u8 as u16).into());
@@ -1234,8 +2018,15 @@ error[E0308]: mismatched types
   --> $DIR/numeric-cast.rs:291:16
    |
 LL |     foo::<i32>(-x_i8);
-   |                ^^^^^ expected `i32`, found `i8`
+   |     ---------- ^^^^^ expected `i32`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-cast.rs:6:4
    |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
 help: you can convert an `i8` to an `i32`
    |
 LL |     foo::<i32>((-x_i8).into());
diff --git a/src/test/ui/numeric/numeric-suffix.fixed b/src/test/ui/numeric/numeric-suffix.fixed
deleted file mode 100644 (file)
index 53c5fe0..0000000
+++ /dev/null
@@ -1,298 +0,0 @@
-// run-rustfix
-
-fn foo<N>(_x: N) {}
-
-fn main() {
-    foo::<usize>(42_usize);
-    foo::<usize>(42_usize);
-    //~^ ERROR mismatched types
-    foo::<usize>(42_usize);
-    //~^ ERROR mismatched types
-    foo::<usize>(42_usize);
-    //~^ ERROR mismatched types
-    foo::<usize>(42_usize);
-    //~^ ERROR mismatched types
-    foo::<usize>(42_usize);
-    //~^ ERROR mismatched types
-    foo::<usize>(42_usize);
-    //~^ ERROR mismatched types
-    foo::<usize>(42_usize);
-    //~^ ERROR mismatched types
-    foo::<usize>(42_usize);
-    //~^ ERROR mismatched types
-    foo::<usize>(42_usize);
-    //~^ ERROR mismatched types
-    foo::<usize>(42usize);
-    //~^ ERROR mismatched types
-    foo::<usize>(42usize);
-    //~^ ERROR mismatched types
-
-    foo::<isize>(42_isize);
-    //~^ ERROR mismatched types
-    foo::<isize>(42_isize);
-    //~^ ERROR mismatched types
-    foo::<isize>(42_isize);
-    //~^ ERROR mismatched types
-    foo::<isize>(42_isize);
-    //~^ ERROR mismatched types
-    foo::<isize>(42_isize);
-    //~^ ERROR mismatched types
-    foo::<isize>(42_isize);
-    foo::<isize>(42_isize);
-    //~^ ERROR mismatched types
-    foo::<isize>(42_isize);
-    //~^ ERROR mismatched types
-    foo::<isize>(42_isize);
-    //~^ ERROR mismatched types
-    foo::<isize>(42_isize);
-    //~^ ERROR mismatched types
-    foo::<isize>(42isize);
-    //~^ ERROR mismatched types
-    foo::<isize>(42isize);
-    //~^ ERROR mismatched types
-
-    foo::<u64>(42_u64);
-    //~^ ERROR mismatched types
-    foo::<u64>(42_u64);
-    foo::<u64>(42_u64);
-    //~^ ERROR mismatched types
-    foo::<u64>(42_u64);
-    //~^ ERROR mismatched types
-    foo::<u64>(42_u64);
-    //~^ ERROR mismatched types
-    foo::<u64>(42_u64);
-    //~^ ERROR mismatched types
-    foo::<u64>(42_u64);
-    //~^ ERROR mismatched types
-    foo::<u64>(42_u64);
-    //~^ ERROR mismatched types
-    foo::<u64>(42_u64);
-    //~^ ERROR mismatched types
-    foo::<u64>(42_u64);
-    //~^ ERROR mismatched types
-    foo::<u64>(42u64);
-    //~^ ERROR mismatched types
-    foo::<u64>(42u64);
-    //~^ ERROR mismatched types
-
-    foo::<i64>(42_i64);
-    //~^ ERROR mismatched types
-    foo::<i64>(42_i64);
-    //~^ ERROR mismatched types
-    foo::<i64>(42_i64);
-    //~^ ERROR mismatched types
-    foo::<i64>(42_i64);
-    //~^ ERROR mismatched types
-    foo::<i64>(42_i64);
-    //~^ ERROR mismatched types
-    foo::<i64>(42_i64);
-    //~^ ERROR mismatched types
-    foo::<i64>(42_i64);
-    foo::<i64>(42_i64);
-    //~^ ERROR mismatched types
-    foo::<i64>(42_i64);
-    //~^ ERROR mismatched types
-    foo::<i64>(42_i64);
-    //~^ ERROR mismatched types
-    foo::<i64>(42i64);
-    //~^ ERROR mismatched types
-    foo::<i64>(42i64);
-    //~^ ERROR mismatched types
-
-    foo::<u32>(42_u32);
-    //~^ ERROR mismatched types
-    foo::<u32>(42_u32);
-    //~^ ERROR mismatched types
-    foo::<u32>(42_u32);
-    foo::<u32>(42_u32);
-    //~^ ERROR mismatched types
-    foo::<u32>(42_u32);
-    //~^ ERROR mismatched types
-    foo::<u32>(42_u32);
-    //~^ ERROR mismatched types
-    foo::<u32>(42_u32);
-    //~^ ERROR mismatched types
-    foo::<u32>(42_u32);
-    //~^ ERROR mismatched types
-    foo::<u32>(42_u32);
-    //~^ ERROR mismatched types
-    foo::<u32>(42_u32);
-    //~^ ERROR mismatched types
-    foo::<u32>(42u32);
-    //~^ ERROR mismatched types
-    foo::<u32>(42u32);
-    //~^ ERROR mismatched types
-
-    foo::<i32>(42_i32);
-    //~^ ERROR mismatched types
-    foo::<i32>(42_i32);
-    //~^ ERROR mismatched types
-    foo::<i32>(42_i32);
-    //~^ ERROR mismatched types
-    foo::<i32>(42_i32);
-    //~^ ERROR mismatched types
-    foo::<i32>(42_i32);
-    //~^ ERROR mismatched types
-    foo::<i32>(42_i32);
-    //~^ ERROR mismatched types
-    foo::<i32>(42_i32);
-    //~^ ERROR mismatched types
-    foo::<i32>(42_i32);
-    foo::<i32>(42_i32);
-    //~^ ERROR mismatched types
-    foo::<i32>(42_i32);
-    //~^ ERROR mismatched types
-    foo::<i32>(42i32);
-    //~^ ERROR mismatched types
-    foo::<i32>(42i32);
-    //~^ ERROR mismatched types
-
-    foo::<u16>(42_u16);
-    //~^ ERROR mismatched types
-    foo::<u16>(42_u16);
-    //~^ ERROR mismatched types
-    foo::<u16>(42_u16);
-    //~^ ERROR mismatched types
-    foo::<u16>(42_u16);
-    foo::<u16>(42_u16);
-    //~^ ERROR mismatched types
-    foo::<u16>(42_u16);
-    //~^ ERROR mismatched types
-    foo::<u16>(42_u16);
-    //~^ ERROR mismatched types
-    foo::<u16>(42_u16);
-    //~^ ERROR mismatched types
-    foo::<u16>(42_u16);
-    //~^ ERROR mismatched types
-    foo::<u16>(42_u16);
-    //~^ ERROR mismatched types
-    foo::<u16>(42u16);
-    //~^ ERROR mismatched types
-    foo::<u16>(42u16);
-    //~^ ERROR mismatched types
-
-    foo::<i16>(42_i16);
-    //~^ ERROR mismatched types
-    foo::<i16>(42_i16);
-    //~^ ERROR mismatched types
-    foo::<i16>(42_i16);
-    //~^ ERROR mismatched types
-    foo::<i16>(42_i16);
-    //~^ ERROR mismatched types
-    foo::<i16>(42_i16);
-    //~^ ERROR mismatched types
-    foo::<i16>(42_i16);
-    //~^ ERROR mismatched types
-    foo::<i16>(42_i16);
-    //~^ ERROR mismatched types
-    foo::<i16>(42_i16);
-    //~^ ERROR mismatched types
-    foo::<i16>(42_i16);
-    foo::<i16>(42_i16);
-    //~^ ERROR mismatched types
-    foo::<i16>(42i16);
-    //~^ ERROR mismatched types
-    foo::<i16>(42i16);
-    //~^ ERROR mismatched types
-
-    foo::<u8>(42_u8);
-    //~^ ERROR mismatched types
-    foo::<u8>(42_u8);
-    //~^ ERROR mismatched types
-    foo::<u8>(42_u8);
-    //~^ ERROR mismatched types
-    foo::<u8>(42_u8);
-    //~^ ERROR mismatched types
-    foo::<u8>(42_u8);
-    foo::<u8>(42_u8);
-    //~^ ERROR mismatched types
-    foo::<u8>(42_u8);
-    //~^ ERROR mismatched types
-    foo::<u8>(42_u8);
-    //~^ ERROR mismatched types
-    foo::<u8>(42_u8);
-    //~^ ERROR mismatched types
-    foo::<u8>(42_u8);
-    //~^ ERROR mismatched types
-    foo::<u8>(42u8);
-    //~^ ERROR mismatched types
-    foo::<u8>(42u8);
-    //~^ ERROR mismatched types
-
-    foo::<i8>(42_i8);
-    //~^ ERROR mismatched types
-    foo::<i8>(42_i8);
-    //~^ ERROR mismatched types
-    foo::<i8>(42_i8);
-    //~^ ERROR mismatched types
-    foo::<i8>(42_i8);
-    //~^ ERROR mismatched types
-    foo::<i8>(42_i8);
-    //~^ ERROR mismatched types
-    foo::<i8>(42_i8);
-    //~^ ERROR mismatched types
-    foo::<i8>(42_i8);
-    //~^ ERROR mismatched types
-    foo::<i8>(42_i8);
-    //~^ ERROR mismatched types
-    foo::<i8>(42_i8);
-    //~^ ERROR mismatched types
-    foo::<i8>(42_i8);
-    foo::<i8>(42i8);
-    //~^ ERROR mismatched types
-    foo::<i8>(42i8);
-    //~^ ERROR mismatched types
-
-    foo::<f64>(42_f64);
-    //~^ ERROR mismatched types
-    foo::<f64>(42_f64);
-    //~^ ERROR mismatched types
-    foo::<f64>(42_u32.into());
-    //~^ ERROR mismatched types
-    foo::<f64>(42_u16.into());
-    //~^ ERROR mismatched types
-    foo::<f64>(42_u8.into());
-    //~^ ERROR mismatched types
-    foo::<f64>(42_f64);
-    //~^ ERROR mismatched types
-    foo::<f64>(42_f64);
-    //~^ ERROR mismatched types
-    foo::<f64>(42_i32.into());
-    //~^ ERROR mismatched types
-    foo::<f64>(42_i16.into());
-    //~^ ERROR mismatched types
-    foo::<f64>(42_i8.into());
-    //~^ ERROR mismatched types
-    foo::<f64>(42.0_f64);
-    foo::<f64>(42.0_f64);
-    //~^ ERROR mismatched types
-
-    foo::<f32>(42_f32);
-    //~^ ERROR mismatched types
-    foo::<f32>(42_f32);
-    //~^ ERROR mismatched types
-    foo::<f32>(42_f32);
-    //~^ ERROR mismatched types
-    foo::<f32>(42_u16.into());
-    //~^ ERROR mismatched types
-    foo::<f32>(42_u8.into());
-    //~^ ERROR mismatched types
-    foo::<f32>(42_f32);
-    //~^ ERROR mismatched types
-    foo::<f32>(42_f32);
-    //~^ ERROR mismatched types
-    foo::<f32>(42_f32);
-    //~^ ERROR mismatched types
-    foo::<f32>(42_i16.into());
-    //~^ ERROR mismatched types
-    foo::<f32>(42_i8.into());
-    //~^ ERROR mismatched types
-    foo::<f32>(42.0_f32);
-    //~^ ERROR mismatched types
-    foo::<f32>(42.0_f32);
-
-    foo::<u32>((42_u8 as u16).into());
-    //~^ ERROR mismatched types
-    foo::<i32>((-42_i8).into());
-    //~^ ERROR mismatched types
-}
diff --git a/src/test/ui/numeric/numeric-suffix.rs b/src/test/ui/numeric/numeric-suffix.rs
deleted file mode 100644 (file)
index ca38ed8..0000000
+++ /dev/null
@@ -1,298 +0,0 @@
-// run-rustfix
-
-fn foo<N>(_x: N) {}
-
-fn main() {
-    foo::<usize>(42_usize);
-    foo::<usize>(42_u64);
-    //~^ ERROR mismatched types
-    foo::<usize>(42_u32);
-    //~^ ERROR mismatched types
-    foo::<usize>(42_u16);
-    //~^ ERROR mismatched types
-    foo::<usize>(42_u8);
-    //~^ ERROR mismatched types
-    foo::<usize>(42_isize);
-    //~^ ERROR mismatched types
-    foo::<usize>(42_i64);
-    //~^ ERROR mismatched types
-    foo::<usize>(42_i32);
-    //~^ ERROR mismatched types
-    foo::<usize>(42_i16);
-    //~^ ERROR mismatched types
-    foo::<usize>(42_i8);
-    //~^ ERROR mismatched types
-    foo::<usize>(42.0_f64);
-    //~^ ERROR mismatched types
-    foo::<usize>(42.0_f32);
-    //~^ ERROR mismatched types
-
-    foo::<isize>(42_usize);
-    //~^ ERROR mismatched types
-    foo::<isize>(42_u64);
-    //~^ ERROR mismatched types
-    foo::<isize>(42_u32);
-    //~^ ERROR mismatched types
-    foo::<isize>(42_u16);
-    //~^ ERROR mismatched types
-    foo::<isize>(42_u8);
-    //~^ ERROR mismatched types
-    foo::<isize>(42_isize);
-    foo::<isize>(42_i64);
-    //~^ ERROR mismatched types
-    foo::<isize>(42_i32);
-    //~^ ERROR mismatched types
-    foo::<isize>(42_i16);
-    //~^ ERROR mismatched types
-    foo::<isize>(42_i8);
-    //~^ ERROR mismatched types
-    foo::<isize>(42.0_f64);
-    //~^ ERROR mismatched types
-    foo::<isize>(42.0_f32);
-    //~^ ERROR mismatched types
-
-    foo::<u64>(42_usize);
-    //~^ ERROR mismatched types
-    foo::<u64>(42_u64);
-    foo::<u64>(42_u32);
-    //~^ ERROR mismatched types
-    foo::<u64>(42_u16);
-    //~^ ERROR mismatched types
-    foo::<u64>(42_u8);
-    //~^ ERROR mismatched types
-    foo::<u64>(42_isize);
-    //~^ ERROR mismatched types
-    foo::<u64>(42_i64);
-    //~^ ERROR mismatched types
-    foo::<u64>(42_i32);
-    //~^ ERROR mismatched types
-    foo::<u64>(42_i16);
-    //~^ ERROR mismatched types
-    foo::<u64>(42_i8);
-    //~^ ERROR mismatched types
-    foo::<u64>(42.0_f64);
-    //~^ ERROR mismatched types
-    foo::<u64>(42.0_f32);
-    //~^ ERROR mismatched types
-
-    foo::<i64>(42_usize);
-    //~^ ERROR mismatched types
-    foo::<i64>(42_u64);
-    //~^ ERROR mismatched types
-    foo::<i64>(42_u32);
-    //~^ ERROR mismatched types
-    foo::<i64>(42_u16);
-    //~^ ERROR mismatched types
-    foo::<i64>(42_u8);
-    //~^ ERROR mismatched types
-    foo::<i64>(42_isize);
-    //~^ ERROR mismatched types
-    foo::<i64>(42_i64);
-    foo::<i64>(42_i32);
-    //~^ ERROR mismatched types
-    foo::<i64>(42_i16);
-    //~^ ERROR mismatched types
-    foo::<i64>(42_i8);
-    //~^ ERROR mismatched types
-    foo::<i64>(42.0_f64);
-    //~^ ERROR mismatched types
-    foo::<i64>(42.0_f32);
-    //~^ ERROR mismatched types
-
-    foo::<u32>(42_usize);
-    //~^ ERROR mismatched types
-    foo::<u32>(42_u64);
-    //~^ ERROR mismatched types
-    foo::<u32>(42_u32);
-    foo::<u32>(42_u16);
-    //~^ ERROR mismatched types
-    foo::<u32>(42_u8);
-    //~^ ERROR mismatched types
-    foo::<u32>(42_isize);
-    //~^ ERROR mismatched types
-    foo::<u32>(42_i64);
-    //~^ ERROR mismatched types
-    foo::<u32>(42_i32);
-    //~^ ERROR mismatched types
-    foo::<u32>(42_i16);
-    //~^ ERROR mismatched types
-    foo::<u32>(42_i8);
-    //~^ ERROR mismatched types
-    foo::<u32>(42.0_f64);
-    //~^ ERROR mismatched types
-    foo::<u32>(42.0_f32);
-    //~^ ERROR mismatched types
-
-    foo::<i32>(42_usize);
-    //~^ ERROR mismatched types
-    foo::<i32>(42_u64);
-    //~^ ERROR mismatched types
-    foo::<i32>(42_u32);
-    //~^ ERROR mismatched types
-    foo::<i32>(42_u16);
-    //~^ ERROR mismatched types
-    foo::<i32>(42_u8);
-    //~^ ERROR mismatched types
-    foo::<i32>(42_isize);
-    //~^ ERROR mismatched types
-    foo::<i32>(42_i64);
-    //~^ ERROR mismatched types
-    foo::<i32>(42_i32);
-    foo::<i32>(42_i16);
-    //~^ ERROR mismatched types
-    foo::<i32>(42_i8);
-    //~^ ERROR mismatched types
-    foo::<i32>(42.0_f64);
-    //~^ ERROR mismatched types
-    foo::<i32>(42.0_f32);
-    //~^ ERROR mismatched types
-
-    foo::<u16>(42_usize);
-    //~^ ERROR mismatched types
-    foo::<u16>(42_u64);
-    //~^ ERROR mismatched types
-    foo::<u16>(42_u32);
-    //~^ ERROR mismatched types
-    foo::<u16>(42_u16);
-    foo::<u16>(42_u8);
-    //~^ ERROR mismatched types
-    foo::<u16>(42_isize);
-    //~^ ERROR mismatched types
-    foo::<u16>(42_i64);
-    //~^ ERROR mismatched types
-    foo::<u16>(42_i32);
-    //~^ ERROR mismatched types
-    foo::<u16>(42_i16);
-    //~^ ERROR mismatched types
-    foo::<u16>(42_i8);
-    //~^ ERROR mismatched types
-    foo::<u16>(42.0_f64);
-    //~^ ERROR mismatched types
-    foo::<u16>(42.0_f32);
-    //~^ ERROR mismatched types
-
-    foo::<i16>(42_usize);
-    //~^ ERROR mismatched types
-    foo::<i16>(42_u64);
-    //~^ ERROR mismatched types
-    foo::<i16>(42_u32);
-    //~^ ERROR mismatched types
-    foo::<i16>(42_u16);
-    //~^ ERROR mismatched types
-    foo::<i16>(42_u8);
-    //~^ ERROR mismatched types
-    foo::<i16>(42_isize);
-    //~^ ERROR mismatched types
-    foo::<i16>(42_i64);
-    //~^ ERROR mismatched types
-    foo::<i16>(42_i32);
-    //~^ ERROR mismatched types
-    foo::<i16>(42_i16);
-    foo::<i16>(42_i8);
-    //~^ ERROR mismatched types
-    foo::<i16>(42.0_f64);
-    //~^ ERROR mismatched types
-    foo::<i16>(42.0_f32);
-    //~^ ERROR mismatched types
-
-    foo::<u8>(42_usize);
-    //~^ ERROR mismatched types
-    foo::<u8>(42_u64);
-    //~^ ERROR mismatched types
-    foo::<u8>(42_u32);
-    //~^ ERROR mismatched types
-    foo::<u8>(42_u16);
-    //~^ ERROR mismatched types
-    foo::<u8>(42_u8);
-    foo::<u8>(42_isize);
-    //~^ ERROR mismatched types
-    foo::<u8>(42_i64);
-    //~^ ERROR mismatched types
-    foo::<u8>(42_i32);
-    //~^ ERROR mismatched types
-    foo::<u8>(42_i16);
-    //~^ ERROR mismatched types
-    foo::<u8>(42_i8);
-    //~^ ERROR mismatched types
-    foo::<u8>(42.0_f64);
-    //~^ ERROR mismatched types
-    foo::<u8>(42.0_f32);
-    //~^ ERROR mismatched types
-
-    foo::<i8>(42_usize);
-    //~^ ERROR mismatched types
-    foo::<i8>(42_u64);
-    //~^ ERROR mismatched types
-    foo::<i8>(42_u32);
-    //~^ ERROR mismatched types
-    foo::<i8>(42_u16);
-    //~^ ERROR mismatched types
-    foo::<i8>(42_u8);
-    //~^ ERROR mismatched types
-    foo::<i8>(42_isize);
-    //~^ ERROR mismatched types
-    foo::<i8>(42_i64);
-    //~^ ERROR mismatched types
-    foo::<i8>(42_i32);
-    //~^ ERROR mismatched types
-    foo::<i8>(42_i16);
-    //~^ ERROR mismatched types
-    foo::<i8>(42_i8);
-    foo::<i8>(42.0_f64);
-    //~^ ERROR mismatched types
-    foo::<i8>(42.0_f32);
-    //~^ ERROR mismatched types
-
-    foo::<f64>(42_usize);
-    //~^ ERROR mismatched types
-    foo::<f64>(42_u64);
-    //~^ ERROR mismatched types
-    foo::<f64>(42_u32);
-    //~^ ERROR mismatched types
-    foo::<f64>(42_u16);
-    //~^ ERROR mismatched types
-    foo::<f64>(42_u8);
-    //~^ ERROR mismatched types
-    foo::<f64>(42_isize);
-    //~^ ERROR mismatched types
-    foo::<f64>(42_i64);
-    //~^ ERROR mismatched types
-    foo::<f64>(42_i32);
-    //~^ ERROR mismatched types
-    foo::<f64>(42_i16);
-    //~^ ERROR mismatched types
-    foo::<f64>(42_i8);
-    //~^ ERROR mismatched types
-    foo::<f64>(42.0_f64);
-    foo::<f64>(42.0_f32);
-    //~^ ERROR mismatched types
-
-    foo::<f32>(42_usize);
-    //~^ ERROR mismatched types
-    foo::<f32>(42_u64);
-    //~^ ERROR mismatched types
-    foo::<f32>(42_u32);
-    //~^ ERROR mismatched types
-    foo::<f32>(42_u16);
-    //~^ ERROR mismatched types
-    foo::<f32>(42_u8);
-    //~^ ERROR mismatched types
-    foo::<f32>(42_isize);
-    //~^ ERROR mismatched types
-    foo::<f32>(42_i64);
-    //~^ ERROR mismatched types
-    foo::<f32>(42_i32);
-    //~^ ERROR mismatched types
-    foo::<f32>(42_i16);
-    //~^ ERROR mismatched types
-    foo::<f32>(42_i8);
-    //~^ ERROR mismatched types
-    foo::<f32>(42.0_f64);
-    //~^ ERROR mismatched types
-    foo::<f32>(42.0_f32);
-
-    foo::<u32>(42_u8 as u16);
-    //~^ ERROR mismatched types
-    foo::<i32>(-42_i8);
-    //~^ ERROR mismatched types
-}
diff --git a/src/test/ui/numeric/numeric-suffix.stderr b/src/test/ui/numeric/numeric-suffix.stderr
deleted file mode 100644 (file)
index b829946..0000000
+++ /dev/null
@@ -1,1477 +0,0 @@
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:7:18
-   |
-LL |     foo::<usize>(42_u64);
-   |                  ^^^^^^ expected `usize`, found `u64`
-   |
-help: change the type of the numeric literal from `u64` to `usize`
-   |
-LL |     foo::<usize>(42_usize);
-   |                     ~~~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:9:18
-   |
-LL |     foo::<usize>(42_u32);
-   |                  ^^^^^^ expected `usize`, found `u32`
-   |
-help: change the type of the numeric literal from `u32` to `usize`
-   |
-LL |     foo::<usize>(42_usize);
-   |                     ~~~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:11:18
-   |
-LL |     foo::<usize>(42_u16);
-   |                  ^^^^^^ expected `usize`, found `u16`
-   |
-help: change the type of the numeric literal from `u16` to `usize`
-   |
-LL |     foo::<usize>(42_usize);
-   |                     ~~~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:13:18
-   |
-LL |     foo::<usize>(42_u8);
-   |                  ^^^^^ expected `usize`, found `u8`
-   |
-help: change the type of the numeric literal from `u8` to `usize`
-   |
-LL |     foo::<usize>(42_usize);
-   |                     ~~~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:15:18
-   |
-LL |     foo::<usize>(42_isize);
-   |                  ^^^^^^^^ expected `usize`, found `isize`
-   |
-help: change the type of the numeric literal from `isize` to `usize`
-   |
-LL |     foo::<usize>(42_usize);
-   |                     ~~~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:17:18
-   |
-LL |     foo::<usize>(42_i64);
-   |                  ^^^^^^ expected `usize`, found `i64`
-   |
-help: change the type of the numeric literal from `i64` to `usize`
-   |
-LL |     foo::<usize>(42_usize);
-   |                     ~~~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:19:18
-   |
-LL |     foo::<usize>(42_i32);
-   |                  ^^^^^^ expected `usize`, found `i32`
-   |
-help: change the type of the numeric literal from `i32` to `usize`
-   |
-LL |     foo::<usize>(42_usize);
-   |                     ~~~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:21:18
-   |
-LL |     foo::<usize>(42_i16);
-   |                  ^^^^^^ expected `usize`, found `i16`
-   |
-help: change the type of the numeric literal from `i16` to `usize`
-   |
-LL |     foo::<usize>(42_usize);
-   |                     ~~~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:23:18
-   |
-LL |     foo::<usize>(42_i8);
-   |                  ^^^^^ expected `usize`, found `i8`
-   |
-help: change the type of the numeric literal from `i8` to `usize`
-   |
-LL |     foo::<usize>(42_usize);
-   |                     ~~~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:25:18
-   |
-LL |     foo::<usize>(42.0_f64);
-   |                  ^^^^^^^^ expected `usize`, found `f64`
-   |
-help: change the type of the numeric literal from `f64` to `usize`
-   |
-LL |     foo::<usize>(42usize);
-   |                    ~~~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:27:18
-   |
-LL |     foo::<usize>(42.0_f32);
-   |                  ^^^^^^^^ expected `usize`, found `f32`
-   |
-help: change the type of the numeric literal from `f32` to `usize`
-   |
-LL |     foo::<usize>(42usize);
-   |                    ~~~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:30:18
-   |
-LL |     foo::<isize>(42_usize);
-   |                  ^^^^^^^^ expected `isize`, found `usize`
-   |
-help: change the type of the numeric literal from `usize` to `isize`
-   |
-LL |     foo::<isize>(42_isize);
-   |                     ~~~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:32:18
-   |
-LL |     foo::<isize>(42_u64);
-   |                  ^^^^^^ expected `isize`, found `u64`
-   |
-help: change the type of the numeric literal from `u64` to `isize`
-   |
-LL |     foo::<isize>(42_isize);
-   |                     ~~~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:34:18
-   |
-LL |     foo::<isize>(42_u32);
-   |                  ^^^^^^ expected `isize`, found `u32`
-   |
-help: change the type of the numeric literal from `u32` to `isize`
-   |
-LL |     foo::<isize>(42_isize);
-   |                     ~~~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:36:18
-   |
-LL |     foo::<isize>(42_u16);
-   |                  ^^^^^^ expected `isize`, found `u16`
-   |
-help: change the type of the numeric literal from `u16` to `isize`
-   |
-LL |     foo::<isize>(42_isize);
-   |                     ~~~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:38:18
-   |
-LL |     foo::<isize>(42_u8);
-   |                  ^^^^^ expected `isize`, found `u8`
-   |
-help: change the type of the numeric literal from `u8` to `isize`
-   |
-LL |     foo::<isize>(42_isize);
-   |                     ~~~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:41:18
-   |
-LL |     foo::<isize>(42_i64);
-   |                  ^^^^^^ expected `isize`, found `i64`
-   |
-help: change the type of the numeric literal from `i64` to `isize`
-   |
-LL |     foo::<isize>(42_isize);
-   |                     ~~~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:43:18
-   |
-LL |     foo::<isize>(42_i32);
-   |                  ^^^^^^ expected `isize`, found `i32`
-   |
-help: change the type of the numeric literal from `i32` to `isize`
-   |
-LL |     foo::<isize>(42_isize);
-   |                     ~~~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:45:18
-   |
-LL |     foo::<isize>(42_i16);
-   |                  ^^^^^^ expected `isize`, found `i16`
-   |
-help: change the type of the numeric literal from `i16` to `isize`
-   |
-LL |     foo::<isize>(42_isize);
-   |                     ~~~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:47:18
-   |
-LL |     foo::<isize>(42_i8);
-   |                  ^^^^^ expected `isize`, found `i8`
-   |
-help: change the type of the numeric literal from `i8` to `isize`
-   |
-LL |     foo::<isize>(42_isize);
-   |                     ~~~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:49:18
-   |
-LL |     foo::<isize>(42.0_f64);
-   |                  ^^^^^^^^ expected `isize`, found `f64`
-   |
-help: change the type of the numeric literal from `f64` to `isize`
-   |
-LL |     foo::<isize>(42isize);
-   |                    ~~~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:51:18
-   |
-LL |     foo::<isize>(42.0_f32);
-   |                  ^^^^^^^^ expected `isize`, found `f32`
-   |
-help: change the type of the numeric literal from `f32` to `isize`
-   |
-LL |     foo::<isize>(42isize);
-   |                    ~~~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:54:16
-   |
-LL |     foo::<u64>(42_usize);
-   |                ^^^^^^^^ expected `u64`, found `usize`
-   |
-help: change the type of the numeric literal from `usize` to `u64`
-   |
-LL |     foo::<u64>(42_u64);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:57:16
-   |
-LL |     foo::<u64>(42_u32);
-   |                ^^^^^^ expected `u64`, found `u32`
-   |
-help: change the type of the numeric literal from `u32` to `u64`
-   |
-LL |     foo::<u64>(42_u64);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:59:16
-   |
-LL |     foo::<u64>(42_u16);
-   |                ^^^^^^ expected `u64`, found `u16`
-   |
-help: change the type of the numeric literal from `u16` to `u64`
-   |
-LL |     foo::<u64>(42_u64);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:61:16
-   |
-LL |     foo::<u64>(42_u8);
-   |                ^^^^^ expected `u64`, found `u8`
-   |
-help: change the type of the numeric literal from `u8` to `u64`
-   |
-LL |     foo::<u64>(42_u64);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:63:16
-   |
-LL |     foo::<u64>(42_isize);
-   |                ^^^^^^^^ expected `u64`, found `isize`
-   |
-help: change the type of the numeric literal from `isize` to `u64`
-   |
-LL |     foo::<u64>(42_u64);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:65:16
-   |
-LL |     foo::<u64>(42_i64);
-   |                ^^^^^^ expected `u64`, found `i64`
-   |
-help: change the type of the numeric literal from `i64` to `u64`
-   |
-LL |     foo::<u64>(42_u64);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:67:16
-   |
-LL |     foo::<u64>(42_i32);
-   |                ^^^^^^ expected `u64`, found `i32`
-   |
-help: change the type of the numeric literal from `i32` to `u64`
-   |
-LL |     foo::<u64>(42_u64);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:69:16
-   |
-LL |     foo::<u64>(42_i16);
-   |                ^^^^^^ expected `u64`, found `i16`
-   |
-help: change the type of the numeric literal from `i16` to `u64`
-   |
-LL |     foo::<u64>(42_u64);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:71:16
-   |
-LL |     foo::<u64>(42_i8);
-   |                ^^^^^ expected `u64`, found `i8`
-   |
-help: change the type of the numeric literal from `i8` to `u64`
-   |
-LL |     foo::<u64>(42_u64);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:73:16
-   |
-LL |     foo::<u64>(42.0_f64);
-   |                ^^^^^^^^ expected `u64`, found `f64`
-   |
-help: change the type of the numeric literal from `f64` to `u64`
-   |
-LL |     foo::<u64>(42u64);
-   |                  ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:75:16
-   |
-LL |     foo::<u64>(42.0_f32);
-   |                ^^^^^^^^ expected `u64`, found `f32`
-   |
-help: change the type of the numeric literal from `f32` to `u64`
-   |
-LL |     foo::<u64>(42u64);
-   |                  ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:78:16
-   |
-LL |     foo::<i64>(42_usize);
-   |                ^^^^^^^^ expected `i64`, found `usize`
-   |
-help: change the type of the numeric literal from `usize` to `i64`
-   |
-LL |     foo::<i64>(42_i64);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:80:16
-   |
-LL |     foo::<i64>(42_u64);
-   |                ^^^^^^ expected `i64`, found `u64`
-   |
-help: change the type of the numeric literal from `u64` to `i64`
-   |
-LL |     foo::<i64>(42_i64);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:82:16
-   |
-LL |     foo::<i64>(42_u32);
-   |                ^^^^^^ expected `i64`, found `u32`
-   |
-help: change the type of the numeric literal from `u32` to `i64`
-   |
-LL |     foo::<i64>(42_i64);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:84:16
-   |
-LL |     foo::<i64>(42_u16);
-   |                ^^^^^^ expected `i64`, found `u16`
-   |
-help: change the type of the numeric literal from `u16` to `i64`
-   |
-LL |     foo::<i64>(42_i64);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:86:16
-   |
-LL |     foo::<i64>(42_u8);
-   |                ^^^^^ expected `i64`, found `u8`
-   |
-help: change the type of the numeric literal from `u8` to `i64`
-   |
-LL |     foo::<i64>(42_i64);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:88:16
-   |
-LL |     foo::<i64>(42_isize);
-   |                ^^^^^^^^ expected `i64`, found `isize`
-   |
-help: change the type of the numeric literal from `isize` to `i64`
-   |
-LL |     foo::<i64>(42_i64);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:91:16
-   |
-LL |     foo::<i64>(42_i32);
-   |                ^^^^^^ expected `i64`, found `i32`
-   |
-help: change the type of the numeric literal from `i32` to `i64`
-   |
-LL |     foo::<i64>(42_i64);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:93:16
-   |
-LL |     foo::<i64>(42_i16);
-   |                ^^^^^^ expected `i64`, found `i16`
-   |
-help: change the type of the numeric literal from `i16` to `i64`
-   |
-LL |     foo::<i64>(42_i64);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:95:16
-   |
-LL |     foo::<i64>(42_i8);
-   |                ^^^^^ expected `i64`, found `i8`
-   |
-help: change the type of the numeric literal from `i8` to `i64`
-   |
-LL |     foo::<i64>(42_i64);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:97:16
-   |
-LL |     foo::<i64>(42.0_f64);
-   |                ^^^^^^^^ expected `i64`, found `f64`
-   |
-help: change the type of the numeric literal from `f64` to `i64`
-   |
-LL |     foo::<i64>(42i64);
-   |                  ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:99:16
-   |
-LL |     foo::<i64>(42.0_f32);
-   |                ^^^^^^^^ expected `i64`, found `f32`
-   |
-help: change the type of the numeric literal from `f32` to `i64`
-   |
-LL |     foo::<i64>(42i64);
-   |                  ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:102:16
-   |
-LL |     foo::<u32>(42_usize);
-   |                ^^^^^^^^ expected `u32`, found `usize`
-   |
-help: change the type of the numeric literal from `usize` to `u32`
-   |
-LL |     foo::<u32>(42_u32);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:104:16
-   |
-LL |     foo::<u32>(42_u64);
-   |                ^^^^^^ expected `u32`, found `u64`
-   |
-help: change the type of the numeric literal from `u64` to `u32`
-   |
-LL |     foo::<u32>(42_u32);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:107:16
-   |
-LL |     foo::<u32>(42_u16);
-   |                ^^^^^^ expected `u32`, found `u16`
-   |
-help: change the type of the numeric literal from `u16` to `u32`
-   |
-LL |     foo::<u32>(42_u32);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:109:16
-   |
-LL |     foo::<u32>(42_u8);
-   |                ^^^^^ expected `u32`, found `u8`
-   |
-help: change the type of the numeric literal from `u8` to `u32`
-   |
-LL |     foo::<u32>(42_u32);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:111:16
-   |
-LL |     foo::<u32>(42_isize);
-   |                ^^^^^^^^ expected `u32`, found `isize`
-   |
-help: change the type of the numeric literal from `isize` to `u32`
-   |
-LL |     foo::<u32>(42_u32);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:113:16
-   |
-LL |     foo::<u32>(42_i64);
-   |                ^^^^^^ expected `u32`, found `i64`
-   |
-help: change the type of the numeric literal from `i64` to `u32`
-   |
-LL |     foo::<u32>(42_u32);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:115:16
-   |
-LL |     foo::<u32>(42_i32);
-   |                ^^^^^^ expected `u32`, found `i32`
-   |
-help: change the type of the numeric literal from `i32` to `u32`
-   |
-LL |     foo::<u32>(42_u32);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:117:16
-   |
-LL |     foo::<u32>(42_i16);
-   |                ^^^^^^ expected `u32`, found `i16`
-   |
-help: change the type of the numeric literal from `i16` to `u32`
-   |
-LL |     foo::<u32>(42_u32);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:119:16
-   |
-LL |     foo::<u32>(42_i8);
-   |                ^^^^^ expected `u32`, found `i8`
-   |
-help: change the type of the numeric literal from `i8` to `u32`
-   |
-LL |     foo::<u32>(42_u32);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:121:16
-   |
-LL |     foo::<u32>(42.0_f64);
-   |                ^^^^^^^^ expected `u32`, found `f64`
-   |
-help: change the type of the numeric literal from `f64` to `u32`
-   |
-LL |     foo::<u32>(42u32);
-   |                  ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:123:16
-   |
-LL |     foo::<u32>(42.0_f32);
-   |                ^^^^^^^^ expected `u32`, found `f32`
-   |
-help: change the type of the numeric literal from `f32` to `u32`
-   |
-LL |     foo::<u32>(42u32);
-   |                  ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:126:16
-   |
-LL |     foo::<i32>(42_usize);
-   |                ^^^^^^^^ expected `i32`, found `usize`
-   |
-help: change the type of the numeric literal from `usize` to `i32`
-   |
-LL |     foo::<i32>(42_i32);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:128:16
-   |
-LL |     foo::<i32>(42_u64);
-   |                ^^^^^^ expected `i32`, found `u64`
-   |
-help: change the type of the numeric literal from `u64` to `i32`
-   |
-LL |     foo::<i32>(42_i32);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:130:16
-   |
-LL |     foo::<i32>(42_u32);
-   |                ^^^^^^ expected `i32`, found `u32`
-   |
-help: change the type of the numeric literal from `u32` to `i32`
-   |
-LL |     foo::<i32>(42_i32);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:132:16
-   |
-LL |     foo::<i32>(42_u16);
-   |                ^^^^^^ expected `i32`, found `u16`
-   |
-help: change the type of the numeric literal from `u16` to `i32`
-   |
-LL |     foo::<i32>(42_i32);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:134:16
-   |
-LL |     foo::<i32>(42_u8);
-   |                ^^^^^ expected `i32`, found `u8`
-   |
-help: change the type of the numeric literal from `u8` to `i32`
-   |
-LL |     foo::<i32>(42_i32);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:136:16
-   |
-LL |     foo::<i32>(42_isize);
-   |                ^^^^^^^^ expected `i32`, found `isize`
-   |
-help: change the type of the numeric literal from `isize` to `i32`
-   |
-LL |     foo::<i32>(42_i32);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:138:16
-   |
-LL |     foo::<i32>(42_i64);
-   |                ^^^^^^ expected `i32`, found `i64`
-   |
-help: change the type of the numeric literal from `i64` to `i32`
-   |
-LL |     foo::<i32>(42_i32);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:141:16
-   |
-LL |     foo::<i32>(42_i16);
-   |                ^^^^^^ expected `i32`, found `i16`
-   |
-help: change the type of the numeric literal from `i16` to `i32`
-   |
-LL |     foo::<i32>(42_i32);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:143:16
-   |
-LL |     foo::<i32>(42_i8);
-   |                ^^^^^ expected `i32`, found `i8`
-   |
-help: change the type of the numeric literal from `i8` to `i32`
-   |
-LL |     foo::<i32>(42_i32);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:145:16
-   |
-LL |     foo::<i32>(42.0_f64);
-   |                ^^^^^^^^ expected `i32`, found `f64`
-   |
-help: change the type of the numeric literal from `f64` to `i32`
-   |
-LL |     foo::<i32>(42i32);
-   |                  ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:147:16
-   |
-LL |     foo::<i32>(42.0_f32);
-   |                ^^^^^^^^ expected `i32`, found `f32`
-   |
-help: change the type of the numeric literal from `f32` to `i32`
-   |
-LL |     foo::<i32>(42i32);
-   |                  ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:150:16
-   |
-LL |     foo::<u16>(42_usize);
-   |                ^^^^^^^^ expected `u16`, found `usize`
-   |
-help: change the type of the numeric literal from `usize` to `u16`
-   |
-LL |     foo::<u16>(42_u16);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:152:16
-   |
-LL |     foo::<u16>(42_u64);
-   |                ^^^^^^ expected `u16`, found `u64`
-   |
-help: change the type of the numeric literal from `u64` to `u16`
-   |
-LL |     foo::<u16>(42_u16);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:154:16
-   |
-LL |     foo::<u16>(42_u32);
-   |                ^^^^^^ expected `u16`, found `u32`
-   |
-help: change the type of the numeric literal from `u32` to `u16`
-   |
-LL |     foo::<u16>(42_u16);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:157:16
-   |
-LL |     foo::<u16>(42_u8);
-   |                ^^^^^ expected `u16`, found `u8`
-   |
-help: change the type of the numeric literal from `u8` to `u16`
-   |
-LL |     foo::<u16>(42_u16);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:159:16
-   |
-LL |     foo::<u16>(42_isize);
-   |                ^^^^^^^^ expected `u16`, found `isize`
-   |
-help: change the type of the numeric literal from `isize` to `u16`
-   |
-LL |     foo::<u16>(42_u16);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:161:16
-   |
-LL |     foo::<u16>(42_i64);
-   |                ^^^^^^ expected `u16`, found `i64`
-   |
-help: change the type of the numeric literal from `i64` to `u16`
-   |
-LL |     foo::<u16>(42_u16);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:163:16
-   |
-LL |     foo::<u16>(42_i32);
-   |                ^^^^^^ expected `u16`, found `i32`
-   |
-help: change the type of the numeric literal from `i32` to `u16`
-   |
-LL |     foo::<u16>(42_u16);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:165:16
-   |
-LL |     foo::<u16>(42_i16);
-   |                ^^^^^^ expected `u16`, found `i16`
-   |
-help: change the type of the numeric literal from `i16` to `u16`
-   |
-LL |     foo::<u16>(42_u16);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:167:16
-   |
-LL |     foo::<u16>(42_i8);
-   |                ^^^^^ expected `u16`, found `i8`
-   |
-help: change the type of the numeric literal from `i8` to `u16`
-   |
-LL |     foo::<u16>(42_u16);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:169:16
-   |
-LL |     foo::<u16>(42.0_f64);
-   |                ^^^^^^^^ expected `u16`, found `f64`
-   |
-help: change the type of the numeric literal from `f64` to `u16`
-   |
-LL |     foo::<u16>(42u16);
-   |                  ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:171:16
-   |
-LL |     foo::<u16>(42.0_f32);
-   |                ^^^^^^^^ expected `u16`, found `f32`
-   |
-help: change the type of the numeric literal from `f32` to `u16`
-   |
-LL |     foo::<u16>(42u16);
-   |                  ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:174:16
-   |
-LL |     foo::<i16>(42_usize);
-   |                ^^^^^^^^ expected `i16`, found `usize`
-   |
-help: change the type of the numeric literal from `usize` to `i16`
-   |
-LL |     foo::<i16>(42_i16);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:176:16
-   |
-LL |     foo::<i16>(42_u64);
-   |                ^^^^^^ expected `i16`, found `u64`
-   |
-help: change the type of the numeric literal from `u64` to `i16`
-   |
-LL |     foo::<i16>(42_i16);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:178:16
-   |
-LL |     foo::<i16>(42_u32);
-   |                ^^^^^^ expected `i16`, found `u32`
-   |
-help: change the type of the numeric literal from `u32` to `i16`
-   |
-LL |     foo::<i16>(42_i16);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:180:16
-   |
-LL |     foo::<i16>(42_u16);
-   |                ^^^^^^ expected `i16`, found `u16`
-   |
-help: change the type of the numeric literal from `u16` to `i16`
-   |
-LL |     foo::<i16>(42_i16);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:182:16
-   |
-LL |     foo::<i16>(42_u8);
-   |                ^^^^^ expected `i16`, found `u8`
-   |
-help: change the type of the numeric literal from `u8` to `i16`
-   |
-LL |     foo::<i16>(42_i16);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:184:16
-   |
-LL |     foo::<i16>(42_isize);
-   |                ^^^^^^^^ expected `i16`, found `isize`
-   |
-help: change the type of the numeric literal from `isize` to `i16`
-   |
-LL |     foo::<i16>(42_i16);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:186:16
-   |
-LL |     foo::<i16>(42_i64);
-   |                ^^^^^^ expected `i16`, found `i64`
-   |
-help: change the type of the numeric literal from `i64` to `i16`
-   |
-LL |     foo::<i16>(42_i16);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:188:16
-   |
-LL |     foo::<i16>(42_i32);
-   |                ^^^^^^ expected `i16`, found `i32`
-   |
-help: change the type of the numeric literal from `i32` to `i16`
-   |
-LL |     foo::<i16>(42_i16);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:191:16
-   |
-LL |     foo::<i16>(42_i8);
-   |                ^^^^^ expected `i16`, found `i8`
-   |
-help: change the type of the numeric literal from `i8` to `i16`
-   |
-LL |     foo::<i16>(42_i16);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:193:16
-   |
-LL |     foo::<i16>(42.0_f64);
-   |                ^^^^^^^^ expected `i16`, found `f64`
-   |
-help: change the type of the numeric literal from `f64` to `i16`
-   |
-LL |     foo::<i16>(42i16);
-   |                  ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:195:16
-   |
-LL |     foo::<i16>(42.0_f32);
-   |                ^^^^^^^^ expected `i16`, found `f32`
-   |
-help: change the type of the numeric literal from `f32` to `i16`
-   |
-LL |     foo::<i16>(42i16);
-   |                  ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:198:15
-   |
-LL |     foo::<u8>(42_usize);
-   |               ^^^^^^^^ expected `u8`, found `usize`
-   |
-help: change the type of the numeric literal from `usize` to `u8`
-   |
-LL |     foo::<u8>(42_u8);
-   |                  ~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:200:15
-   |
-LL |     foo::<u8>(42_u64);
-   |               ^^^^^^ expected `u8`, found `u64`
-   |
-help: change the type of the numeric literal from `u64` to `u8`
-   |
-LL |     foo::<u8>(42_u8);
-   |                  ~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:202:15
-   |
-LL |     foo::<u8>(42_u32);
-   |               ^^^^^^ expected `u8`, found `u32`
-   |
-help: change the type of the numeric literal from `u32` to `u8`
-   |
-LL |     foo::<u8>(42_u8);
-   |                  ~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:204:15
-   |
-LL |     foo::<u8>(42_u16);
-   |               ^^^^^^ expected `u8`, found `u16`
-   |
-help: change the type of the numeric literal from `u16` to `u8`
-   |
-LL |     foo::<u8>(42_u8);
-   |                  ~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:207:15
-   |
-LL |     foo::<u8>(42_isize);
-   |               ^^^^^^^^ expected `u8`, found `isize`
-   |
-help: change the type of the numeric literal from `isize` to `u8`
-   |
-LL |     foo::<u8>(42_u8);
-   |                  ~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:209:15
-   |
-LL |     foo::<u8>(42_i64);
-   |               ^^^^^^ expected `u8`, found `i64`
-   |
-help: change the type of the numeric literal from `i64` to `u8`
-   |
-LL |     foo::<u8>(42_u8);
-   |                  ~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:211:15
-   |
-LL |     foo::<u8>(42_i32);
-   |               ^^^^^^ expected `u8`, found `i32`
-   |
-help: change the type of the numeric literal from `i32` to `u8`
-   |
-LL |     foo::<u8>(42_u8);
-   |                  ~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:213:15
-   |
-LL |     foo::<u8>(42_i16);
-   |               ^^^^^^ expected `u8`, found `i16`
-   |
-help: change the type of the numeric literal from `i16` to `u8`
-   |
-LL |     foo::<u8>(42_u8);
-   |                  ~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:215:15
-   |
-LL |     foo::<u8>(42_i8);
-   |               ^^^^^ expected `u8`, found `i8`
-   |
-help: change the type of the numeric literal from `i8` to `u8`
-   |
-LL |     foo::<u8>(42_u8);
-   |                  ~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:217:15
-   |
-LL |     foo::<u8>(42.0_f64);
-   |               ^^^^^^^^ expected `u8`, found `f64`
-   |
-help: change the type of the numeric literal from `f64` to `u8`
-   |
-LL |     foo::<u8>(42u8);
-   |                 ~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:219:15
-   |
-LL |     foo::<u8>(42.0_f32);
-   |               ^^^^^^^^ expected `u8`, found `f32`
-   |
-help: change the type of the numeric literal from `f32` to `u8`
-   |
-LL |     foo::<u8>(42u8);
-   |                 ~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:222:15
-   |
-LL |     foo::<i8>(42_usize);
-   |               ^^^^^^^^ expected `i8`, found `usize`
-   |
-help: change the type of the numeric literal from `usize` to `i8`
-   |
-LL |     foo::<i8>(42_i8);
-   |                  ~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:224:15
-   |
-LL |     foo::<i8>(42_u64);
-   |               ^^^^^^ expected `i8`, found `u64`
-   |
-help: change the type of the numeric literal from `u64` to `i8`
-   |
-LL |     foo::<i8>(42_i8);
-   |                  ~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:226:15
-   |
-LL |     foo::<i8>(42_u32);
-   |               ^^^^^^ expected `i8`, found `u32`
-   |
-help: change the type of the numeric literal from `u32` to `i8`
-   |
-LL |     foo::<i8>(42_i8);
-   |                  ~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:228:15
-   |
-LL |     foo::<i8>(42_u16);
-   |               ^^^^^^ expected `i8`, found `u16`
-   |
-help: change the type of the numeric literal from `u16` to `i8`
-   |
-LL |     foo::<i8>(42_i8);
-   |                  ~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:230:15
-   |
-LL |     foo::<i8>(42_u8);
-   |               ^^^^^ expected `i8`, found `u8`
-   |
-help: change the type of the numeric literal from `u8` to `i8`
-   |
-LL |     foo::<i8>(42_i8);
-   |                  ~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:232:15
-   |
-LL |     foo::<i8>(42_isize);
-   |               ^^^^^^^^ expected `i8`, found `isize`
-   |
-help: change the type of the numeric literal from `isize` to `i8`
-   |
-LL |     foo::<i8>(42_i8);
-   |                  ~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:234:15
-   |
-LL |     foo::<i8>(42_i64);
-   |               ^^^^^^ expected `i8`, found `i64`
-   |
-help: change the type of the numeric literal from `i64` to `i8`
-   |
-LL |     foo::<i8>(42_i8);
-   |                  ~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:236:15
-   |
-LL |     foo::<i8>(42_i32);
-   |               ^^^^^^ expected `i8`, found `i32`
-   |
-help: change the type of the numeric literal from `i32` to `i8`
-   |
-LL |     foo::<i8>(42_i8);
-   |                  ~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:238:15
-   |
-LL |     foo::<i8>(42_i16);
-   |               ^^^^^^ expected `i8`, found `i16`
-   |
-help: change the type of the numeric literal from `i16` to `i8`
-   |
-LL |     foo::<i8>(42_i8);
-   |                  ~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:241:15
-   |
-LL |     foo::<i8>(42.0_f64);
-   |               ^^^^^^^^ expected `i8`, found `f64`
-   |
-help: change the type of the numeric literal from `f64` to `i8`
-   |
-LL |     foo::<i8>(42i8);
-   |                 ~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:243:15
-   |
-LL |     foo::<i8>(42.0_f32);
-   |               ^^^^^^^^ expected `i8`, found `f32`
-   |
-help: change the type of the numeric literal from `f32` to `i8`
-   |
-LL |     foo::<i8>(42i8);
-   |                 ~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:246:16
-   |
-LL |     foo::<f64>(42_usize);
-   |                ^^^^^^^^ expected `f64`, found `usize`
-   |
-help: change the type of the numeric literal from `usize` to `f64`
-   |
-LL |     foo::<f64>(42_f64);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:248:16
-   |
-LL |     foo::<f64>(42_u64);
-   |                ^^^^^^ expected `f64`, found `u64`
-   |
-help: change the type of the numeric literal from `u64` to `f64`
-   |
-LL |     foo::<f64>(42_f64);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:250:16
-   |
-LL |     foo::<f64>(42_u32);
-   |                ^^^^^^ expected `f64`, found `u32`
-   |
-help: you can convert a `u32` to an `f64`, producing the floating point representation of the integer
-   |
-LL |     foo::<f64>(42_u32.into());
-   |                      +++++++
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:252:16
-   |
-LL |     foo::<f64>(42_u16);
-   |                ^^^^^^ expected `f64`, found `u16`
-   |
-help: you can convert a `u16` to an `f64`, producing the floating point representation of the integer
-   |
-LL |     foo::<f64>(42_u16.into());
-   |                      +++++++
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:254:16
-   |
-LL |     foo::<f64>(42_u8);
-   |                ^^^^^ expected `f64`, found `u8`
-   |
-help: you can convert a `u8` to an `f64`, producing the floating point representation of the integer
-   |
-LL |     foo::<f64>(42_u8.into());
-   |                     +++++++
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:256:16
-   |
-LL |     foo::<f64>(42_isize);
-   |                ^^^^^^^^ expected `f64`, found `isize`
-   |
-help: change the type of the numeric literal from `isize` to `f64`
-   |
-LL |     foo::<f64>(42_f64);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:258:16
-   |
-LL |     foo::<f64>(42_i64);
-   |                ^^^^^^ expected `f64`, found `i64`
-   |
-help: change the type of the numeric literal from `i64` to `f64`
-   |
-LL |     foo::<f64>(42_f64);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:260:16
-   |
-LL |     foo::<f64>(42_i32);
-   |                ^^^^^^ expected `f64`, found `i32`
-   |
-help: you can convert an `i32` to an `f64`, producing the floating point representation of the integer
-   |
-LL |     foo::<f64>(42_i32.into());
-   |                      +++++++
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:262:16
-   |
-LL |     foo::<f64>(42_i16);
-   |                ^^^^^^ expected `f64`, found `i16`
-   |
-help: you can convert an `i16` to an `f64`, producing the floating point representation of the integer
-   |
-LL |     foo::<f64>(42_i16.into());
-   |                      +++++++
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:264:16
-   |
-LL |     foo::<f64>(42_i8);
-   |                ^^^^^ expected `f64`, found `i8`
-   |
-help: you can convert an `i8` to an `f64`, producing the floating point representation of the integer
-   |
-LL |     foo::<f64>(42_i8.into());
-   |                     +++++++
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:267:16
-   |
-LL |     foo::<f64>(42.0_f32);
-   |                ^^^^^^^^ expected `f64`, found `f32`
-   |
-help: change the type of the numeric literal from `f32` to `f64`
-   |
-LL |     foo::<f64>(42.0_f64);
-   |                     ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:270:16
-   |
-LL |     foo::<f32>(42_usize);
-   |                ^^^^^^^^ expected `f32`, found `usize`
-   |
-help: change the type of the numeric literal from `usize` to `f32`
-   |
-LL |     foo::<f32>(42_f32);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:272:16
-   |
-LL |     foo::<f32>(42_u64);
-   |                ^^^^^^ expected `f32`, found `u64`
-   |
-help: change the type of the numeric literal from `u64` to `f32`
-   |
-LL |     foo::<f32>(42_f32);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:274:16
-   |
-LL |     foo::<f32>(42_u32);
-   |                ^^^^^^ expected `f32`, found `u32`
-   |
-help: change the type of the numeric literal from `u32` to `f32`
-   |
-LL |     foo::<f32>(42_f32);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:276:16
-   |
-LL |     foo::<f32>(42_u16);
-   |                ^^^^^^ expected `f32`, found `u16`
-   |
-help: you can convert a `u16` to an `f32`, producing the floating point representation of the integer
-   |
-LL |     foo::<f32>(42_u16.into());
-   |                      +++++++
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:278:16
-   |
-LL |     foo::<f32>(42_u8);
-   |                ^^^^^ expected `f32`, found `u8`
-   |
-help: you can convert a `u8` to an `f32`, producing the floating point representation of the integer
-   |
-LL |     foo::<f32>(42_u8.into());
-   |                     +++++++
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:280:16
-   |
-LL |     foo::<f32>(42_isize);
-   |                ^^^^^^^^ expected `f32`, found `isize`
-   |
-help: change the type of the numeric literal from `isize` to `f32`
-   |
-LL |     foo::<f32>(42_f32);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:282:16
-   |
-LL |     foo::<f32>(42_i64);
-   |                ^^^^^^ expected `f32`, found `i64`
-   |
-help: change the type of the numeric literal from `i64` to `f32`
-   |
-LL |     foo::<f32>(42_f32);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:284:16
-   |
-LL |     foo::<f32>(42_i32);
-   |                ^^^^^^ expected `f32`, found `i32`
-   |
-help: change the type of the numeric literal from `i32` to `f32`
-   |
-LL |     foo::<f32>(42_f32);
-   |                   ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:286:16
-   |
-LL |     foo::<f32>(42_i16);
-   |                ^^^^^^ expected `f32`, found `i16`
-   |
-help: you can convert an `i16` to an `f32`, producing the floating point representation of the integer
-   |
-LL |     foo::<f32>(42_i16.into());
-   |                      +++++++
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:288:16
-   |
-LL |     foo::<f32>(42_i8);
-   |                ^^^^^ expected `f32`, found `i8`
-   |
-help: you can convert an `i8` to an `f32`, producing the floating point representation of the integer
-   |
-LL |     foo::<f32>(42_i8.into());
-   |                     +++++++
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:290:16
-   |
-LL |     foo::<f32>(42.0_f64);
-   |                ^^^^^^^^ expected `f32`, found `f64`
-   |
-help: change the type of the numeric literal from `f64` to `f32`
-   |
-LL |     foo::<f32>(42.0_f32);
-   |                     ~~~
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:294:16
-   |
-LL |     foo::<u32>(42_u8 as u16);
-   |                ^^^^^^^^^^^^ expected `u32`, found `u16`
-   |
-help: you can convert a `u16` to a `u32`
-   |
-LL |     foo::<u32>((42_u8 as u16).into());
-   |                +            ++++++++
-
-error[E0308]: mismatched types
-  --> $DIR/numeric-suffix.rs:296:16
-   |
-LL |     foo::<i32>(-42_i8);
-   |                ^^^^^^ expected `i32`, found `i8`
-   |
-help: you can convert an `i8` to an `i32`
-   |
-LL |     foo::<i32>((-42_i8).into());
-   |                +      ++++++++
-
-error: aborting due to 134 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/numeric/numeric-suffix/numeric-suffix-i32.fixed b/src/test/ui/numeric/numeric-suffix/numeric-suffix-i32.fixed
new file mode 100644 (file)
index 0000000..6e8c54d
--- /dev/null
@@ -0,0 +1,73 @@
+// run-rustfix
+
+fn foo<N>(_x: N) {}
+//~^ NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+
+fn main() {
+    foo::<i32>(42_i32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i32>(42_i32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i32>(42_i32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i32>(42_i32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i32>(42_i32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i32>(42_i32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i32>(42_i32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i32>(42_i32);
+    foo::<i32>(42_i32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i32>(42_i32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i32>(42i32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i32>(42i32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+}
diff --git a/src/test/ui/numeric/numeric-suffix/numeric-suffix-i32.rs b/src/test/ui/numeric/numeric-suffix/numeric-suffix-i32.rs
new file mode 100644 (file)
index 0000000..b47b0ed
--- /dev/null
@@ -0,0 +1,73 @@
+// run-rustfix
+
+fn foo<N>(_x: N) {}
+//~^ NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+
+fn main() {
+    foo::<i32>(42_usize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i32>(42_u64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i32>(42_u32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i32>(42_u16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i32>(42_u8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i32>(42_isize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i32>(42_i64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i32>(42_i32);
+    foo::<i32>(42_i16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i32>(42_i8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i32>(42.0_f64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i32>(42.0_f32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+}
diff --git a/src/test/ui/numeric/numeric-suffix/numeric-suffix-i32.stderr b/src/test/ui/numeric/numeric-suffix/numeric-suffix-i32.stderr
new file mode 100644 (file)
index 0000000..f4fb14e
--- /dev/null
@@ -0,0 +1,201 @@
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-i32.rs:28:16
+   |
+LL |     foo::<i32>(42_usize);
+   |     ---------- ^^^^^^^^ expected `i32`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-i32.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `usize` to `i32`
+   |
+LL |     foo::<i32>(42_i32);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-i32.rs:32:16
+   |
+LL |     foo::<i32>(42_u64);
+   |     ---------- ^^^^^^ expected `i32`, found `u64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-i32.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u64` to `i32`
+   |
+LL |     foo::<i32>(42_i32);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-i32.rs:36:16
+   |
+LL |     foo::<i32>(42_u32);
+   |     ---------- ^^^^^^ expected `i32`, found `u32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-i32.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u32` to `i32`
+   |
+LL |     foo::<i32>(42_i32);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-i32.rs:40:16
+   |
+LL |     foo::<i32>(42_u16);
+   |     ---------- ^^^^^^ expected `i32`, found `u16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-i32.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u16` to `i32`
+   |
+LL |     foo::<i32>(42_i32);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-i32.rs:44:16
+   |
+LL |     foo::<i32>(42_u8);
+   |     ---------- ^^^^^ expected `i32`, found `u8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-i32.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u8` to `i32`
+   |
+LL |     foo::<i32>(42_i32);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-i32.rs:48:16
+   |
+LL |     foo::<i32>(42_isize);
+   |     ---------- ^^^^^^^^ expected `i32`, found `isize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-i32.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `isize` to `i32`
+   |
+LL |     foo::<i32>(42_i32);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-i32.rs:52:16
+   |
+LL |     foo::<i32>(42_i64);
+   |     ---------- ^^^^^^ expected `i32`, found `i64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-i32.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i64` to `i32`
+   |
+LL |     foo::<i32>(42_i32);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-i32.rs:57:16
+   |
+LL |     foo::<i32>(42_i16);
+   |     ---------- ^^^^^^ expected `i32`, found `i16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-i32.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i16` to `i32`
+   |
+LL |     foo::<i32>(42_i32);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-i32.rs:61:16
+   |
+LL |     foo::<i32>(42_i8);
+   |     ---------- ^^^^^ expected `i32`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-i32.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i8` to `i32`
+   |
+LL |     foo::<i32>(42_i32);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-i32.rs:65:16
+   |
+LL |     foo::<i32>(42.0_f64);
+   |     ---------- ^^^^^^^^ expected `i32`, found `f64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-i32.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `f64` to `i32`
+   |
+LL |     foo::<i32>(42i32);
+   |                  ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-i32.rs:69:16
+   |
+LL |     foo::<i32>(42.0_f32);
+   |     ---------- ^^^^^^^^ expected `i32`, found `f32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-i32.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `f32` to `i32`
+   |
+LL |     foo::<i32>(42i32);
+   |                  ~~~
+
+error: aborting due to 11 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/numeric/numeric-suffix/numeric-suffix-i64.fixed b/src/test/ui/numeric/numeric-suffix/numeric-suffix-i64.fixed
new file mode 100644 (file)
index 0000000..03821cd
--- /dev/null
@@ -0,0 +1,73 @@
+// run-rustfix
+
+fn foo<N>(_x: N) {}
+//~^ NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+
+fn main() {
+    foo::<i64>(42_i64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i64>(42_i64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i64>(42_i64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i64>(42_i64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i64>(42_i64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i64>(42_i64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i64>(42_i64);
+    foo::<i64>(42_i64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i64>(42_i64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i64>(42_i64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i64>(42i64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i64>(42i64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+}
diff --git a/src/test/ui/numeric/numeric-suffix/numeric-suffix-i64.rs b/src/test/ui/numeric/numeric-suffix/numeric-suffix-i64.rs
new file mode 100644 (file)
index 0000000..629fe7e
--- /dev/null
@@ -0,0 +1,73 @@
+// run-rustfix
+
+fn foo<N>(_x: N) {}
+//~^ NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+
+fn main() {
+    foo::<i64>(42_usize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i64>(42_u64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i64>(42_u32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i64>(42_u16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i64>(42_u8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i64>(42_isize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i64>(42_i64);
+    foo::<i64>(42_i32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i64>(42_i16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i64>(42_i8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i64>(42.0_f64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i64>(42.0_f32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+}
diff --git a/src/test/ui/numeric/numeric-suffix/numeric-suffix-i64.stderr b/src/test/ui/numeric/numeric-suffix/numeric-suffix-i64.stderr
new file mode 100644 (file)
index 0000000..47efe9f
--- /dev/null
@@ -0,0 +1,201 @@
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-i64.rs:28:16
+   |
+LL |     foo::<i64>(42_usize);
+   |     ---------- ^^^^^^^^ expected `i64`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-i64.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `usize` to `i64`
+   |
+LL |     foo::<i64>(42_i64);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-i64.rs:32:16
+   |
+LL |     foo::<i64>(42_u64);
+   |     ---------- ^^^^^^ expected `i64`, found `u64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-i64.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u64` to `i64`
+   |
+LL |     foo::<i64>(42_i64);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-i64.rs:36:16
+   |
+LL |     foo::<i64>(42_u32);
+   |     ---------- ^^^^^^ expected `i64`, found `u32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-i64.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u32` to `i64`
+   |
+LL |     foo::<i64>(42_i64);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-i64.rs:40:16
+   |
+LL |     foo::<i64>(42_u16);
+   |     ---------- ^^^^^^ expected `i64`, found `u16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-i64.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u16` to `i64`
+   |
+LL |     foo::<i64>(42_i64);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-i64.rs:44:16
+   |
+LL |     foo::<i64>(42_u8);
+   |     ---------- ^^^^^ expected `i64`, found `u8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-i64.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u8` to `i64`
+   |
+LL |     foo::<i64>(42_i64);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-i64.rs:48:16
+   |
+LL |     foo::<i64>(42_isize);
+   |     ---------- ^^^^^^^^ expected `i64`, found `isize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-i64.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `isize` to `i64`
+   |
+LL |     foo::<i64>(42_i64);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-i64.rs:53:16
+   |
+LL |     foo::<i64>(42_i32);
+   |     ---------- ^^^^^^ expected `i64`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-i64.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i32` to `i64`
+   |
+LL |     foo::<i64>(42_i64);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-i64.rs:57:16
+   |
+LL |     foo::<i64>(42_i16);
+   |     ---------- ^^^^^^ expected `i64`, found `i16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-i64.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i16` to `i64`
+   |
+LL |     foo::<i64>(42_i64);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-i64.rs:61:16
+   |
+LL |     foo::<i64>(42_i8);
+   |     ---------- ^^^^^ expected `i64`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-i64.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i8` to `i64`
+   |
+LL |     foo::<i64>(42_i64);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-i64.rs:65:16
+   |
+LL |     foo::<i64>(42.0_f64);
+   |     ---------- ^^^^^^^^ expected `i64`, found `f64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-i64.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `f64` to `i64`
+   |
+LL |     foo::<i64>(42i64);
+   |                  ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-i64.rs:69:16
+   |
+LL |     foo::<i64>(42.0_f32);
+   |     ---------- ^^^^^^^^ expected `i64`, found `f32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-i64.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `f32` to `i64`
+   |
+LL |     foo::<i64>(42i64);
+   |                  ~~~
+
+error: aborting due to 11 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/numeric/numeric-suffix/numeric-suffix-isize.fixed b/src/test/ui/numeric/numeric-suffix/numeric-suffix-isize.fixed
new file mode 100644 (file)
index 0000000..faed65c
--- /dev/null
@@ -0,0 +1,73 @@
+// run-rustfix
+
+fn foo<N>(_x: N) {}
+//~^ NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+
+fn main() {
+    foo::<isize>(42_isize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<isize>(42_isize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<isize>(42_isize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<isize>(42_isize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<isize>(42_isize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<isize>(42_isize);
+    foo::<isize>(42_isize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<isize>(42_isize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<isize>(42_isize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<isize>(42_isize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<isize>(42isize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<isize>(42isize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+}
diff --git a/src/test/ui/numeric/numeric-suffix/numeric-suffix-isize.rs b/src/test/ui/numeric/numeric-suffix/numeric-suffix-isize.rs
new file mode 100644 (file)
index 0000000..df0b4cb
--- /dev/null
@@ -0,0 +1,73 @@
+// run-rustfix
+
+fn foo<N>(_x: N) {}
+//~^ NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+
+fn main() {
+    foo::<isize>(42_usize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<isize>(42_u64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<isize>(42_u32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<isize>(42_u16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<isize>(42_u8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<isize>(42_isize);
+    foo::<isize>(42_i64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<isize>(42_i32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<isize>(42_i16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<isize>(42_i8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<isize>(42.0_f64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<isize>(42.0_f32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+}
diff --git a/src/test/ui/numeric/numeric-suffix/numeric-suffix-isize.stderr b/src/test/ui/numeric/numeric-suffix/numeric-suffix-isize.stderr
new file mode 100644 (file)
index 0000000..28b7941
--- /dev/null
@@ -0,0 +1,201 @@
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-isize.rs:28:18
+   |
+LL |     foo::<isize>(42_usize);
+   |     ------------ ^^^^^^^^ expected `isize`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-isize.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `usize` to `isize`
+   |
+LL |     foo::<isize>(42_isize);
+   |                     ~~~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-isize.rs:32:18
+   |
+LL |     foo::<isize>(42_u64);
+   |     ------------ ^^^^^^ expected `isize`, found `u64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-isize.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u64` to `isize`
+   |
+LL |     foo::<isize>(42_isize);
+   |                     ~~~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-isize.rs:36:18
+   |
+LL |     foo::<isize>(42_u32);
+   |     ------------ ^^^^^^ expected `isize`, found `u32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-isize.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u32` to `isize`
+   |
+LL |     foo::<isize>(42_isize);
+   |                     ~~~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-isize.rs:40:18
+   |
+LL |     foo::<isize>(42_u16);
+   |     ------------ ^^^^^^ expected `isize`, found `u16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-isize.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u16` to `isize`
+   |
+LL |     foo::<isize>(42_isize);
+   |                     ~~~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-isize.rs:44:18
+   |
+LL |     foo::<isize>(42_u8);
+   |     ------------ ^^^^^ expected `isize`, found `u8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-isize.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u8` to `isize`
+   |
+LL |     foo::<isize>(42_isize);
+   |                     ~~~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-isize.rs:49:18
+   |
+LL |     foo::<isize>(42_i64);
+   |     ------------ ^^^^^^ expected `isize`, found `i64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-isize.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i64` to `isize`
+   |
+LL |     foo::<isize>(42_isize);
+   |                     ~~~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-isize.rs:53:18
+   |
+LL |     foo::<isize>(42_i32);
+   |     ------------ ^^^^^^ expected `isize`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-isize.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i32` to `isize`
+   |
+LL |     foo::<isize>(42_isize);
+   |                     ~~~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-isize.rs:57:18
+   |
+LL |     foo::<isize>(42_i16);
+   |     ------------ ^^^^^^ expected `isize`, found `i16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-isize.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i16` to `isize`
+   |
+LL |     foo::<isize>(42_isize);
+   |                     ~~~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-isize.rs:61:18
+   |
+LL |     foo::<isize>(42_i8);
+   |     ------------ ^^^^^ expected `isize`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-isize.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i8` to `isize`
+   |
+LL |     foo::<isize>(42_isize);
+   |                     ~~~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-isize.rs:65:18
+   |
+LL |     foo::<isize>(42.0_f64);
+   |     ------------ ^^^^^^^^ expected `isize`, found `f64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-isize.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `f64` to `isize`
+   |
+LL |     foo::<isize>(42isize);
+   |                    ~~~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-isize.rs:69:18
+   |
+LL |     foo::<isize>(42.0_f32);
+   |     ------------ ^^^^^^^^ expected `isize`, found `f32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-isize.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `f32` to `isize`
+   |
+LL |     foo::<isize>(42isize);
+   |                    ~~~~~
+
+error: aborting due to 11 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/numeric/numeric-suffix/numeric-suffix-u32.fixed b/src/test/ui/numeric/numeric-suffix/numeric-suffix-u32.fixed
new file mode 100644 (file)
index 0000000..5955829
--- /dev/null
@@ -0,0 +1,73 @@
+// run-rustfix
+
+fn foo<N>(_x: N) {}
+//~^ NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+
+fn main() {
+    foo::<u32>(42_u32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u32>(42_u32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u32>(42_u32);
+    foo::<u32>(42_u32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u32>(42_u32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u32>(42_u32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u32>(42_u32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u32>(42_u32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u32>(42_u32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u32>(42_u32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u32>(42u32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u32>(42u32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+}
diff --git a/src/test/ui/numeric/numeric-suffix/numeric-suffix-u32.rs b/src/test/ui/numeric/numeric-suffix/numeric-suffix-u32.rs
new file mode 100644 (file)
index 0000000..5c30303
--- /dev/null
@@ -0,0 +1,73 @@
+// run-rustfix
+
+fn foo<N>(_x: N) {}
+//~^ NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+
+fn main() {
+    foo::<u32>(42_usize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u32>(42_u64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u32>(42_u32);
+    foo::<u32>(42_u16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u32>(42_u8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u32>(42_isize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u32>(42_i64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u32>(42_i32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u32>(42_i16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u32>(42_i8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u32>(42.0_f64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u32>(42.0_f32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+}
diff --git a/src/test/ui/numeric/numeric-suffix/numeric-suffix-u32.stderr b/src/test/ui/numeric/numeric-suffix/numeric-suffix-u32.stderr
new file mode 100644 (file)
index 0000000..d966893
--- /dev/null
@@ -0,0 +1,201 @@
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-u32.rs:28:16
+   |
+LL |     foo::<u32>(42_usize);
+   |     ---------- ^^^^^^^^ expected `u32`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-u32.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `usize` to `u32`
+   |
+LL |     foo::<u32>(42_u32);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-u32.rs:32:16
+   |
+LL |     foo::<u32>(42_u64);
+   |     ---------- ^^^^^^ expected `u32`, found `u64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-u32.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u64` to `u32`
+   |
+LL |     foo::<u32>(42_u32);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-u32.rs:37:16
+   |
+LL |     foo::<u32>(42_u16);
+   |     ---------- ^^^^^^ expected `u32`, found `u16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-u32.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u16` to `u32`
+   |
+LL |     foo::<u32>(42_u32);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-u32.rs:41:16
+   |
+LL |     foo::<u32>(42_u8);
+   |     ---------- ^^^^^ expected `u32`, found `u8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-u32.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u8` to `u32`
+   |
+LL |     foo::<u32>(42_u32);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-u32.rs:45:16
+   |
+LL |     foo::<u32>(42_isize);
+   |     ---------- ^^^^^^^^ expected `u32`, found `isize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-u32.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `isize` to `u32`
+   |
+LL |     foo::<u32>(42_u32);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-u32.rs:49:16
+   |
+LL |     foo::<u32>(42_i64);
+   |     ---------- ^^^^^^ expected `u32`, found `i64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-u32.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i64` to `u32`
+   |
+LL |     foo::<u32>(42_u32);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-u32.rs:53:16
+   |
+LL |     foo::<u32>(42_i32);
+   |     ---------- ^^^^^^ expected `u32`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-u32.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i32` to `u32`
+   |
+LL |     foo::<u32>(42_u32);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-u32.rs:57:16
+   |
+LL |     foo::<u32>(42_i16);
+   |     ---------- ^^^^^^ expected `u32`, found `i16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-u32.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i16` to `u32`
+   |
+LL |     foo::<u32>(42_u32);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-u32.rs:61:16
+   |
+LL |     foo::<u32>(42_i8);
+   |     ---------- ^^^^^ expected `u32`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-u32.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i8` to `u32`
+   |
+LL |     foo::<u32>(42_u32);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-u32.rs:65:16
+   |
+LL |     foo::<u32>(42.0_f64);
+   |     ---------- ^^^^^^^^ expected `u32`, found `f64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-u32.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `f64` to `u32`
+   |
+LL |     foo::<u32>(42u32);
+   |                  ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-u32.rs:69:16
+   |
+LL |     foo::<u32>(42.0_f32);
+   |     ---------- ^^^^^^^^ expected `u32`, found `f32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-u32.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `f32` to `u32`
+   |
+LL |     foo::<u32>(42u32);
+   |                  ~~~
+
+error: aborting due to 11 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/numeric/numeric-suffix/numeric-suffix-u64.fixed b/src/test/ui/numeric/numeric-suffix/numeric-suffix-u64.fixed
new file mode 100644 (file)
index 0000000..4623c21
--- /dev/null
@@ -0,0 +1,73 @@
+// run-rustfix
+
+fn foo<N>(_x: N) {}
+//~^ NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+
+fn main() {
+    foo::<u64>(42_u64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u64>(42_u64);
+    foo::<u64>(42_u64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u64>(42_u64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u64>(42_u64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u64>(42_u64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u64>(42_u64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u64>(42_u64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u64>(42_u64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u64>(42_u64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u64>(42u64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u64>(42u64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+}
diff --git a/src/test/ui/numeric/numeric-suffix/numeric-suffix-u64.rs b/src/test/ui/numeric/numeric-suffix/numeric-suffix-u64.rs
new file mode 100644 (file)
index 0000000..3e9995c
--- /dev/null
@@ -0,0 +1,73 @@
+// run-rustfix
+
+fn foo<N>(_x: N) {}
+//~^ NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+
+fn main() {
+    foo::<u64>(42_usize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u64>(42_u64);
+    foo::<u64>(42_u32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u64>(42_u16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u64>(42_u8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u64>(42_isize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u64>(42_i64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u64>(42_i32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u64>(42_i16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u64>(42_i8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u64>(42.0_f64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u64>(42.0_f32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+}
diff --git a/src/test/ui/numeric/numeric-suffix/numeric-suffix-u64.stderr b/src/test/ui/numeric/numeric-suffix/numeric-suffix-u64.stderr
new file mode 100644 (file)
index 0000000..ff332fa
--- /dev/null
@@ -0,0 +1,201 @@
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-u64.rs:28:16
+   |
+LL |     foo::<u64>(42_usize);
+   |     ---------- ^^^^^^^^ expected `u64`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-u64.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `usize` to `u64`
+   |
+LL |     foo::<u64>(42_u64);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-u64.rs:33:16
+   |
+LL |     foo::<u64>(42_u32);
+   |     ---------- ^^^^^^ expected `u64`, found `u32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-u64.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u32` to `u64`
+   |
+LL |     foo::<u64>(42_u64);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-u64.rs:37:16
+   |
+LL |     foo::<u64>(42_u16);
+   |     ---------- ^^^^^^ expected `u64`, found `u16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-u64.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u16` to `u64`
+   |
+LL |     foo::<u64>(42_u64);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-u64.rs:41:16
+   |
+LL |     foo::<u64>(42_u8);
+   |     ---------- ^^^^^ expected `u64`, found `u8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-u64.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u8` to `u64`
+   |
+LL |     foo::<u64>(42_u64);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-u64.rs:45:16
+   |
+LL |     foo::<u64>(42_isize);
+   |     ---------- ^^^^^^^^ expected `u64`, found `isize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-u64.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `isize` to `u64`
+   |
+LL |     foo::<u64>(42_u64);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-u64.rs:49:16
+   |
+LL |     foo::<u64>(42_i64);
+   |     ---------- ^^^^^^ expected `u64`, found `i64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-u64.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i64` to `u64`
+   |
+LL |     foo::<u64>(42_u64);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-u64.rs:53:16
+   |
+LL |     foo::<u64>(42_i32);
+   |     ---------- ^^^^^^ expected `u64`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-u64.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i32` to `u64`
+   |
+LL |     foo::<u64>(42_u64);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-u64.rs:57:16
+   |
+LL |     foo::<u64>(42_i16);
+   |     ---------- ^^^^^^ expected `u64`, found `i16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-u64.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i16` to `u64`
+   |
+LL |     foo::<u64>(42_u64);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-u64.rs:61:16
+   |
+LL |     foo::<u64>(42_i8);
+   |     ---------- ^^^^^ expected `u64`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-u64.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i8` to `u64`
+   |
+LL |     foo::<u64>(42_u64);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-u64.rs:65:16
+   |
+LL |     foo::<u64>(42.0_f64);
+   |     ---------- ^^^^^^^^ expected `u64`, found `f64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-u64.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `f64` to `u64`
+   |
+LL |     foo::<u64>(42u64);
+   |                  ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-u64.rs:69:16
+   |
+LL |     foo::<u64>(42.0_f32);
+   |     ---------- ^^^^^^^^ expected `u64`, found `f32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-u64.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `f32` to `u64`
+   |
+LL |     foo::<u64>(42u64);
+   |                  ~~~
+
+error: aborting due to 11 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/numeric/numeric-suffix/numeric-suffix-usize.fixed b/src/test/ui/numeric/numeric-suffix/numeric-suffix-usize.fixed
new file mode 100644 (file)
index 0000000..6cb5243
--- /dev/null
@@ -0,0 +1,73 @@
+// run-rustfix
+
+fn foo<N>(_x: N) {}
+//~^ NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+
+fn main() {
+    foo::<usize>(42_usize);
+    foo::<usize>(42_usize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<usize>(42_usize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<usize>(42_usize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<usize>(42_usize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<usize>(42_usize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<usize>(42_usize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<usize>(42_usize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<usize>(42_usize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<usize>(42_usize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<usize>(42usize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<usize>(42usize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+}
diff --git a/src/test/ui/numeric/numeric-suffix/numeric-suffix-usize.rs b/src/test/ui/numeric/numeric-suffix/numeric-suffix-usize.rs
new file mode 100644 (file)
index 0000000..a2304ba
--- /dev/null
@@ -0,0 +1,73 @@
+// run-rustfix
+
+fn foo<N>(_x: N) {}
+//~^ NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+
+fn main() {
+    foo::<usize>(42_usize);
+    foo::<usize>(42_u64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<usize>(42_u32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<usize>(42_u16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<usize>(42_u8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<usize>(42_isize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<usize>(42_i64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<usize>(42_i32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<usize>(42_i16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<usize>(42_i8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<usize>(42.0_f64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<usize>(42.0_f32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+}
diff --git a/src/test/ui/numeric/numeric-suffix/numeric-suffix-usize.stderr b/src/test/ui/numeric/numeric-suffix/numeric-suffix-usize.stderr
new file mode 100644 (file)
index 0000000..4889abe
--- /dev/null
@@ -0,0 +1,201 @@
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-usize.rs:29:18
+   |
+LL |     foo::<usize>(42_u64);
+   |     ------------ ^^^^^^ expected `usize`, found `u64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-usize.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u64` to `usize`
+   |
+LL |     foo::<usize>(42_usize);
+   |                     ~~~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-usize.rs:33:18
+   |
+LL |     foo::<usize>(42_u32);
+   |     ------------ ^^^^^^ expected `usize`, found `u32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-usize.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u32` to `usize`
+   |
+LL |     foo::<usize>(42_usize);
+   |                     ~~~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-usize.rs:37:18
+   |
+LL |     foo::<usize>(42_u16);
+   |     ------------ ^^^^^^ expected `usize`, found `u16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-usize.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u16` to `usize`
+   |
+LL |     foo::<usize>(42_usize);
+   |                     ~~~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-usize.rs:41:18
+   |
+LL |     foo::<usize>(42_u8);
+   |     ------------ ^^^^^ expected `usize`, found `u8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-usize.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u8` to `usize`
+   |
+LL |     foo::<usize>(42_usize);
+   |                     ~~~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-usize.rs:45:18
+   |
+LL |     foo::<usize>(42_isize);
+   |     ------------ ^^^^^^^^ expected `usize`, found `isize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-usize.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `isize` to `usize`
+   |
+LL |     foo::<usize>(42_usize);
+   |                     ~~~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-usize.rs:49:18
+   |
+LL |     foo::<usize>(42_i64);
+   |     ------------ ^^^^^^ expected `usize`, found `i64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-usize.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i64` to `usize`
+   |
+LL |     foo::<usize>(42_usize);
+   |                     ~~~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-usize.rs:53:18
+   |
+LL |     foo::<usize>(42_i32);
+   |     ------------ ^^^^^^ expected `usize`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-usize.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i32` to `usize`
+   |
+LL |     foo::<usize>(42_usize);
+   |                     ~~~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-usize.rs:57:18
+   |
+LL |     foo::<usize>(42_i16);
+   |     ------------ ^^^^^^ expected `usize`, found `i16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-usize.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i16` to `usize`
+   |
+LL |     foo::<usize>(42_usize);
+   |                     ~~~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-usize.rs:61:18
+   |
+LL |     foo::<usize>(42_i8);
+   |     ------------ ^^^^^ expected `usize`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-usize.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i8` to `usize`
+   |
+LL |     foo::<usize>(42_usize);
+   |                     ~~~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-usize.rs:65:18
+   |
+LL |     foo::<usize>(42.0_f64);
+   |     ------------ ^^^^^^^^ expected `usize`, found `f64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-usize.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `f64` to `usize`
+   |
+LL |     foo::<usize>(42usize);
+   |                    ~~~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix-usize.rs:69:18
+   |
+LL |     foo::<usize>(42.0_f32);
+   |     ------------ ^^^^^^^^ expected `usize`, found `f32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix-usize.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `f32` to `usize`
+   |
+LL |     foo::<usize>(42usize);
+   |                    ~~~~~
+
+error: aborting due to 11 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
diff --git a/src/test/ui/numeric/numeric-suffix/numeric-suffix.fixed b/src/test/ui/numeric/numeric-suffix/numeric-suffix.fixed
new file mode 100644 (file)
index 0000000..69934db
--- /dev/null
@@ -0,0 +1,427 @@
+// run-rustfix
+
+fn foo<N>(_x: N) {}
+//~^ NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+
+
+fn main() {
+    foo::<u16>(42_u16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u16>(42_u16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u16>(42_u16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u16>(42_u16);
+    foo::<u16>(42_u16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u16>(42_u16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u16>(42_u16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u16>(42_u16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u16>(42_u16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u16>(42_u16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u16>(42u16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u16>(42u16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+
+    foo::<i16>(42_i16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i16>(42_i16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i16>(42_i16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i16>(42_i16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i16>(42_i16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i16>(42_i16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i16>(42_i16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i16>(42_i16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i16>(42_i16);
+    foo::<i16>(42_i16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i16>(42i16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i16>(42i16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+
+    foo::<u8>(42_u8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u8>(42_u8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u8>(42_u8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u8>(42_u8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u8>(42_u8);
+    foo::<u8>(42_u8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u8>(42_u8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u8>(42_u8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u8>(42_u8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u8>(42_u8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u8>(42u8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u8>(42u8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+
+    foo::<i8>(42_i8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i8>(42_i8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i8>(42_i8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i8>(42_i8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i8>(42_i8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i8>(42_i8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i8>(42_i8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i8>(42_i8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i8>(42_i8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i8>(42_i8);
+    foo::<i8>(42i8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i8>(42i8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+
+    foo::<f64>(42_f64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f64>(42_f64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f64>(42_u32.into());
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f64>(42_u16.into());
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f64>(42_u8.into());
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f64>(42_f64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f64>(42_f64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f64>(42_i32.into());
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f64>(42_i16.into());
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f64>(42_i8.into());
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f64>(42.0_f64);
+    foo::<f64>(42.0_f64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+
+    foo::<f32>(42_f32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f32>(42_f32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f32>(42_f32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f32>(42_u16.into());
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f32>(42_u8.into());
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f32>(42_f32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f32>(42_f32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f32>(42_f32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f32>(42_i16.into());
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f32>(42_i8.into());
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f32>(42.0_f32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f32>(42.0_f32);
+
+    foo::<u32>((42_u8 as u16).into());
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i32>((-42_i8).into());
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+}
diff --git a/src/test/ui/numeric/numeric-suffix/numeric-suffix.rs b/src/test/ui/numeric/numeric-suffix/numeric-suffix.rs
new file mode 100644 (file)
index 0000000..dabf43f
--- /dev/null
@@ -0,0 +1,427 @@
+// run-rustfix
+
+fn foo<N>(_x: N) {}
+//~^ NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE function defined here
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+//~| NOTE
+
+
+fn main() {
+    foo::<u16>(42_usize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u16>(42_u64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u16>(42_u32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u16>(42_u16);
+    foo::<u16>(42_u8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u16>(42_isize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u16>(42_i64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u16>(42_i32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u16>(42_i16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u16>(42_i8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u16>(42.0_f64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u16>(42.0_f32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+
+    foo::<i16>(42_usize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i16>(42_u64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i16>(42_u32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i16>(42_u16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i16>(42_u8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i16>(42_isize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i16>(42_i64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i16>(42_i32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i16>(42_i16);
+    foo::<i16>(42_i8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i16>(42.0_f64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i16>(42.0_f32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+
+    foo::<u8>(42_usize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u8>(42_u64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u8>(42_u32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u8>(42_u16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u8>(42_u8);
+    foo::<u8>(42_isize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u8>(42_i64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u8>(42_i32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u8>(42_i16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u8>(42_i8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u8>(42.0_f64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<u8>(42.0_f32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+
+    foo::<i8>(42_usize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i8>(42_u64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i8>(42_u32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i8>(42_u16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i8>(42_u8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i8>(42_isize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i8>(42_i64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i8>(42_i32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i8>(42_i16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i8>(42_i8);
+    foo::<i8>(42.0_f64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i8>(42.0_f32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+
+    foo::<f64>(42_usize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f64>(42_u64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f64>(42_u32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f64>(42_u16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f64>(42_u8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f64>(42_isize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f64>(42_i64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f64>(42_i32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f64>(42_i16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f64>(42_i8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f64>(42.0_f64);
+    foo::<f64>(42.0_f32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+
+    foo::<f32>(42_usize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f32>(42_u64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f32>(42_u32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f32>(42_u16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f32>(42_u8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f32>(42_isize);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f32>(42_i64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f32>(42_i32);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f32>(42_i16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f32>(42_i8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f32>(42.0_f64);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<f32>(42.0_f32);
+
+    foo::<u32>(42_u8 as u16);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+    foo::<i32>(-42_i8);
+    //~^ ERROR mismatched types
+    //~| NOTE expected
+    //~| NOTE arguments
+}
diff --git a/src/test/ui/numeric/numeric-suffix/numeric-suffix.stderr b/src/test/ui/numeric/numeric-suffix/numeric-suffix.stderr
new file mode 100644 (file)
index 0000000..e05913b
--- /dev/null
@@ -0,0 +1,1227 @@
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:143:16
+   |
+LL |     foo::<u16>(42_usize);
+   |     ---------- ^^^^^^^^ expected `u16`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `usize` to `u16`
+   |
+LL |     foo::<u16>(42_u16);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:147:16
+   |
+LL |     foo::<u16>(42_u64);
+   |     ---------- ^^^^^^ expected `u16`, found `u64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u64` to `u16`
+   |
+LL |     foo::<u16>(42_u16);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:151:16
+   |
+LL |     foo::<u16>(42_u32);
+   |     ---------- ^^^^^^ expected `u16`, found `u32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u32` to `u16`
+   |
+LL |     foo::<u16>(42_u16);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:156:16
+   |
+LL |     foo::<u16>(42_u8);
+   |     ---------- ^^^^^ expected `u16`, found `u8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u8` to `u16`
+   |
+LL |     foo::<u16>(42_u16);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:160:16
+   |
+LL |     foo::<u16>(42_isize);
+   |     ---------- ^^^^^^^^ expected `u16`, found `isize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `isize` to `u16`
+   |
+LL |     foo::<u16>(42_u16);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:164:16
+   |
+LL |     foo::<u16>(42_i64);
+   |     ---------- ^^^^^^ expected `u16`, found `i64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i64` to `u16`
+   |
+LL |     foo::<u16>(42_u16);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:168:16
+   |
+LL |     foo::<u16>(42_i32);
+   |     ---------- ^^^^^^ expected `u16`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i32` to `u16`
+   |
+LL |     foo::<u16>(42_u16);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:172:16
+   |
+LL |     foo::<u16>(42_i16);
+   |     ---------- ^^^^^^ expected `u16`, found `i16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i16` to `u16`
+   |
+LL |     foo::<u16>(42_u16);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:176:16
+   |
+LL |     foo::<u16>(42_i8);
+   |     ---------- ^^^^^ expected `u16`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i8` to `u16`
+   |
+LL |     foo::<u16>(42_u16);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:180:16
+   |
+LL |     foo::<u16>(42.0_f64);
+   |     ---------- ^^^^^^^^ expected `u16`, found `f64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `f64` to `u16`
+   |
+LL |     foo::<u16>(42u16);
+   |                  ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:184:16
+   |
+LL |     foo::<u16>(42.0_f32);
+   |     ---------- ^^^^^^^^ expected `u16`, found `f32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `f32` to `u16`
+   |
+LL |     foo::<u16>(42u16);
+   |                  ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:189:16
+   |
+LL |     foo::<i16>(42_usize);
+   |     ---------- ^^^^^^^^ expected `i16`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `usize` to `i16`
+   |
+LL |     foo::<i16>(42_i16);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:193:16
+   |
+LL |     foo::<i16>(42_u64);
+   |     ---------- ^^^^^^ expected `i16`, found `u64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u64` to `i16`
+   |
+LL |     foo::<i16>(42_i16);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:197:16
+   |
+LL |     foo::<i16>(42_u32);
+   |     ---------- ^^^^^^ expected `i16`, found `u32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u32` to `i16`
+   |
+LL |     foo::<i16>(42_i16);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:201:16
+   |
+LL |     foo::<i16>(42_u16);
+   |     ---------- ^^^^^^ expected `i16`, found `u16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u16` to `i16`
+   |
+LL |     foo::<i16>(42_i16);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:205:16
+   |
+LL |     foo::<i16>(42_u8);
+   |     ---------- ^^^^^ expected `i16`, found `u8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u8` to `i16`
+   |
+LL |     foo::<i16>(42_i16);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:209:16
+   |
+LL |     foo::<i16>(42_isize);
+   |     ---------- ^^^^^^^^ expected `i16`, found `isize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `isize` to `i16`
+   |
+LL |     foo::<i16>(42_i16);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:213:16
+   |
+LL |     foo::<i16>(42_i64);
+   |     ---------- ^^^^^^ expected `i16`, found `i64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i64` to `i16`
+   |
+LL |     foo::<i16>(42_i16);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:217:16
+   |
+LL |     foo::<i16>(42_i32);
+   |     ---------- ^^^^^^ expected `i16`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i32` to `i16`
+   |
+LL |     foo::<i16>(42_i16);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:222:16
+   |
+LL |     foo::<i16>(42_i8);
+   |     ---------- ^^^^^ expected `i16`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i8` to `i16`
+   |
+LL |     foo::<i16>(42_i16);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:226:16
+   |
+LL |     foo::<i16>(42.0_f64);
+   |     ---------- ^^^^^^^^ expected `i16`, found `f64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `f64` to `i16`
+   |
+LL |     foo::<i16>(42i16);
+   |                  ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:230:16
+   |
+LL |     foo::<i16>(42.0_f32);
+   |     ---------- ^^^^^^^^ expected `i16`, found `f32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `f32` to `i16`
+   |
+LL |     foo::<i16>(42i16);
+   |                  ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:235:15
+   |
+LL |     foo::<u8>(42_usize);
+   |     --------- ^^^^^^^^ expected `u8`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `usize` to `u8`
+   |
+LL |     foo::<u8>(42_u8);
+   |                  ~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:239:15
+   |
+LL |     foo::<u8>(42_u64);
+   |     --------- ^^^^^^ expected `u8`, found `u64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u64` to `u8`
+   |
+LL |     foo::<u8>(42_u8);
+   |                  ~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:243:15
+   |
+LL |     foo::<u8>(42_u32);
+   |     --------- ^^^^^^ expected `u8`, found `u32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u32` to `u8`
+   |
+LL |     foo::<u8>(42_u8);
+   |                  ~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:247:15
+   |
+LL |     foo::<u8>(42_u16);
+   |     --------- ^^^^^^ expected `u8`, found `u16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u16` to `u8`
+   |
+LL |     foo::<u8>(42_u8);
+   |                  ~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:252:15
+   |
+LL |     foo::<u8>(42_isize);
+   |     --------- ^^^^^^^^ expected `u8`, found `isize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `isize` to `u8`
+   |
+LL |     foo::<u8>(42_u8);
+   |                  ~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:256:15
+   |
+LL |     foo::<u8>(42_i64);
+   |     --------- ^^^^^^ expected `u8`, found `i64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i64` to `u8`
+   |
+LL |     foo::<u8>(42_u8);
+   |                  ~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:260:15
+   |
+LL |     foo::<u8>(42_i32);
+   |     --------- ^^^^^^ expected `u8`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i32` to `u8`
+   |
+LL |     foo::<u8>(42_u8);
+   |                  ~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:264:15
+   |
+LL |     foo::<u8>(42_i16);
+   |     --------- ^^^^^^ expected `u8`, found `i16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i16` to `u8`
+   |
+LL |     foo::<u8>(42_u8);
+   |                  ~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:268:15
+   |
+LL |     foo::<u8>(42_i8);
+   |     --------- ^^^^^ expected `u8`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i8` to `u8`
+   |
+LL |     foo::<u8>(42_u8);
+   |                  ~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:272:15
+   |
+LL |     foo::<u8>(42.0_f64);
+   |     --------- ^^^^^^^^ expected `u8`, found `f64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `f64` to `u8`
+   |
+LL |     foo::<u8>(42u8);
+   |                 ~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:276:15
+   |
+LL |     foo::<u8>(42.0_f32);
+   |     --------- ^^^^^^^^ expected `u8`, found `f32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `f32` to `u8`
+   |
+LL |     foo::<u8>(42u8);
+   |                 ~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:281:15
+   |
+LL |     foo::<i8>(42_usize);
+   |     --------- ^^^^^^^^ expected `i8`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `usize` to `i8`
+   |
+LL |     foo::<i8>(42_i8);
+   |                  ~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:285:15
+   |
+LL |     foo::<i8>(42_u64);
+   |     --------- ^^^^^^ expected `i8`, found `u64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u64` to `i8`
+   |
+LL |     foo::<i8>(42_i8);
+   |                  ~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:289:15
+   |
+LL |     foo::<i8>(42_u32);
+   |     --------- ^^^^^^ expected `i8`, found `u32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u32` to `i8`
+   |
+LL |     foo::<i8>(42_i8);
+   |                  ~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:293:15
+   |
+LL |     foo::<i8>(42_u16);
+   |     --------- ^^^^^^ expected `i8`, found `u16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u16` to `i8`
+   |
+LL |     foo::<i8>(42_i8);
+   |                  ~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:297:15
+   |
+LL |     foo::<i8>(42_u8);
+   |     --------- ^^^^^ expected `i8`, found `u8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u8` to `i8`
+   |
+LL |     foo::<i8>(42_i8);
+   |                  ~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:301:15
+   |
+LL |     foo::<i8>(42_isize);
+   |     --------- ^^^^^^^^ expected `i8`, found `isize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `isize` to `i8`
+   |
+LL |     foo::<i8>(42_i8);
+   |                  ~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:305:15
+   |
+LL |     foo::<i8>(42_i64);
+   |     --------- ^^^^^^ expected `i8`, found `i64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i64` to `i8`
+   |
+LL |     foo::<i8>(42_i8);
+   |                  ~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:309:15
+   |
+LL |     foo::<i8>(42_i32);
+   |     --------- ^^^^^^ expected `i8`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i32` to `i8`
+   |
+LL |     foo::<i8>(42_i8);
+   |                  ~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:313:15
+   |
+LL |     foo::<i8>(42_i16);
+   |     --------- ^^^^^^ expected `i8`, found `i16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i16` to `i8`
+   |
+LL |     foo::<i8>(42_i8);
+   |                  ~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:318:15
+   |
+LL |     foo::<i8>(42.0_f64);
+   |     --------- ^^^^^^^^ expected `i8`, found `f64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `f64` to `i8`
+   |
+LL |     foo::<i8>(42i8);
+   |                 ~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:322:15
+   |
+LL |     foo::<i8>(42.0_f32);
+   |     --------- ^^^^^^^^ expected `i8`, found `f32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `f32` to `i8`
+   |
+LL |     foo::<i8>(42i8);
+   |                 ~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:327:16
+   |
+LL |     foo::<f64>(42_usize);
+   |     ---------- ^^^^^^^^ expected `f64`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `usize` to `f64`
+   |
+LL |     foo::<f64>(42_f64);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:331:16
+   |
+LL |     foo::<f64>(42_u64);
+   |     ---------- ^^^^^^ expected `f64`, found `u64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u64` to `f64`
+   |
+LL |     foo::<f64>(42_f64);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:335:16
+   |
+LL |     foo::<f64>(42_u32);
+   |     ---------- ^^^^^^ expected `f64`, found `u32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: you can convert a `u32` to an `f64`, producing the floating point representation of the integer
+   |
+LL |     foo::<f64>(42_u32.into());
+   |                      +++++++
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:339:16
+   |
+LL |     foo::<f64>(42_u16);
+   |     ---------- ^^^^^^ expected `f64`, found `u16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: you can convert a `u16` to an `f64`, producing the floating point representation of the integer
+   |
+LL |     foo::<f64>(42_u16.into());
+   |                      +++++++
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:343:16
+   |
+LL |     foo::<f64>(42_u8);
+   |     ---------- ^^^^^ expected `f64`, found `u8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: you can convert a `u8` to an `f64`, producing the floating point representation of the integer
+   |
+LL |     foo::<f64>(42_u8.into());
+   |                     +++++++
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:347:16
+   |
+LL |     foo::<f64>(42_isize);
+   |     ---------- ^^^^^^^^ expected `f64`, found `isize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `isize` to `f64`
+   |
+LL |     foo::<f64>(42_f64);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:351:16
+   |
+LL |     foo::<f64>(42_i64);
+   |     ---------- ^^^^^^ expected `f64`, found `i64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i64` to `f64`
+   |
+LL |     foo::<f64>(42_f64);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:355:16
+   |
+LL |     foo::<f64>(42_i32);
+   |     ---------- ^^^^^^ expected `f64`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: you can convert an `i32` to an `f64`, producing the floating point representation of the integer
+   |
+LL |     foo::<f64>(42_i32.into());
+   |                      +++++++
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:359:16
+   |
+LL |     foo::<f64>(42_i16);
+   |     ---------- ^^^^^^ expected `f64`, found `i16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: you can convert an `i16` to an `f64`, producing the floating point representation of the integer
+   |
+LL |     foo::<f64>(42_i16.into());
+   |                      +++++++
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:363:16
+   |
+LL |     foo::<f64>(42_i8);
+   |     ---------- ^^^^^ expected `f64`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: you can convert an `i8` to an `f64`, producing the floating point representation of the integer
+   |
+LL |     foo::<f64>(42_i8.into());
+   |                     +++++++
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:368:16
+   |
+LL |     foo::<f64>(42.0_f32);
+   |     ---------- ^^^^^^^^ expected `f64`, found `f32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `f32` to `f64`
+   |
+LL |     foo::<f64>(42.0_f64);
+   |                     ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:373:16
+   |
+LL |     foo::<f32>(42_usize);
+   |     ---------- ^^^^^^^^ expected `f32`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `usize` to `f32`
+   |
+LL |     foo::<f32>(42_f32);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:377:16
+   |
+LL |     foo::<f32>(42_u64);
+   |     ---------- ^^^^^^ expected `f32`, found `u64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u64` to `f32`
+   |
+LL |     foo::<f32>(42_f32);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:381:16
+   |
+LL |     foo::<f32>(42_u32);
+   |     ---------- ^^^^^^ expected `f32`, found `u32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `u32` to `f32`
+   |
+LL |     foo::<f32>(42_f32);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:385:16
+   |
+LL |     foo::<f32>(42_u16);
+   |     ---------- ^^^^^^ expected `f32`, found `u16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: you can convert a `u16` to an `f32`, producing the floating point representation of the integer
+   |
+LL |     foo::<f32>(42_u16.into());
+   |                      +++++++
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:389:16
+   |
+LL |     foo::<f32>(42_u8);
+   |     ---------- ^^^^^ expected `f32`, found `u8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: you can convert a `u8` to an `f32`, producing the floating point representation of the integer
+   |
+LL |     foo::<f32>(42_u8.into());
+   |                     +++++++
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:393:16
+   |
+LL |     foo::<f32>(42_isize);
+   |     ---------- ^^^^^^^^ expected `f32`, found `isize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `isize` to `f32`
+   |
+LL |     foo::<f32>(42_f32);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:397:16
+   |
+LL |     foo::<f32>(42_i64);
+   |     ---------- ^^^^^^ expected `f32`, found `i64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i64` to `f32`
+   |
+LL |     foo::<f32>(42_f32);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:401:16
+   |
+LL |     foo::<f32>(42_i32);
+   |     ---------- ^^^^^^ expected `f32`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `i32` to `f32`
+   |
+LL |     foo::<f32>(42_f32);
+   |                   ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:405:16
+   |
+LL |     foo::<f32>(42_i16);
+   |     ---------- ^^^^^^ expected `f32`, found `i16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: you can convert an `i16` to an `f32`, producing the floating point representation of the integer
+   |
+LL |     foo::<f32>(42_i16.into());
+   |                      +++++++
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:409:16
+   |
+LL |     foo::<f32>(42_i8);
+   |     ---------- ^^^^^ expected `f32`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: you can convert an `i8` to an `f32`, producing the floating point representation of the integer
+   |
+LL |     foo::<f32>(42_i8.into());
+   |                     +++++++
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:413:16
+   |
+LL |     foo::<f32>(42.0_f64);
+   |     ---------- ^^^^^^^^ expected `f32`, found `f64`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: change the type of the numeric literal from `f64` to `f32`
+   |
+LL |     foo::<f32>(42.0_f32);
+   |                     ~~~
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:419:16
+   |
+LL |     foo::<u32>(42_u8 as u16);
+   |     ---------- ^^^^^^^^^^^^ expected `u32`, found `u16`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: you can convert a `u16` to a `u32`
+   |
+LL |     foo::<u32>((42_u8 as u16).into());
+   |                +            ++++++++
+
+error[E0308]: mismatched types
+  --> $DIR/numeric-suffix.rs:423:16
+   |
+LL |     foo::<i32>(-42_i8);
+   |     ---------- ^^^^^^ expected `i32`, found `i8`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/numeric-suffix.rs:3:4
+   |
+LL | fn foo<N>(_x: N) {}
+   |    ^^^    -----
+help: you can convert an `i8` to an `i32`
+   |
+LL |     foo::<i32>((-42_i8).into());
+   |                +      ++++++++
+
+error: aborting due to 68 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
index 2d1554183ccccb8b9693cd7b12fcfccb0fa91764..21d753ad037253c09ba0fc1176bc643a1cd6b619 100644 (file)
@@ -1,26 +1,30 @@
-pub fn f(
+pub fn f( //~ NOTE function defined here
     /// Comment
     //~^ ERROR documentation comments cannot be applied to function parameters
     //~| NOTE doc comments are not allowed here
+    //~| NOTE
     id: u8,
     /// Other
     //~^ ERROR documentation comments cannot be applied to function parameters
     //~| NOTE doc comments are not allowed here
+    //~| NOTE
     a: u8,
 ) {}
 
 fn bar(id: #[allow(dead_code)] i32) {}
 //~^ ERROR attributes cannot be applied to a function parameter's type
 //~| NOTE attributes are not allowed here
+//~| NOTE function defined here
+//~| NOTE
 
 fn main() {
     // verify that the parser recovered and properly typechecked the args
     f("", "");
-    //~^ ERROR mismatched types
+    //~^ ERROR arguments to this function are incorrect
     //~| NOTE expected `u8`, found `&str`
-    //~| ERROR mismatched types
     //~| NOTE expected `u8`, found `&str`
     bar("");
     //~^ ERROR mismatched types
+    //~| NOTE arguments to this function are incorrect
     //~| NOTE expected `i32`, found `&str`
 }
index 41f2c080b9465532d553f9d2febab3c791f8fb1d..c8d7e2efe799d5c876f76ebbed08e36c12239781 100644 (file)
@@ -1,5 +1,5 @@
 error: attributes cannot be applied to a function parameter's type
-  --> $DIR/fn-arg-doc-comment.rs:12:12
+  --> $DIR/fn-arg-doc-comment.rs:14:12
    |
 LL | fn bar(id: #[allow(dead_code)] i32) {}
    |            ^^^^^^^^^^^^^^^^^^^ attributes are not allowed here
@@ -11,29 +11,51 @@ LL |     /// Comment
    |     ^^^^^^^^^^^ doc comments are not allowed here
 
 error: documentation comments cannot be applied to function parameters
-  --> $DIR/fn-arg-doc-comment.rs:6:5
+  --> $DIR/fn-arg-doc-comment.rs:7:5
    |
 LL |     /// Other
    |     ^^^^^^^^^ doc comments are not allowed here
 
-error[E0308]: mismatched types
-  --> $DIR/fn-arg-doc-comment.rs:18:7
+error[E0308]: arguments to this function are incorrect
+  --> $DIR/fn-arg-doc-comment.rs:22:5
    |
 LL |     f("", "");
-   |       ^^ expected `u8`, found `&str`
-
-error[E0308]: mismatched types
-  --> $DIR/fn-arg-doc-comment.rs:18:11
+   |     ^ --  -- expected `u8`, found `&str`
+   |       |
+   |       expected `u8`, found `&str`
    |
-LL |     f("", "");
-   |           ^^ expected `u8`, found `&str`
+note: function defined here
+  --> $DIR/fn-arg-doc-comment.rs:1:8
+   |
+LL |   pub fn f(
+   |          ^
+LL | /     /// Comment
+LL | |
+LL | |
+LL | |
+LL | |     id: u8,
+   | |__________-
+LL | /     /// Other
+LL | |
+LL | |
+LL | |
+LL | |     a: u8,
+   | |_________-
 
 error[E0308]: mismatched types
-  --> $DIR/fn-arg-doc-comment.rs:23:9
+  --> $DIR/fn-arg-doc-comment.rs:26:9
    |
 LL |     bar("");
-   |         ^^ expected `i32`, found `&str`
+   |     --- ^^ expected `i32`, found `&str`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/fn-arg-doc-comment.rs:14:4
+   |
+LL | fn bar(id: #[allow(dead_code)] i32) {}
+   |    ^^^ ---------------------------
 
-error: aborting due to 6 previous errors
+error: aborting due to 5 previous errors
 
 For more information about this error, try `rustc --explain E0308`.
index c800afdae2afb4ef205fbfdce14a090139c75504..4c2eff63ab5e839b277ef317b3b7a31b0c138ba7 100644 (file)
@@ -46,7 +46,15 @@ error[E0308]: mismatched types
   --> $DIR/pattern-error-continue.rs:28:7
    |
 LL |     f(true);
-   |       ^^^^ expected `char`, found `bool`
+   |     - ^^^^ expected `char`, found `bool`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/pattern-error-continue.rs:13:4
+   |
+LL | fn f(_c: char) {}
+   |    ^ --------
 
 error: aborting due to 5 previous errors
 
index 80a459c41257fab71d9309952db32d518c857f08..262a64acc544c20e60b22e1af0e493f7cd8e560a 100644 (file)
@@ -9,6 +9,11 @@ LL | | }
    |
    = note: expected fn pointer `fn(proc_macro::TokenStream) -> proc_macro::TokenStream`
                  found fn item `unsafe extern "C" fn(i32, u32) -> u32 {foo}`
+note: associated function defined here
+  --> $SRC_DIR/proc_macro/src/bridge/client.rs:LL:COL
+   |
+LL |     pub const fn custom_derive(
+   |                  ^^^^^^^^^^^^^
 
 error: aborting due to previous error
 
index 065e16a8227ca1e313f99f2f07a3637c716d3754..4cbf8869d0c59b4723857e55a21c45fd4adbbb96 100644 (file)
@@ -2,145 +2,217 @@ error[E0308]: mismatched types
   --> $DIR/issue-54505-no-literals.rs:16:16
    |
 LL |     take_range(std::ops::Range { start: 0, end: 1 });
-   |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |                |
-   |                expected reference, found struct `std::ops::Range`
-   |                help: consider borrowing here: `&std::ops::Range { start: 0, end: 1 }`
+   |     ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |     |          |
+   |     |          expected reference, found struct `std::ops::Range`
+   |     |          help: consider borrowing here: `&std::ops::Range { start: 0, end: 1 }`
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&_`
                  found struct `std::ops::Range<{integer}>`
+note: function defined here
+  --> $DIR/issue-54505-no-literals.rs:12:4
+   |
+LL | fn take_range(_r: &impl RangeBounds<i8>) {}
+   |    ^^^^^^^^^^ -------------------------
 
 error[E0308]: mismatched types
   --> $DIR/issue-54505-no-literals.rs:21:16
    |
 LL |     take_range(::std::ops::Range { start: 0, end: 1 });
-   |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |                |
-   |                expected reference, found struct `std::ops::Range`
-   |                help: consider borrowing here: `&::std::ops::Range { start: 0, end: 1 }`
+   |     ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |     |          |
+   |     |          expected reference, found struct `std::ops::Range`
+   |     |          help: consider borrowing here: `&::std::ops::Range { start: 0, end: 1 }`
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&_`
                  found struct `std::ops::Range<{integer}>`
+note: function defined here
+  --> $DIR/issue-54505-no-literals.rs:12:4
+   |
+LL | fn take_range(_r: &impl RangeBounds<i8>) {}
+   |    ^^^^^^^^^^ -------------------------
 
 error[E0308]: mismatched types
   --> $DIR/issue-54505-no-literals.rs:26:16
    |
 LL |     take_range(std::ops::RangeFrom { start: 1 });
-   |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |                |
-   |                expected reference, found struct `RangeFrom`
-   |                help: consider borrowing here: `&std::ops::RangeFrom { start: 1 }`
+   |     ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |     |          |
+   |     |          expected reference, found struct `RangeFrom`
+   |     |          help: consider borrowing here: `&std::ops::RangeFrom { start: 1 }`
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&_`
                  found struct `RangeFrom<{integer}>`
+note: function defined here
+  --> $DIR/issue-54505-no-literals.rs:12:4
+   |
+LL | fn take_range(_r: &impl RangeBounds<i8>) {}
+   |    ^^^^^^^^^^ -------------------------
 
 error[E0308]: mismatched types
   --> $DIR/issue-54505-no-literals.rs:31:16
    |
 LL |     take_range(::std::ops::RangeFrom { start: 1 });
-   |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |                |
-   |                expected reference, found struct `RangeFrom`
-   |                help: consider borrowing here: `&::std::ops::RangeFrom { start: 1 }`
+   |     ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |     |          |
+   |     |          expected reference, found struct `RangeFrom`
+   |     |          help: consider borrowing here: `&::std::ops::RangeFrom { start: 1 }`
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&_`
                  found struct `RangeFrom<{integer}>`
+note: function defined here
+  --> $DIR/issue-54505-no-literals.rs:12:4
+   |
+LL | fn take_range(_r: &impl RangeBounds<i8>) {}
+   |    ^^^^^^^^^^ -------------------------
 
 error[E0308]: mismatched types
   --> $DIR/issue-54505-no-literals.rs:36:16
    |
 LL |     take_range(std::ops::RangeFull {});
-   |                ^^^^^^^^^^^^^^^^^^^^^^
-   |                |
-   |                expected reference, found struct `RangeFull`
-   |                help: consider borrowing here: `&std::ops::RangeFull {}`
+   |     ---------- ^^^^^^^^^^^^^^^^^^^^^^
+   |     |          |
+   |     |          expected reference, found struct `RangeFull`
+   |     |          help: consider borrowing here: `&std::ops::RangeFull {}`
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&_`
                  found struct `RangeFull`
+note: function defined here
+  --> $DIR/issue-54505-no-literals.rs:12:4
+   |
+LL | fn take_range(_r: &impl RangeBounds<i8>) {}
+   |    ^^^^^^^^^^ -------------------------
 
 error[E0308]: mismatched types
   --> $DIR/issue-54505-no-literals.rs:41:16
    |
 LL |     take_range(::std::ops::RangeFull {});
-   |                ^^^^^^^^^^^^^^^^^^^^^^^^
-   |                |
-   |                expected reference, found struct `RangeFull`
-   |                help: consider borrowing here: `&::std::ops::RangeFull {}`
+   |     ---------- ^^^^^^^^^^^^^^^^^^^^^^^^
+   |     |          |
+   |     |          expected reference, found struct `RangeFull`
+   |     |          help: consider borrowing here: `&::std::ops::RangeFull {}`
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&_`
                  found struct `RangeFull`
+note: function defined here
+  --> $DIR/issue-54505-no-literals.rs:12:4
+   |
+LL | fn take_range(_r: &impl RangeBounds<i8>) {}
+   |    ^^^^^^^^^^ -------------------------
 
 error[E0308]: mismatched types
   --> $DIR/issue-54505-no-literals.rs:46:16
    |
 LL |     take_range(std::ops::RangeInclusive::new(0, 1));
-   |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |                |
-   |                expected reference, found struct `RangeInclusive`
-   |                help: consider borrowing here: `&std::ops::RangeInclusive::new(0, 1)`
+   |     ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |     |          |
+   |     |          expected reference, found struct `RangeInclusive`
+   |     |          help: consider borrowing here: `&std::ops::RangeInclusive::new(0, 1)`
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&_`
                  found struct `RangeInclusive<{integer}>`
+note: function defined here
+  --> $DIR/issue-54505-no-literals.rs:12:4
+   |
+LL | fn take_range(_r: &impl RangeBounds<i8>) {}
+   |    ^^^^^^^^^^ -------------------------
 
 error[E0308]: mismatched types
   --> $DIR/issue-54505-no-literals.rs:51:16
    |
 LL |     take_range(::std::ops::RangeInclusive::new(0, 1));
-   |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |                |
-   |                expected reference, found struct `RangeInclusive`
-   |                help: consider borrowing here: `&::std::ops::RangeInclusive::new(0, 1)`
+   |     ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |     |          |
+   |     |          expected reference, found struct `RangeInclusive`
+   |     |          help: consider borrowing here: `&::std::ops::RangeInclusive::new(0, 1)`
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&_`
                  found struct `RangeInclusive<{integer}>`
+note: function defined here
+  --> $DIR/issue-54505-no-literals.rs:12:4
+   |
+LL | fn take_range(_r: &impl RangeBounds<i8>) {}
+   |    ^^^^^^^^^^ -------------------------
 
 error[E0308]: mismatched types
   --> $DIR/issue-54505-no-literals.rs:56:16
    |
 LL |     take_range(std::ops::RangeTo { end: 5 });
-   |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |                |
-   |                expected reference, found struct `RangeTo`
-   |                help: consider borrowing here: `&std::ops::RangeTo { end: 5 }`
+   |     ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |     |          |
+   |     |          expected reference, found struct `RangeTo`
+   |     |          help: consider borrowing here: `&std::ops::RangeTo { end: 5 }`
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&_`
                  found struct `RangeTo<{integer}>`
+note: function defined here
+  --> $DIR/issue-54505-no-literals.rs:12:4
+   |
+LL | fn take_range(_r: &impl RangeBounds<i8>) {}
+   |    ^^^^^^^^^^ -------------------------
 
 error[E0308]: mismatched types
   --> $DIR/issue-54505-no-literals.rs:61:16
    |
 LL |     take_range(::std::ops::RangeTo { end: 5 });
-   |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |                |
-   |                expected reference, found struct `RangeTo`
-   |                help: consider borrowing here: `&::std::ops::RangeTo { end: 5 }`
+   |     ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |     |          |
+   |     |          expected reference, found struct `RangeTo`
+   |     |          help: consider borrowing here: `&::std::ops::RangeTo { end: 5 }`
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&_`
                  found struct `RangeTo<{integer}>`
+note: function defined here
+  --> $DIR/issue-54505-no-literals.rs:12:4
+   |
+LL | fn take_range(_r: &impl RangeBounds<i8>) {}
+   |    ^^^^^^^^^^ -------------------------
 
 error[E0308]: mismatched types
   --> $DIR/issue-54505-no-literals.rs:66:16
    |
 LL |     take_range(std::ops::RangeToInclusive { end: 5 });
-   |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |                |
-   |                expected reference, found struct `RangeToInclusive`
-   |                help: consider borrowing here: `&std::ops::RangeToInclusive { end: 5 }`
+   |     ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |     |          |
+   |     |          expected reference, found struct `RangeToInclusive`
+   |     |          help: consider borrowing here: `&std::ops::RangeToInclusive { end: 5 }`
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&_`
                  found struct `RangeToInclusive<{integer}>`
+note: function defined here
+  --> $DIR/issue-54505-no-literals.rs:12:4
+   |
+LL | fn take_range(_r: &impl RangeBounds<i8>) {}
+   |    ^^^^^^^^^^ -------------------------
 
 error[E0308]: mismatched types
   --> $DIR/issue-54505-no-literals.rs:71:16
    |
 LL |     take_range(::std::ops::RangeToInclusive { end: 5 });
-   |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-   |                |
-   |                expected reference, found struct `RangeToInclusive`
-   |                help: consider borrowing here: `&::std::ops::RangeToInclusive { end: 5 }`
+   |     ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |     |          |
+   |     |          expected reference, found struct `RangeToInclusive`
+   |     |          help: consider borrowing here: `&::std::ops::RangeToInclusive { end: 5 }`
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&_`
                  found struct `RangeToInclusive<{integer}>`
+note: function defined here
+  --> $DIR/issue-54505-no-literals.rs:12:4
+   |
+LL | fn take_range(_r: &impl RangeBounds<i8>) {}
+   |    ^^^^^^^^^^ -------------------------
 
 error: aborting due to 12 previous errors
 
index 73507f4836b23ade84fff3cc55f3edc206ec4156..c4e36b0b159507a862352fe620ade1ca136419f8 100644 (file)
@@ -4,73 +4,109 @@ error[E0308]: mismatched types
   --> $DIR/issue-54505-no-std.rs:27:16
    |
 LL |     take_range(0..1);
-   |                ^^^^
-   |                |
-   |                expected reference, found struct `Range`
-   |                help: consider borrowing here: `&(0..1)`
+   |     ---------- ^^^^
+   |     |          |
+   |     |          expected reference, found struct `Range`
+   |     |          help: consider borrowing here: `&(0..1)`
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&_`
                  found struct `Range<{integer}>`
+note: function defined here
+  --> $DIR/issue-54505-no-std.rs:23:4
+   |
+LL | fn take_range(_r: &impl RangeBounds<i8>) {}
+   |    ^^^^^^^^^^ -------------------------
 
 error[E0308]: mismatched types
   --> $DIR/issue-54505-no-std.rs:32:16
    |
 LL |     take_range(1..);
-   |                ^^^
-   |                |
-   |                expected reference, found struct `RangeFrom`
-   |                help: consider borrowing here: `&(1..)`
+   |     ---------- ^^^
+   |     |          |
+   |     |          expected reference, found struct `RangeFrom`
+   |     |          help: consider borrowing here: `&(1..)`
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&_`
                  found struct `RangeFrom<{integer}>`
+note: function defined here
+  --> $DIR/issue-54505-no-std.rs:23:4
+   |
+LL | fn take_range(_r: &impl RangeBounds<i8>) {}
+   |    ^^^^^^^^^^ -------------------------
 
 error[E0308]: mismatched types
   --> $DIR/issue-54505-no-std.rs:37:16
    |
 LL |     take_range(..);
-   |                ^^
-   |                |
-   |                expected reference, found struct `RangeFull`
-   |                help: consider borrowing here: `&(..)`
+   |     ---------- ^^
+   |     |          |
+   |     |          expected reference, found struct `RangeFull`
+   |     |          help: consider borrowing here: `&(..)`
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&_`
                  found struct `RangeFull`
+note: function defined here
+  --> $DIR/issue-54505-no-std.rs:23:4
+   |
+LL | fn take_range(_r: &impl RangeBounds<i8>) {}
+   |    ^^^^^^^^^^ -------------------------
 
 error[E0308]: mismatched types
   --> $DIR/issue-54505-no-std.rs:42:16
    |
 LL |     take_range(0..=1);
-   |                ^^^^^
-   |                |
-   |                expected reference, found struct `RangeInclusive`
-   |                help: consider borrowing here: `&(0..=1)`
+   |     ---------- ^^^^^
+   |     |          |
+   |     |          expected reference, found struct `RangeInclusive`
+   |     |          help: consider borrowing here: `&(0..=1)`
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&_`
                  found struct `RangeInclusive<{integer}>`
+note: function defined here
+  --> $DIR/issue-54505-no-std.rs:23:4
+   |
+LL | fn take_range(_r: &impl RangeBounds<i8>) {}
+   |    ^^^^^^^^^^ -------------------------
 
 error[E0308]: mismatched types
   --> $DIR/issue-54505-no-std.rs:47:16
    |
 LL |     take_range(..5);
-   |                ^^^
-   |                |
-   |                expected reference, found struct `RangeTo`
-   |                help: consider borrowing here: `&(..5)`
+   |     ---------- ^^^
+   |     |          |
+   |     |          expected reference, found struct `RangeTo`
+   |     |          help: consider borrowing here: `&(..5)`
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&_`
                  found struct `RangeTo<{integer}>`
+note: function defined here
+  --> $DIR/issue-54505-no-std.rs:23:4
+   |
+LL | fn take_range(_r: &impl RangeBounds<i8>) {}
+   |    ^^^^^^^^^^ -------------------------
 
 error[E0308]: mismatched types
   --> $DIR/issue-54505-no-std.rs:52:16
    |
 LL |     take_range(..=42);
-   |                ^^^^^
-   |                |
-   |                expected reference, found struct `RangeToInclusive`
-   |                help: consider borrowing here: `&(..=42)`
+   |     ---------- ^^^^^
+   |     |          |
+   |     |          expected reference, found struct `RangeToInclusive`
+   |     |          help: consider borrowing here: `&(..=42)`
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&_`
                  found struct `RangeToInclusive<{integer}>`
+note: function defined here
+  --> $DIR/issue-54505-no-std.rs:23:4
+   |
+LL | fn take_range(_r: &impl RangeBounds<i8>) {}
+   |    ^^^^^^^^^^ -------------------------
 
 error: aborting due to 7 previous errors
 
index 121af29834d87b2be6623fdba986a984e7dea555..38df6e14496a626ef873498e4ae32f756c25cd3c 100644 (file)
@@ -2,73 +2,109 @@ error[E0308]: mismatched types
   --> $DIR/issue-54505.rs:14:16
    |
 LL |     take_range(0..1);
-   |                ^^^^
-   |                |
-   |                expected reference, found struct `std::ops::Range`
-   |                help: consider borrowing here: `&(0..1)`
+   |     ---------- ^^^^
+   |     |          |
+   |     |          expected reference, found struct `std::ops::Range`
+   |     |          help: consider borrowing here: `&(0..1)`
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&_`
                  found struct `std::ops::Range<{integer}>`
+note: function defined here
+  --> $DIR/issue-54505.rs:10:4
+   |
+LL | fn take_range(_r: &impl RangeBounds<i8>) {}
+   |    ^^^^^^^^^^ -------------------------
 
 error[E0308]: mismatched types
   --> $DIR/issue-54505.rs:19:16
    |
 LL |     take_range(1..);
-   |                ^^^
-   |                |
-   |                expected reference, found struct `RangeFrom`
-   |                help: consider borrowing here: `&(1..)`
+   |     ---------- ^^^
+   |     |          |
+   |     |          expected reference, found struct `RangeFrom`
+   |     |          help: consider borrowing here: `&(1..)`
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&_`
                  found struct `RangeFrom<{integer}>`
+note: function defined here
+  --> $DIR/issue-54505.rs:10:4
+   |
+LL | fn take_range(_r: &impl RangeBounds<i8>) {}
+   |    ^^^^^^^^^^ -------------------------
 
 error[E0308]: mismatched types
   --> $DIR/issue-54505.rs:24:16
    |
 LL |     take_range(..);
-   |                ^^
-   |                |
-   |                expected reference, found struct `RangeFull`
-   |                help: consider borrowing here: `&(..)`
+   |     ---------- ^^
+   |     |          |
+   |     |          expected reference, found struct `RangeFull`
+   |     |          help: consider borrowing here: `&(..)`
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&_`
                  found struct `RangeFull`
+note: function defined here
+  --> $DIR/issue-54505.rs:10:4
+   |
+LL | fn take_range(_r: &impl RangeBounds<i8>) {}
+   |    ^^^^^^^^^^ -------------------------
 
 error[E0308]: mismatched types
   --> $DIR/issue-54505.rs:29:16
    |
 LL |     take_range(0..=1);
-   |                ^^^^^
-   |                |
-   |                expected reference, found struct `RangeInclusive`
-   |                help: consider borrowing here: `&(0..=1)`
+   |     ---------- ^^^^^
+   |     |          |
+   |     |          expected reference, found struct `RangeInclusive`
+   |     |          help: consider borrowing here: `&(0..=1)`
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&_`
                  found struct `RangeInclusive<{integer}>`
+note: function defined here
+  --> $DIR/issue-54505.rs:10:4
+   |
+LL | fn take_range(_r: &impl RangeBounds<i8>) {}
+   |    ^^^^^^^^^^ -------------------------
 
 error[E0308]: mismatched types
   --> $DIR/issue-54505.rs:34:16
    |
 LL |     take_range(..5);
-   |                ^^^
-   |                |
-   |                expected reference, found struct `RangeTo`
-   |                help: consider borrowing here: `&(..5)`
+   |     ---------- ^^^
+   |     |          |
+   |     |          expected reference, found struct `RangeTo`
+   |     |          help: consider borrowing here: `&(..5)`
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&_`
                  found struct `RangeTo<{integer}>`
+note: function defined here
+  --> $DIR/issue-54505.rs:10:4
+   |
+LL | fn take_range(_r: &impl RangeBounds<i8>) {}
+   |    ^^^^^^^^^^ -------------------------
 
 error[E0308]: mismatched types
   --> $DIR/issue-54505.rs:39:16
    |
 LL |     take_range(..=42);
-   |                ^^^^^
-   |                |
-   |                expected reference, found struct `RangeToInclusive`
-   |                help: consider borrowing here: `&(..=42)`
+   |     ---------- ^^^^^
+   |     |          |
+   |     |          expected reference, found struct `RangeToInclusive`
+   |     |          help: consider borrowing here: `&(..=42)`
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&_`
                  found struct `RangeToInclusive<{integer}>`
+note: function defined here
+  --> $DIR/issue-54505.rs:10:4
+   |
+LL | fn take_range(_r: &impl RangeBounds<i8>) {}
+   |    ^^^^^^^^^^ -------------------------
 
 error: aborting due to 6 previous errors
 
index 5167b87fd27b82e7a6fc35e1c2ea74fa51065ad9..6badd998f9617ab4af6e8306e4f8199218f60d4d 100644 (file)
@@ -2,25 +2,37 @@ error[E0308]: mismatched types
   --> $DIR/issue-73553-misinterp-range-literal.rs:12:10
    |
 LL |     demo(tell(1)..tell(10));
-   |          ^^^^^^^^^^^^^^^^^
-   |          |
-   |          expected reference, found struct `std::ops::Range`
-   |          help: consider borrowing here: `&(tell(1)..tell(10))`
+   |     ---- ^^^^^^^^^^^^^^^^^
+   |     |    |
+   |     |    expected reference, found struct `std::ops::Range`
+   |     |    help: consider borrowing here: `&(tell(1)..tell(10))`
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&std::ops::Range<usize>`
                  found struct `std::ops::Range<usize>`
+note: function defined here
+  --> $DIR/issue-73553-misinterp-range-literal.rs:3:4
+   |
+LL | fn demo(r: &Range) {
+   |    ^^^^ ---------
 
 error[E0308]: mismatched types
   --> $DIR/issue-73553-misinterp-range-literal.rs:14:10
    |
 LL |     demo(1..10);
-   |          ^^^^^
-   |          |
-   |          expected reference, found struct `std::ops::Range`
-   |          help: consider borrowing here: `&(1..10)`
+   |     ---- ^^^^^
+   |     |    |
+   |     |    expected reference, found struct `std::ops::Range`
+   |     |    help: consider borrowing here: `&(1..10)`
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&std::ops::Range<usize>`
                  found struct `std::ops::Range<{integer}>`
+note: function defined here
+  --> $DIR/issue-73553-misinterp-range-literal.rs:3:4
+   |
+LL | fn demo(r: &Range) {
+   |    ^^^^ ---------
 
 error: aborting due to 2 previous errors
 
index 5af0aefe22b8c8e4766a5a1a82354b4587524e9f..44631f954df33c9ad295651fd35d031f7a93d64d 100644 (file)
@@ -19,15 +19,17 @@ error[E0061]: this function takes 0 arguments but 1 argument was supplied
   --> $DIR/resolve-primitive-fallback.rs:3:5
    |
 LL |     std::mem::size_of(u16);
-   |     ^^^^^^^^^^^^^^^^^ --- supplied 1 argument
-   |     |
-   |     expected 0 arguments
+   |     ^^^^^^^^^^^^^^^^^ --- argument unexpected
    |
 note: function defined here
   --> $SRC_DIR/core/src/mem/mod.rs:LL:COL
    |
 LL | pub const fn size_of<T>() -> usize {
    |              ^^^^^^^
+help: remove the extra argument
+   |
+LL |     std::mem::size_of();
+   |     ~~~~~~~~~~~~~~~~~~~
 
 error: aborting due to 3 previous errors
 
index 09ffe8e64b1b16962be4e5872952056db8f6288f..dd7194dc2e840b897db177c1473e1ddbdec5b199 100644 (file)
@@ -2,7 +2,15 @@ error[E0308]: mismatched types
   --> $DIR/issue-61882.rs:4:27
    |
 LL |     const B: A<u8> = Self(0);
-   |                           ^ expected `bool`, found integer
+   |                      ---- ^ expected `bool`, found integer
+   |                      |
+   |                      arguments to this function are incorrect
+   |
+note: tuple struct defined here
+  --> $DIR/issue-61882.rs:1:8
+   |
+LL | struct A<T>(T);
+   |        ^
 
 error[E0308]: mismatched types
   --> $DIR/issue-61882.rs:4:22
diff --git a/src/test/ui/span/E0057.rs b/src/test/ui/span/E0057.rs
new file mode 100644 (file)
index 0000000..83f941f
--- /dev/null
@@ -0,0 +1,6 @@
+fn main() {
+    let f = |x| x * 3;
+    let a = f(); //~ ERROR E0057
+    let b = f(4);
+    let c = f(2, 3); //~ ERROR E0057
+}
diff --git a/src/test/ui/span/E0057.stderr b/src/test/ui/span/E0057.stderr
new file mode 100644 (file)
index 0000000..a151b20
--- /dev/null
@@ -0,0 +1,25 @@
+error[E0057]: this function takes 1 argument but 0 arguments were supplied
+  --> $DIR/E0057.rs:3:13
+   |
+LL |     let a = f();
+   |             ^-- an argument is missing
+   |
+help: provide the argument
+   |
+LL |     let a = f({_});
+   |             ~~~~~~
+
+error[E0057]: this function takes 1 argument but 2 arguments were supplied
+  --> $DIR/E0057.rs:5:13
+   |
+LL |     let c = f(2, 3);
+   |             ^    - argument unexpected
+   |
+help: remove the extra argument
+   |
+LL |     let c = f(2);
+   |             ~~~~
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0057`.
index 5a964c5d5cc6693e1667e60a7e1f647b42da75be..db784d5fe6cfc8be856bba650d3c73e750f2b061 100644 (file)
@@ -20,19 +20,33 @@ error[E0308]: mismatched types
   --> $DIR/coerce-suggestions.rs:12:10
    |
 LL |     test(&y);
-   |          ^^ types differ in mutability
+   |     ---- ^^ types differ in mutability
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected mutable reference `&mut String`
                       found reference `&String`
+note: function defined here
+  --> $DIR/coerce-suggestions.rs:1:4
+   |
+LL | fn test(_x: &mut String) {}
+   |    ^^^^ ---------------
 
 error[E0308]: mismatched types
   --> $DIR/coerce-suggestions.rs:14:11
    |
 LL |     test2(&y);
-   |           ^^ types differ in mutability
+   |     ----- ^^ types differ in mutability
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected mutable reference `&mut i32`
                       found reference `&String`
+note: function defined here
+  --> $DIR/coerce-suggestions.rs:3:4
+   |
+LL | fn test2(_x: &mut i32) {}
+   |    ^^^^^ ------------
 
 error[E0308]: mismatched types
   --> $DIR/coerce-suggestions.rs:17:9
index 8d26ca4ac7a743096d8c0225dc73e07dffa32ddc..68da9f0dc88ba2f7f8923092a0cfdc3a1da61182 100644 (file)
@@ -54,35 +54,47 @@ error[E0061]: this function takes 2 arguments but 3 arguments were supplied
   --> $DIR/issue-34264.rs:7:5
    |
 LL |     foo(Some(42), 2, "");
-   |     ^^^ --------  -  -- supplied 3 arguments
-   |     |
-   |     expected 2 arguments
+   |     ^^^              -- argument unexpected
    |
 note: function defined here
   --> $DIR/issue-34264.rs:1:4
    |
 LL | fn foo(Option<i32>, String) {}
    |    ^^^ -----------  ------
+help: remove the extra argument
+   |
+LL |     foo(Some(42), 2);
+   |     ~~~~~~~~~~~~~~~~
 
 error[E0308]: mismatched types
   --> $DIR/issue-34264.rs:8:13
    |
 LL |     bar("", "");
-   |             ^^ expected `usize`, found `&str`
+   |     ---     ^^ expected `usize`, found `&str`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/issue-34264.rs:3:4
+   |
+LL | fn bar(x, y: usize) {}
+   |    ^^^ -  --------
 
 error[E0061]: this function takes 2 arguments but 3 arguments were supplied
   --> $DIR/issue-34264.rs:10:5
    |
 LL |     bar(1, 2, 3);
-   |     ^^^ -  -  - supplied 3 arguments
-   |     |
-   |     expected 2 arguments
+   |     ^^^       - argument unexpected
    |
 note: function defined here
   --> $DIR/issue-34264.rs:3:4
    |
 LL | fn bar(x, y: usize) {}
    |    ^^^ -  --------
+help: remove the extra argument
+   |
+LL |     bar(1, 2);
+   |     ~~~~~~~~~
 
 error: aborting due to 6 previous errors
 
index 99c57322d865141092e157d1d25bdee15833ae53..c8e1a23288751a912fce8bb67605cab9419da7d9 100644 (file)
@@ -2,88 +2,92 @@ error[E0061]: this enum variant takes 1 argument but 0 arguments were supplied
   --> $DIR/missing-unit-argument.rs:11:33
    |
 LL |     let _: Result<(), String> = Ok();
-   |                                 ^^-- supplied 0 arguments
+   |                                 ^^-- an argument of type `()` is missing
    |
-help: expected the unit value `()`; create it with empty parentheses
+help: provide the argument
    |
 LL |     let _: Result<(), String> = Ok(());
-   |                                    ++
+   |                                 ~~~~~~
 
 error[E0061]: this function takes 2 arguments but 0 arguments were supplied
   --> $DIR/missing-unit-argument.rs:12:5
    |
 LL |     foo();
-   |     ^^^-- supplied 0 arguments
-   |     |
-   |     expected 2 arguments
+   |     ^^^-- two arguments of type `()` and `()` are missing
    |
 note: function defined here
   --> $DIR/missing-unit-argument.rs:1:4
    |
 LL | fn foo(():(), ():()) {}
    |    ^^^ -----  -----
+help: provide the arguments
+   |
+LL |     foo((), ());
+   |     ~~~~~~~~~~~
 
 error[E0061]: this function takes 2 arguments but 1 argument was supplied
   --> $DIR/missing-unit-argument.rs:13:5
    |
 LL |     foo(());
-   |     ^^^ -- supplied 1 argument
-   |     |
-   |     expected 2 arguments
+   |     ^^^---- an argument of type `()` is missing
    |
 note: function defined here
   --> $DIR/missing-unit-argument.rs:1:4
    |
 LL | fn foo(():(), ():()) {}
    |    ^^^ -----  -----
+help: provide the argument
+   |
+LL |     foo((), ());
+   |     ~~~~~~~~~~~
 
 error[E0061]: this function takes 1 argument but 0 arguments were supplied
   --> $DIR/missing-unit-argument.rs:14:5
    |
 LL |     bar();
-   |     ^^^-- supplied 0 arguments
+   |     ^^^-- an argument of type `()` is missing
    |
 note: function defined here
   --> $DIR/missing-unit-argument.rs:2:4
    |
 LL | fn bar(():()) {}
    |    ^^^ -----
-help: expected the unit value `()`; create it with empty parentheses
+help: provide the argument
    |
 LL |     bar(());
-   |         ++
+   |     ~~~~~~~
 
 error[E0061]: this function takes 1 argument but 0 arguments were supplied
   --> $DIR/missing-unit-argument.rs:15:7
    |
 LL |     S.baz();
-   |       ^^^- supplied 0 arguments
+   |       ^^^-- an argument of type `()` is missing
    |
 note: associated function defined here
   --> $DIR/missing-unit-argument.rs:6:8
    |
 LL |     fn baz(self, (): ()) { }
    |        ^^^ ----  ------
-help: expected the unit value `()`; create it with empty parentheses
+help: provide the argument
    |
 LL |     S.baz(());
-   |           ++
+   |       ~~~~~~~
 
 error[E0061]: this function takes 1 argument but 0 arguments were supplied
   --> $DIR/missing-unit-argument.rs:16:7
    |
 LL |     S.generic::<()>();
-   |       ^^^^^^^------ supplied 0 arguments
+   |       ^^^^^^^^^^^^^-- an argument of type `()` is missing
    |
 note: associated function defined here
   --> $DIR/missing-unit-argument.rs:7:8
    |
 LL |     fn generic<T>(self, _: T) { }
    |        ^^^^^^^    ----  ----
-help: expected the unit value `()`; create it with empty parentheses
+help: provide the argument
    |
 LL |     S.generic::<()>(());
-   |                     ++
+   |       ~~~~~~~~~~~~~~~~~
 
 error: aborting due to 6 previous errors
 
index ddcdfb1c3b34413be0a3bc9e6504cbb75db0897a..991dde30629e93539f9ebf167cef79901ba384cf 100644 (file)
@@ -2,37 +2,55 @@ error[E0061]: this enum variant takes 1 argument but 2 arguments were supplied
   --> $DIR/args-instead-of-tuple-errors.rs:6:34
    |
 LL |     let _: Option<(i32, bool)> = Some(1, 2);
-   |                                  ^^^^ -  - supplied 2 arguments
-   |                                  |
-   |                                  expected 1 argument
+   |                                  ^^^^ -  - argument unexpected
+   |                                       |
+   |                                       expected tuple, found integer
+   |
+   = note: expected tuple `(i32, bool)`
+               found type `{integer}`
+help: remove the extra argument
+   |
+LL |     let _: Option<(i32, bool)> = Some({(i32, bool)});
+   |                                  ~~~~~~~~~~~~~~~~~~~
 
 error[E0061]: this function takes 1 argument but 2 arguments were supplied
   --> $DIR/args-instead-of-tuple-errors.rs:8:5
    |
 LL |     int_bool(1, 2);
-   |     ^^^^^^^^ -  - supplied 2 arguments
-   |     |
-   |     expected 1 argument
+   |     ^^^^^^^^ -  - argument unexpected
+   |              |
+   |              expected tuple, found integer
    |
+   = note: expected tuple `(i32, bool)`
+               found type `{integer}`
 note: function defined here
   --> $DIR/args-instead-of-tuple-errors.rs:21:4
    |
 LL | fn int_bool(_: (i32, bool)) {
    |    ^^^^^^^^ --------------
+help: remove the extra argument
+   |
+LL |     int_bool({(i32, bool)});
+   |     ~~~~~~~~~~~~~~~~~~~~~~~
 
 error[E0061]: this enum variant takes 1 argument but 0 arguments were supplied
   --> $DIR/args-instead-of-tuple-errors.rs:11:28
    |
 LL |     let _: Option<(i8,)> = Some();
-   |                            ^^^^-- supplied 0 arguments
-   |                            |
-   |                            expected 1 argument
+   |                            ^^^^-- an argument of type `(i8,)` is missing
+   |
+help: provide the argument
+   |
+LL |     let _: Option<(i8,)> = Some({(i8,)});
+   |                            ~~~~~~~~~~~~~
 
 error[E0308]: mismatched types
   --> $DIR/args-instead-of-tuple-errors.rs:14:34
    |
 LL |     let _: Option<(i32,)> = Some(5_usize);
-   |                                  ^^^^^^^ expected tuple, found `usize`
+   |                             ---- ^^^^^^^ expected tuple, found `usize`
+   |                             |
+   |                             arguments to this enum variant are incorrect
    |
    = note: expected tuple `(i32,)`
                found type `usize`
@@ -41,7 +59,9 @@ error[E0308]: mismatched types
   --> $DIR/args-instead-of-tuple-errors.rs:17:34
    |
 LL |     let _: Option<(i32,)> = Some((5_usize));
-   |                                  ^^^^^^^^^ expected tuple, found `usize`
+   |                             ---- ^^^^^^^^^ expected tuple, found `usize`
+   |                             |
+   |                             arguments to this enum variant are incorrect
    |
    = note: expected tuple `(i32,)`
                found type `usize`
index 6a7602c9d0f45cc3742ad56b50a52b0b5719e1c1..7ec10e88142c11c76f5b8b21746bd6457f85d518 100644 (file)
@@ -2,7 +2,7 @@ error[E0061]: this enum variant takes 1 argument but 2 arguments were supplied
   --> $DIR/args-instead-of-tuple.rs:7:36
    |
 LL |     let _: Result<(i32, i8), ()> = Ok(1, 2);
-   |                                    ^^ -  - supplied 2 arguments
+   |                                    ^^
    |
 help: use parentheses to construct a tuple
    |
@@ -13,7 +13,7 @@ error[E0061]: this enum variant takes 1 argument but 3 arguments were supplied
   --> $DIR/args-instead-of-tuple.rs:9:46
    |
 LL |     let _: Option<(i32, i8, &'static str)> = Some(1, 2, "hi");
-   |                                              ^^^^ -  -  ---- supplied 3 arguments
+   |                                              ^^^^
    |
 help: use parentheses to construct a tuple
    |
@@ -24,18 +24,20 @@ error[E0061]: this enum variant takes 1 argument but 0 arguments were supplied
   --> $DIR/args-instead-of-tuple.rs:11:25
    |
 LL |     let _: Option<()> = Some();
-   |                         ^^^^-- supplied 0 arguments
+   |                         ^^^^-- an argument of type `()` is missing
    |
-help: expected the unit value `()`; create it with empty parentheses
+help: provide the argument
    |
 LL |     let _: Option<()> = Some(());
-   |                              ++
+   |                         ~~~~~~~~
 
 error[E0308]: mismatched types
   --> $DIR/args-instead-of-tuple.rs:14:34
    |
 LL |     let _: Option<(i32,)> = Some(3);
-   |                                  ^ expected tuple, found integer
+   |                             ---- ^ expected tuple, found integer
+   |                             |
+   |                             arguments to this enum variant are incorrect
    |
    = note: expected tuple `(i32,)`
                found type `{integer}`
@@ -48,7 +50,9 @@ error[E0308]: mismatched types
   --> $DIR/args-instead-of-tuple.rs:17:34
    |
 LL |     let _: Option<(i32,)> = Some((3));
-   |                                  ^^^ expected tuple, found integer
+   |                             ---- ^^^ expected tuple, found integer
+   |                             |
+   |                             arguments to this enum variant are incorrect
    |
    = note: expected tuple `(i32,)`
                found type `{integer}`
@@ -61,7 +65,7 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied
   --> $DIR/args-instead-of-tuple.rs:20:5
    |
 LL |     two_ints(1, 2);
-   |     ^^^^^^^^ -  - supplied 2 arguments
+   |     ^^^^^^^^
    |
 note: function defined here
   --> $DIR/args-instead-of-tuple.rs:25:4
@@ -77,7 +81,7 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied
   --> $DIR/args-instead-of-tuple.rs:22:5
    |
 LL |     with_generic(3, 4);
-   |     ^^^^^^^^^^^^ -  - supplied 2 arguments
+   |     ^^^^^^^^^^^^
    |
 note: function defined here
   --> $DIR/args-instead-of-tuple.rs:28:4
@@ -93,7 +97,7 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied
   --> $DIR/args-instead-of-tuple.rs:31:9
    |
 LL |         with_generic(a, b);
-   |         ^^^^^^^^^^^^ -  - supplied 2 arguments
+   |         ^^^^^^^^^^^^
    |
 note: function defined here
   --> $DIR/args-instead-of-tuple.rs:28:4
index 8d93ac50796671182b44d57b07901d7448d80643..1efd1b317b7da25de6b895f0b7ee4a981734bc87 100644 (file)
@@ -2,33 +2,61 @@ error[E0308]: mismatched types
   --> $DIR/as-ref.rs:7:29
    |
 LL |     opt.map(|arg| takes_ref(arg));
-   |         ---                 ^^^ expected `&Foo`, found struct `Foo`
-   |         |
+   |         ---       --------- ^^^ expected `&Foo`, found struct `Foo`
+   |         |         |
+   |         |         arguments to this function are incorrect
    |         help: consider using `as_ref` instead: `as_ref().map`
+   |
+note: function defined here
+  --> $DIR/as-ref.rs:3:4
+   |
+LL | fn takes_ref(_: &Foo) {}
+   |    ^^^^^^^^^ -------
 
 error[E0308]: mismatched types
   --> $DIR/as-ref.rs:8:39
    |
 LL |     opt.and_then(|arg| Some(takes_ref(arg)));
-   |         --------                      ^^^ expected `&Foo`, found struct `Foo`
-   |         |
+   |         --------            --------- ^^^ expected `&Foo`, found struct `Foo`
+   |         |                   |
+   |         |                   arguments to this function are incorrect
    |         help: consider using `as_ref` instead: `as_ref().and_then`
+   |
+note: function defined here
+  --> $DIR/as-ref.rs:3:4
+   |
+LL | fn takes_ref(_: &Foo) {}
+   |    ^^^^^^^^^ -------
 
 error[E0308]: mismatched types
   --> $DIR/as-ref.rs:10:29
    |
 LL |     opt.map(|arg| takes_ref(arg));
-   |         ---                 ^^^ expected `&Foo`, found struct `Foo`
-   |         |
+   |         ---       --------- ^^^ expected `&Foo`, found struct `Foo`
+   |         |         |
+   |         |         arguments to this function are incorrect
    |         help: consider using `as_ref` instead: `as_ref().map`
+   |
+note: function defined here
+  --> $DIR/as-ref.rs:3:4
+   |
+LL | fn takes_ref(_: &Foo) {}
+   |    ^^^^^^^^^ -------
 
 error[E0308]: mismatched types
   --> $DIR/as-ref.rs:11:37
    |
 LL |     opt.and_then(|arg| Ok(takes_ref(arg)));
-   |         --------                    ^^^ expected `&Foo`, found struct `Foo`
-   |         |
+   |         --------          --------- ^^^ expected `&Foo`, found struct `Foo`
+   |         |                 |
+   |         |                 arguments to this function are incorrect
    |         help: consider using `as_ref` instead: `as_ref().and_then`
+   |
+note: function defined here
+  --> $DIR/as-ref.rs:3:4
+   |
+LL | fn takes_ref(_: &Foo) {}
+   |    ^^^^^^^^^ -------
 
 error[E0308]: mismatched types
   --> $DIR/as-ref.rs:13:29
index 9a31dc89197e36209a295f4c8e319761ee1448c9..6dfb73480a2b88b7e30fbd9280cb6cbf760acea1 100644 (file)
@@ -2,10 +2,17 @@ error[E0308]: mismatched types
   --> $DIR/boxed-variant-field.rs:9:31
    |
 LL |         Ty::List(elem) => foo(elem),
-   |                               ^^^^ expected enum `Ty`, found struct `Box`
+   |                           --- ^^^^ expected enum `Ty`, found struct `Box`
+   |                           |
+   |                           arguments to this function are incorrect
    |
    = note: expected enum `Ty`
             found struct `Box<Ty>`
+note: function defined here
+  --> $DIR/boxed-variant-field.rs:6:4
+   |
+LL | fn foo(x: Ty) -> Ty {
+   |    ^^^ -----
 help: consider unboxing the value
    |
 LL |         Ty::List(elem) => foo(*elem),
index 7ef4895249cec7218f08a5836b9dd9edc0d817c2..71facf57e8d659122dda5452473f0e0231d90021 100644 (file)
@@ -34,10 +34,16 @@ LL | fn baz<F: Future<Output=i32> + Send + 'static>(x: F) -> BoxFuture<'static,
 LL |     Pin::new(x)
    |     -------- ^ expected struct `Box`, found type parameter `F`
    |     |
+   |     arguments to this function are incorrect
    |     help: use `Box::pin` to pin and box this expression: `Box::pin`
    |
    = note:      expected struct `Box<dyn Future<Output = i32> + Send>`
            found type parameter `F`
+note: associated function defined here
+  --> $SRC_DIR/core/src/pin.rs:LL:COL
+   |
+LL |     pub const fn new(pointer: P) -> Pin<P> {
+   |                  ^^^
 
 error[E0277]: `dyn Future<Output = i32> + Send` cannot be unpinned
   --> $DIR/expected-boxed-future-isnt-pinned.rs:19:5
index 0016f19284250eae33697601612bed322883c80c..8c9a41a202767813306bf508a328f785ad74e45c 100644 (file)
@@ -17,10 +17,17 @@ error[E0308]: mismatched types
   --> $DIR/issue-86100-tuple-paren-comma.rs:13:9
    |
 LL |     foo((Some(3)));
-   |         ^^^^^^^^^ expected tuple, found enum `Option`
+   |     --- ^^^^^^^^^ expected tuple, found enum `Option`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected tuple `(_,)`
                found enum `Option<{integer}>`
+note: function defined here
+  --> $DIR/issue-86100-tuple-paren-comma.rs:5:4
+   |
+LL | fn foo<T>(_t: (T,)) {}
+   |    ^^^    --------
 help: use a trailing comma to create a tuple with one element
    |
 LL |     foo((Some(3),));
index c15b772b79ca4364f9087215341de116a6a0d64a..611f7d5ddda78574c68501208dccfc49580af855 100644 (file)
@@ -2,11 +2,18 @@ error[E0308]: mismatched types
   --> $DIR/issue-90213-expected-boxfuture-self-ice.rs:9:19
    |
 LL |         Self::foo(None)
-   |                   ^^^^ expected struct `Box`, found enum `Option`
+   |         --------- ^^^^ expected struct `Box`, found enum `Option`
+   |         |
+   |         arguments to this function are incorrect
    |
    = note: expected struct `Box<Option<S>>`
                 found enum `Option<_>`
    = note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html
+note: associated function defined here
+  --> $DIR/issue-90213-expected-boxfuture-self-ice.rs:7:8
+   |
+LL |     fn foo(_: Box<Option<S>>) {}
+   |        ^^^ -----------------
 help: store this in the heap by calling `Box::new`
    |
 LL |         Self::foo(Box::new(None))
index aa621111c00c5cd29ee330bba64f8f576cd3b4a3..9588eedc98b4ae35b9f2020b5c0ff2b2b50d09ae 100644 (file)
@@ -38,7 +38,15 @@ error[E0308]: mismatched types
   --> $DIR/recover-from-semicolon-trailing-item.rs:14:9
    |
 LL |     foo("");
-   |         ^^ expected `usize`, found `&str`
+   |     --- ^^ expected `usize`, found `&str`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/recover-from-semicolon-trailing-item.rs:6:4
+   |
+LL | fn foo(a: usize) {};
+   |    ^^^ --------
 
 error: aborting due to 6 previous errors
 
index 5c05810e5868d83c35793fa8d8330846eb29ae94..b0ac770c06f0fcc295a3687835cbfee208adcf8d 100644 (file)
@@ -2,31 +2,60 @@ error[E0308]: mismatched types
   --> $DIR/suggest-ref-macro.rs:15:11
    |
 LL |         x(123);
-   |           ^^^
-   |           |
-   |           expected `&mut i32`, found integer
-   |           help: consider mutably borrowing here: `&mut 123`
+   |         - ^^^
+   |         | |
+   |         | expected `&mut i32`, found integer
+   |         | help: consider mutably borrowing here: `&mut 123`
+   |         arguments to this function are incorrect
 ...
 LL |     bla!();
    |     ------ in this macro invocation
    |
+note: function defined here
+  --> $DIR/suggest-ref-macro.rs:11:4
+   |
+LL | fn x(_: &mut i32) {}
+   |    ^ -----------
    = note: this error originates in the macro `bla` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error[E0308]: mismatched types
   --> $DIR/suggest-ref-macro.rs:26:10
    |
+LL |         x($v)
+   |         - arguments to this function are incorrect
+...
 LL |     bla!(456);
    |          ^^^
    |          |
    |          expected `&mut i32`, found integer
    |          help: consider mutably borrowing here: `&mut 456`
+   |
+note: function defined here
+  --> $DIR/suggest-ref-macro.rs:11:4
+   |
+LL | fn x(_: &mut i32) {}
+   |    ^ -----------
 
 error[E0308]: mismatched types
   --> $DIR/suggest-ref-macro.rs:8:1
    |
 LL | #[hello]
-   | ^^^^^^^^ expected `&mut i32`, found integer
+   | ^^^^^^^^
+   | |
+   | expected `&mut i32`, found integer
+   | arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/suggest-ref-macro.rs:8:1
    |
+LL |   #[hello]
+   |  _-^^^^^^^
+LL | | fn abc() {}
+LL | |
+LL | | fn x(_: &mut i32) {}
+LL | |
+LL | | macro_rules! bla {
+   | |_____________-
    = note: this error originates in the attribute macro `hello` (in Nightly builds, run with -Z macro-backtrace for more info)
 
 error: aborting due to 3 previous errors
index 19fc772544d59883cc9f1c65ea996dc496e53796..ac839ff7eb966c3869ebb6b192b0309ac2a95e0e 100644 (file)
@@ -2,10 +2,17 @@ error[E0308]: mismatched types
   --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:13:13
    |
 LL |         qux(x.func())
-   |             ^^^^^^^^ expected `usize`, found associated type
+   |         --- ^^^^^^^^ expected `usize`, found associated type
+   |         |
+   |         arguments to this function are incorrect
    |
    = note:         expected type `usize`
            found associated type `<impl Trait as Trait>::A`
+note: function defined here
+  --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:41:4
+   |
+LL | fn qux(_: usize) {}
+   |    ^^^ --------
 help: consider constraining the associated type `<impl Trait as Trait>::A` to `usize`
    |
 LL |     fn foo<'a, T: Trait + 'a>(&self, _: impl Trait, x: impl Trait<A = usize>, _: T) {
@@ -15,10 +22,17 @@ error[E0308]: mismatched types
   --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:17:13
    |
 LL |         qux(x.func())
-   |             ^^^^^^^^ expected `usize`, found associated type
+   |         --- ^^^^^^^^ expected `usize`, found associated type
+   |         |
+   |         arguments to this function are incorrect
    |
    = note:         expected type `usize`
            found associated type `<T as Trait>::A`
+note: function defined here
+  --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:41:4
+   |
+LL | fn qux(_: usize) {}
+   |    ^^^ --------
 help: consider constraining the associated type `<T as Trait>::A` to `usize`
    |
 LL |     fn ban<T>(x: T) where T: Trait<A = usize> {
@@ -28,10 +42,17 @@ error[E0308]: mismatched types
   --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:22:9
    |
 LL |     qux(x.func())
-   |         ^^^^^^^^ expected `usize`, found associated type
+   |     --- ^^^^^^^^ expected `usize`, found associated type
+   |     |
+   |     arguments to this function are incorrect
    |
    = note:         expected type `usize`
            found associated type `<impl Trait as Trait>::A`
+note: function defined here
+  --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:41:4
+   |
+LL | fn qux(_: usize) {}
+   |    ^^^ --------
 help: consider constraining the associated type `<impl Trait as Trait>::A` to `usize`
    |
 LL | fn foo<'a, T: Trait + 'a>(_: impl Trait, x: impl Trait<A = usize>, _: T) {
@@ -41,10 +62,17 @@ error[E0308]: mismatched types
   --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:26:9
    |
 LL |     qux(x.func())
-   |         ^^^^^^^^ expected `usize`, found associated type
+   |     --- ^^^^^^^^ expected `usize`, found associated type
+   |     |
+   |     arguments to this function are incorrect
    |
    = note:         expected type `usize`
            found associated type `<T as Trait>::A`
+note: function defined here
+  --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:41:4
+   |
+LL | fn qux(_: usize) {}
+   |    ^^^ --------
 help: consider constraining the associated type `<T as Trait>::A` to `usize`
    |
 LL | fn bar<T: Trait<A = usize>>(x: T) {
@@ -54,10 +82,17 @@ error[E0308]: mismatched types
   --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:30:9
    |
 LL |     qux(x.func())
-   |         ^^^^^^^^ expected `usize`, found associated type
+   |     --- ^^^^^^^^ expected `usize`, found associated type
+   |     |
+   |     arguments to this function are incorrect
    |
    = note:         expected type `usize`
            found associated type `<impl Trait<i32> as Trait<i32>>::A`
+note: function defined here
+  --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:41:4
+   |
+LL | fn qux(_: usize) {}
+   |    ^^^ --------
 help: consider constraining the associated type `<impl Trait<i32> as Trait<i32>>::A` to `usize`
    |
 LL | fn foo2(x: impl Trait<i32, A = usize>) {
@@ -67,10 +102,17 @@ error[E0308]: mismatched types
   --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:34:9
    |
 LL |     qux(x.func())
-   |         ^^^^^^^^ expected `usize`, found associated type
+   |     --- ^^^^^^^^ expected `usize`, found associated type
+   |     |
+   |     arguments to this function are incorrect
    |
    = note:         expected type `usize`
            found associated type `<T as Trait<i32>>::A`
+note: function defined here
+  --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:41:4
+   |
+LL | fn qux(_: usize) {}
+   |    ^^^ --------
 help: consider constraining the associated type `<T as Trait<i32>>::A` to `usize`
    |
 LL | fn bar2<T: Trait<i32, A = usize>>(x: T) {
@@ -80,10 +122,17 @@ error[E0308]: mismatched types
   --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:38:9
    |
 LL |     qux(x.func())
-   |         ^^^^^^^^ expected `usize`, found associated type
+   |     --- ^^^^^^^^ expected `usize`, found associated type
+   |     |
+   |     arguments to this function are incorrect
    |
    = note:         expected type `usize`
            found associated type `<T as Trait>::A`
+note: function defined here
+  --> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:41:4
+   |
+LL | fn qux(_: usize) {}
+   |    ^^^ --------
 help: consider constraining the associated type `<T as Trait>::A` to `usize`
    |
 LL | fn ban<T>(x: T) where T: Trait<A = usize> {
index 943cbcbc81a22f06f4d47b9d35cf5a9a847df7e8..7583c875a1a37a667d483998e6d7242d5d142a6e 100644 (file)
@@ -16,10 +16,17 @@ error[E0308]: mismatched types
   --> $DIR/trait-with-missing-associated-type-restriction.rs:14:9
    |
 LL |     qux(x.func())
-   |         ^^^^^^^^ expected `usize`, found associated type
+   |     --- ^^^^^^^^ expected `usize`, found associated type
+   |     |
+   |     arguments to this function are incorrect
    |
    = note:         expected type `usize`
            found associated type `<impl Trait as Trait>::A`
+note: function defined here
+  --> $DIR/trait-with-missing-associated-type-restriction.rs:42:4
+   |
+LL | fn qux(_: usize) {}
+   |    ^^^ --------
 help: consider constraining the associated type `<impl Trait as Trait>::A` to `usize`
    |
 LL | fn foo(_: impl Trait, x: impl Trait<A = usize>) {
@@ -29,10 +36,17 @@ error[E0308]: mismatched types
   --> $DIR/trait-with-missing-associated-type-restriction.rs:18:9
    |
 LL |     qux(x.func())
-   |         ^^^^^^^^ expected `usize`, found associated type
+   |     --- ^^^^^^^^ expected `usize`, found associated type
+   |     |
+   |     arguments to this function are incorrect
    |
    = note:         expected type `usize`
            found associated type `<T as Trait>::A`
+note: function defined here
+  --> $DIR/trait-with-missing-associated-type-restriction.rs:42:4
+   |
+LL | fn qux(_: usize) {}
+   |    ^^^ --------
 help: consider constraining the associated type `<T as Trait>::A` to `usize`
    |
 LL | fn bar<T: Trait<A = usize>>(x: T) {
@@ -42,10 +56,17 @@ error[E0308]: mismatched types
   --> $DIR/trait-with-missing-associated-type-restriction.rs:22:9
    |
 LL |     qux(x.func())
-   |         ^^^^^^^^ expected `usize`, found associated type
+   |     --- ^^^^^^^^ expected `usize`, found associated type
+   |     |
+   |     arguments to this function are incorrect
    |
    = note:         expected type `usize`
            found associated type `<impl Trait<i32> as Trait<i32>>::A`
+note: function defined here
+  --> $DIR/trait-with-missing-associated-type-restriction.rs:42:4
+   |
+LL | fn qux(_: usize) {}
+   |    ^^^ --------
 help: consider constraining the associated type `<impl Trait<i32> as Trait<i32>>::A` to `usize`
    |
 LL | fn foo2(x: impl Trait<i32, A = usize>) {
@@ -55,7 +76,9 @@ error[E0308]: mismatched types
   --> $DIR/trait-with-missing-associated-type-restriction.rs:26:12
    |
 LL |     x.funk(3);
-   |            ^ expected associated type, found integer
+   |       ---- ^ expected associated type, found integer
+   |       |
+   |       arguments to this function are incorrect
    |
    = note: expected associated type `<T as Trait<i32>>::A`
                          found type `{integer}`
@@ -67,6 +90,11 @@ LL |     fn func(&self) -> Self::A;
 LL |     fn funk(&self, _: Self::A);
 LL |     fn funq(&self) -> Self::A {}
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^ consider calling `Trait::funq`
+note: associated function defined here
+  --> $DIR/trait-with-missing-associated-type-restriction.rs:9:8
+   |
+LL |     fn funk(&self, _: Self::A);
+   |        ^^^^
 help: consider constraining the associated type `<T as Trait<i32>>::A` to `{integer}`
    |
 LL | fn bar2<T: Trait<i32, A = {integer}>>(x: T) {
@@ -76,10 +104,17 @@ error[E0308]: mismatched types
   --> $DIR/trait-with-missing-associated-type-restriction.rs:27:9
    |
 LL |     qux(x.func())
-   |         ^^^^^^^^ expected `usize`, found associated type
+   |     --- ^^^^^^^^ expected `usize`, found associated type
+   |     |
+   |     arguments to this function are incorrect
    |
    = note:         expected type `usize`
            found associated type `<T as Trait<i32>>::A`
+note: function defined here
+  --> $DIR/trait-with-missing-associated-type-restriction.rs:42:4
+   |
+LL | fn qux(_: usize) {}
+   |    ^^^ --------
 help: consider constraining the associated type `<T as Trait<i32>>::A` to `usize`
    |
 LL | fn bar2<T: Trait<i32, A = usize>>(x: T) {
@@ -91,25 +126,47 @@ error[E0308]: mismatched types
 LL | fn baz<D: std::fmt::Debug, T: Trait<A = D>>(x: T) {
    |        - this type parameter
 LL |     qux(x.func())
-   |         ^^^^^^^^ expected `usize`, found type parameter `D`
+   |     --- ^^^^^^^^ expected `usize`, found type parameter `D`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note:        expected type `usize`
            found type parameter `D`
+note: function defined here
+  --> $DIR/trait-with-missing-associated-type-restriction.rs:42:4
+   |
+LL | fn qux(_: usize) {}
+   |    ^^^ --------
 
 error[E0308]: mismatched types
   --> $DIR/trait-with-missing-associated-type-restriction.rs:35:9
    |
 LL |     qux(x.func())
-   |         ^^^^^^^^ expected `usize`, found `()`
+   |     --- ^^^^^^^^ expected `usize`, found `()`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/trait-with-missing-associated-type-restriction.rs:42:4
+   |
+LL | fn qux(_: usize) {}
+   |    ^^^ --------
 
 error[E0308]: mismatched types
   --> $DIR/trait-with-missing-associated-type-restriction.rs:39:9
    |
 LL |     qux(x.func())
-   |         ^^^^^^^^ expected `usize`, found associated type
+   |     --- ^^^^^^^^ expected `usize`, found associated type
+   |     |
+   |     arguments to this function are incorrect
    |
    = note:         expected type `usize`
            found associated type `<T as Trait>::A`
+note: function defined here
+  --> $DIR/trait-with-missing-associated-type-restriction.rs:42:4
+   |
+LL | fn qux(_: usize) {}
+   |    ^^^ --------
 help: consider constraining the associated type `<T as Trait>::A` to `usize`
    |
 LL | fn ban<T>(x: T) where T: Trait<A = usize> {
index eabdc59ddedd548ccdcb96982a43266fe1cc6abf..3d2530e204b3336943d618c880414612be503df2 100644 (file)
@@ -5,5 +5,5 @@
 
 fn main() {
     let _: () = 42;
-    //~^ ERROR mismatched types
+    //~^ ERROR arguments to this function are incorrect
 }
index 5c6859a0efe98a353db191d68ea39f93010dd1b4..d2fda09c0767f5d6db0d8fa906983d7a99454875 100644 (file)
@@ -2,7 +2,15 @@ error[E0308]: mismatched types
   --> $DIR/terr-in-field.rs:13:14
    |
 LL |     want_foo(b);
-   |              ^ expected struct `Foo`, found struct `Bar`
+   |     -------- ^ expected struct `Foo`, found struct `Bar`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/terr-in-field.rs:11:4
+   |
+LL | fn want_foo(f: Foo) {}
+   |    ^^^^^^^^ ------
 
 error: aborting due to previous error
 
index 34d4d9eaded8ac167dc6bcbc7ec23c415dc37e68..5a61a2fab12658fe91122d636899345189423670 100644 (file)
@@ -2,10 +2,17 @@ error[E0308]: mismatched types
   --> $DIR/terr-sorts.rs:10:14
    |
 LL |     want_foo(b);
-   |              ^ expected struct `Foo`, found struct `Box`
+   |     -------- ^ expected struct `Foo`, found struct `Box`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `Foo`
               found struct `Box<Foo>`
+note: function defined here
+  --> $DIR/terr-sorts.rs:8:4
+   |
+LL | fn want_foo(f: Foo) {}
+   |    ^^^^^^^^ ------
 help: consider unboxing the value
    |
 LL |     want_foo(*b);
index feb0c73a09d3d6335abf01036e14fc4dd108e81c..b67648c7b04da6b60d04f58add32f3e6cb26d767 100644 (file)
@@ -2,10 +2,17 @@ error[E0308]: mismatched types
   --> $DIR/sugar.rs:12:7
    |
 LL |     a(x);
-   |       ^ expected trait `Foo + Send`, found trait `Foo + Sync`
+   |     - ^ expected trait `Foo + Send`, found trait `Foo + Sync`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `Box<(dyn Foo + Send + 'static)>`
               found struct `Box<(dyn Foo + Sync + 'static)>`
+note: function defined here
+  --> $DIR/sugar.rs:5:4
+   |
+LL | fn a(_x: Box<dyn Foo + Send>) {
+   |    ^ -----------------------
 
 error: aborting due to previous error
 
index bf732e2491566f9f51386560f3fb1ffce2788525..f0c718c7a16db853d7538fe0577eb602c9de73c8 100644 (file)
@@ -5,10 +5,17 @@ LL | impl<F, Name, P> AddClass<Name, F> for Class<P>
    |      - this type parameter
 ...
 LL |         builder.push(output);
-   |                      ^^^^^^ expected type parameter `F`, found struct `Class`
+   |                 ---- ^^^^^^ expected type parameter `F`, found struct `Class`
+   |                 |
+   |                 arguments to this function are incorrect
    |
-   = note: expected type parameter `F`
-                      found struct `Class<P>`
+   = note: expected type `F`
+            found struct `Class<P>`
+note: associated function defined here
+  --> $DIR/issue-52893.rs:11:8
+   |
+LL |     fn push(self, other: T) -> Self::PushRes;
+   |        ^^^^
 
 error: aborting due to previous error
 
index 6caa23d8f4997ef4e97a81f31ab69b98d52cafef..8b6e610067be1f1d23dc44dbcb23ea2c1fc6d8f9 100644 (file)
@@ -2,8 +2,15 @@ error[E0308]: mismatched types
   --> $DIR/multidispatch-bad.rs:19:17
    |
 LL |     test(22i32, 44i32);
-   |                 ^^^^^ expected `u32`, found `i32`
+   |     ----        ^^^^^ expected `u32`, found `i32`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: function defined here
+  --> $DIR/multidispatch-bad.rs:13:4
+   |
+LL | fn test<T,U>(_: T, _: U)
+   |    ^^^^      ----  ----
 help: change the type of the numeric literal from `i32` to `u32`
    |
 LL |     test(22i32, 44u32);
index 10bcedaf4aa9ac06f1453825225d83769c2e4db9..fff7be987f2e8c57e669181aeeddb3e144902ffe 100644 (file)
@@ -2,19 +2,33 @@ error[E0308]: mismatched types
   --> $DIR/tuple-arity-mismatch.rs:6:20
    |
 LL |     let y = first ((1,2.0,3));
-   |                    ^^^^^^^^^ expected a tuple with 2 elements, found one with 3 elements
+   |             -----  ^^^^^^^^^ expected a tuple with 2 elements, found one with 3 elements
+   |             |
+   |             arguments to this function are incorrect
    |
    = note: expected tuple `(isize, f64)`
               found tuple `(isize, f64, {integer})`
+note: function defined here
+  --> $DIR/tuple-arity-mismatch.rs:3:4
+   |
+LL | fn first((value, _): (isize, f64)) -> isize { value }
+   |    ^^^^^ ------------------------
 
 error[E0308]: mismatched types
   --> $DIR/tuple-arity-mismatch.rs:12:20
    |
 LL |     let y = first ((1,));
-   |                    ^^^^ expected a tuple with 2 elements, found one with 1 element
+   |             -----  ^^^^ expected a tuple with 2 elements, found one with 1 element
+   |             |
+   |             arguments to this function are incorrect
    |
    = note: expected tuple `(isize, f64)`
               found tuple `(isize,)`
+note: function defined here
+  --> $DIR/tuple-arity-mismatch.rs:3:4
+   |
+LL | fn first((value, _): (isize, f64)) -> isize { value }
+   |    ^^^^^ ------------------------
 
 error: aborting due to 2 previous errors
 
index ddafc9763e79a6db7fcac23f37b9201b40def36a..c704ae9934b1c5602647f8faebf07ef1ae18e445 100644 (file)
@@ -2,7 +2,7 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied
   --> $DIR/wrong_argument_ice-2.rs:13:5
    |
 LL |     test(x.qux(), x.qux());
-   |     ^^^^ -------  ------- supplied 2 arguments
+   |     ^^^^
    |
 note: function defined here
   --> $DIR/wrong_argument_ice-2.rs:1:4
index f0d64d2a4e18db63f927ed26293637e408c4534e..6ea6e670fd600998b5c6f7723bd269e60784de68 100644 (file)
@@ -2,15 +2,21 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied
   --> $DIR/wrong_argument_ice-3.rs:9:16
    |
 LL |         groups.push(new_group, vec![process]);
-   |                ^^^^ ---------  ------------- supplied 2 arguments
-   |                |
-   |                expected 1 argument
+   |                ^^^^ ---------  ------------- argument unexpected
+   |                     |
+   |                     expected tuple, found struct `Vec`
    |
+   = note: expected tuple `(Vec<String>, Vec<Process>)`
+             found struct `Vec<String>`
 note: associated function defined here
   --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
    |
 LL |     pub fn push(&mut self, value: T) {
    |            ^^^^
+help: remove the extra argument
+   |
+LL |         groups.push({(Vec<String>, Vec<Process>)});
+   |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 error: aborting due to previous error
 
index fef5dca856db36592aad666b9a3cde8b603a3ffb..0c25b6801dc8efff0e11bf11f848cb420676cf45 100644 (file)
@@ -3,12 +3,15 @@ error[E0057]: this function takes 0 arguments but 1 argument was supplied
    |
 LL |       (|| {})(|| {
    |  _____^^^^^^^_-
-   | |     |
-   | |     expected 0 arguments
 LL | |
 LL | |         let b = 1;
 LL | |     });
-   | |_____- supplied 1 argument
+   | |_____- argument unexpected
+   |
+help: remove the extra argument
+   |
+LL |     (|| {})();
+   |     ~~~~~~~~~
 
 error: aborting due to previous error
 
index e96a957350b2fdb231116bf4ffe3895ca20e0a7c..2b4cb669f5c7d7f04f9484ddfa33c59950972962 100644 (file)
@@ -2,7 +2,7 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied
   --> $DIR/wrong_argument_ice.rs:11:18
    |
 LL |         self.acc.push_back(self.current_provides, self.current_requires);
-   |                  ^^^^^^^^^ ---------------------  --------------------- supplied 2 arguments
+   |                  ^^^^^^^^^
    |
 note: associated function defined here
   --> $SRC_DIR/alloc/src/collections/vec_deque/mod.rs:LL:COL
index a384d5f561c940e9d1d1b01d87443aec5c2d4e65..115ecb013766dd2e9bcd5fd60cd668c9577dfea8 100644 (file)
@@ -5,10 +5,17 @@ LL | impl<T> Enum<T> {
    |      - this type parameter
 LL |     fn ts_variant() {
 LL |         Self::TSVariant(());
-   |                         ^^ expected type parameter `T`, found `()`
+   |         --------------- ^^ expected type parameter `T`, found `()`
+   |         |
+   |         arguments to this function are incorrect
    |
    = note: expected type parameter `T`
                    found unit type `()`
+note: tuple variant defined here
+  --> $DIR/enum-variant-generic-args.rs:7:16
+   |
+LL | enum Enum<T> { TSVariant(T), SVariant { v: T }, UVariant }
+   |                ^^^^^^^^^
 
 error[E0109]: type arguments are not allowed for this type
   --> $DIR/enum-variant-generic-args.rs:15:27
@@ -29,10 +36,17 @@ LL | impl<T> Enum<T> {
    |      - this type parameter
 ...
 LL |         Self::<()>::TSVariant(());
-   |                               ^^ expected type parameter `T`, found `()`
+   |         --------------------- ^^ expected type parameter `T`, found `()`
+   |         |
+   |         arguments to this function are incorrect
    |
    = note: expected type parameter `T`
                    found unit type `()`
+note: tuple variant defined here
+  --> $DIR/enum-variant-generic-args.rs:7:16
+   |
+LL | enum Enum<T> { TSVariant(T), SVariant { v: T }, UVariant }
+   |                ^^^^^^^^^
 
 error[E0109]: type arguments are not allowed for this type
   --> $DIR/enum-variant-generic-args.rs:20:16
index 37543c137f66f861d4dbf23e8d50afa15c09b35a..3fc5a3594d852bd45f20da3df669c8aae9ee28e5 100644 (file)
@@ -2,15 +2,17 @@ error[E0061]: this function takes 1 argument but 0 arguments were supplied
   --> $DIR/enum-variant-priority-higher-than-other-inherent.rs:21:5
    |
 LL |     <E>::V();
-   |     ^^^^^^-- supplied 0 arguments
-   |     |
-   |     expected 1 argument
+   |     ^^^^^^-- an argument of type `u8` is missing
    |
 note: tuple variant defined here
   --> $DIR/enum-variant-priority-higher-than-other-inherent.rs:5:5
    |
 LL |     V(u8)
    |     ^
+help: provide the argument
+   |
+LL |     <E>::V({u8});
+   |     ~~~~~~~~~~~~
 
 error[E0308]: mismatched types
   --> $DIR/enum-variant-priority-higher-than-other-inherent.rs:22:17
index e5666d4fe4f4b3eb3d18674f01ac8119627274cb..18ed4986f89312ba9aee248d56e623683ac3d051 100644 (file)
@@ -11,15 +11,17 @@ error[E0061]: this function takes 1 argument but 2 arguments were supplied
   --> $DIR/type-ascription-instead-of-initializer.rs:2:12
    |
 LL |     let x: Vec::with_capacity(10, 20);
-   |            ^^^^^^^^^^^^^^^^^^ --  -- supplied 2 arguments
-   |            |
-   |            expected 1 argument
+   |            ^^^^^^^^^^^^^^^^^^     -- argument unexpected
    |
 note: associated function defined here
   --> $SRC_DIR/alloc/src/vec/mod.rs:LL:COL
    |
 LL |     pub fn with_capacity(capacity: usize) -> Self {
    |            ^^^^^^^^^^^^^
+help: remove the extra argument
+   |
+LL |     let x: Vec::with_capacity(10);
+   |            ~~~~~~~~~~~~~~~~~~~~~~
 
 error: aborting due to 2 previous errors
 
index 49d40ebed130c517b602cf86ae3989cd37d79486..783f747fa6db68beb62f48e54bcdc1c3542b7a08 100644 (file)
@@ -2,19 +2,33 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch-same-crate-name.rs:16:20
    |
 LL |         a::try_foo(foo2);
-   |                    ^^^^ expected struct `main::a::Foo`, found a different struct `main::a::Foo`
+   |         ---------- ^^^^ expected struct `main::a::Foo`, found a different struct `main::a::Foo`
+   |         |
+   |         arguments to this function are incorrect
    |
    = note: perhaps two different versions of crate `crate_a1` are being used?
+note: function defined here
+  --> $DIR/auxiliary/crate_a1.rs:10:8
+   |
+LL | pub fn try_foo(x: Foo){}
+   |        ^^^^^^^
 
 error[E0308]: mismatched types
   --> $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`
+   |         ---------- ^^^^ expected trait `main::a::Bar`, found a different trait `main::a::Bar`
+   |         |
+   |         arguments to this function are incorrect
    |
    = note: expected struct `Box<(dyn main::a::Bar + 'static)>`
               found struct `Box<dyn main::a::Bar>`
    = note: perhaps two different versions of crate `crate_a1` are being used?
+note: function defined here
+  --> $DIR/auxiliary/crate_a1.rs:11:8
+   |
+LL | pub fn try_bar(x: Box<Bar>){}
+   |        ^^^^^^^
 
 error: aborting due to 2 previous errors
 
index 24c71c63103d3e79ec06a6cdf880129253e5fc80..6c187bad0725c7d525acf6db17b4acd32982c410 100644 (file)
@@ -2,418 +2,749 @@ error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:17:17
    |
 LL |     want::<foo>(f);
-   |                 ^ expected struct `foo`, found `usize`
+   |     ----------- ^ expected struct `foo`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:18:17
    |
 LL |     want::<bar>(f);
-   |                 ^ expected struct `bar`, found `usize`
+   |     ----------- ^ expected struct `bar`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:19:24
    |
 LL |     want::<Foo<usize>>(f);
-   |                        ^ expected struct `Foo`, found `usize`
+   |     ------------------ ^ expected struct `Foo`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `Foo<usize>`
                 found type `usize`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:20:27
    |
 LL |     want::<Foo<usize, B>>(f);
-   |                           ^ expected struct `Foo`, found `usize`
+   |     --------------------- ^ expected struct `Foo`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `Foo<usize, B>`
                 found type `usize`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:21:22
    |
 LL |     want::<Foo<foo>>(f);
-   |                      ^ expected struct `Foo`, found `usize`
+   |     ---------------- ^ expected struct `Foo`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `Foo<foo>`
                 found type `usize`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:22:25
    |
 LL |     want::<Foo<foo, B>>(f);
-   |                         ^ expected struct `Foo`, found `usize`
+   |     ------------------- ^ expected struct `Foo`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `Foo<foo, B>`
                 found type `usize`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:23:22
    |
 LL |     want::<Foo<bar>>(f);
-   |                      ^ expected struct `Foo`, found `usize`
+   |     ---------------- ^ expected struct `Foo`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `Foo<bar>`
                 found type `usize`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:24:25
    |
 LL |     want::<Foo<bar, B>>(f);
-   |                         ^ expected struct `Foo`, found `usize`
+   |     ------------------- ^ expected struct `Foo`, found `usize`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `Foo<bar, B>`
                 found type `usize`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:28:19
    |
 LL |     want::<usize>(f);
-   |                   ^ expected `usize`, found struct `foo`
+   |     ------------- ^ expected `usize`, found struct `foo`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:29:17
    |
 LL |     want::<bar>(f);
-   |                 ^ expected struct `bar`, found struct `foo`
+   |     ----------- ^ expected struct `bar`, found struct `foo`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:30:24
    |
 LL |     want::<Foo<usize>>(f);
-   |                        ^ expected struct `Foo`, found struct `foo`
+   |     ------------------ ^ expected struct `Foo`, found struct `foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `Foo<usize>`
               found struct `foo`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:31:27
    |
 LL |     want::<Foo<usize, B>>(f);
-   |                           ^ expected struct `Foo`, found struct `foo`
+   |     --------------------- ^ expected struct `Foo`, found struct `foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `Foo<usize, B>`
               found struct `foo`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:32:22
    |
 LL |     want::<Foo<foo>>(f);
-   |                      ^ expected struct `Foo`, found struct `foo`
+   |     ---------------- ^ expected struct `Foo`, found struct `foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `Foo<foo>`
               found struct `foo`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:33:25
    |
 LL |     want::<Foo<foo, B>>(f);
-   |                         ^ expected struct `Foo`, found struct `foo`
+   |     ------------------- ^ expected struct `Foo`, found struct `foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `Foo<foo, B>`
               found struct `foo`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:34:22
    |
 LL |     want::<Foo<bar>>(f);
-   |                      ^ expected struct `Foo`, found struct `foo`
+   |     ---------------- ^ expected struct `Foo`, found struct `foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `Foo<bar>`
               found struct `foo`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:35:25
    |
 LL |     want::<Foo<bar, B>>(f);
-   |                         ^ expected struct `Foo`, found struct `foo`
+   |     ------------------- ^ expected struct `Foo`, found struct `foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `Foo<bar, B>`
               found struct `foo`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:39:19
    |
 LL |     want::<usize>(f);
-   |                   ^ expected `usize`, found struct `Foo`
+   |     ------------- ^ expected `usize`, found struct `Foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected type `usize`
             found struct `Foo<foo>`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:40:17
    |
 LL |     want::<foo>(f);
-   |                 ^ expected struct `foo`, found struct `Foo`
+   |     ----------- ^ expected struct `foo`, found struct `Foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `foo`
               found struct `Foo<foo>`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:41:17
    |
 LL |     want::<bar>(f);
-   |                 ^ expected struct `bar`, found struct `Foo`
+   |     ----------- ^ expected struct `bar`, found struct `Foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `bar`
               found struct `Foo<foo>`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:42:24
    |
 LL |     want::<Foo<usize>>(f);
-   |                        ^ expected `usize`, found struct `foo`
+   |     ------------------ ^ expected `usize`, found struct `foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `Foo<usize>`
               found struct `Foo<foo>`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:43:27
    |
 LL |     want::<Foo<usize, B>>(f);
-   |                           ^ expected `usize`, found struct `foo`
+   |     --------------------- ^ expected `usize`, found struct `foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `Foo<usize, B>`
               found struct `Foo<foo, A>`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:44:25
    |
 LL |     want::<Foo<foo, B>>(f);
-   |                         ^ expected struct `B`, found struct `A`
+   |     ------------------- ^ expected struct `B`, found struct `A`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `Foo<_, B>`
               found struct `Foo<_, A>`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:45:22
    |
 LL |     want::<Foo<bar>>(f);
-   |                      ^ expected struct `bar`, found struct `foo`
+   |     ---------------- ^ expected struct `bar`, found struct `foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `Foo<bar>`
               found struct `Foo<foo>`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:46:25
    |
 LL |     want::<Foo<bar, B>>(f);
-   |                         ^ expected struct `bar`, found struct `foo`
+   |     ------------------- ^ expected struct `bar`, found struct `foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `Foo<bar, B>`
               found struct `Foo<foo, A>`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:47:23
    |
 LL |     want::<&Foo<foo>>(f);
-   |                       ^
-   |                       |
-   |                       expected `&Foo<foo>`, found struct `Foo`
-   |                       help: consider borrowing here: `&f`
+   |     ----------------- ^
+   |     |                 |
+   |     |                 expected `&Foo<foo>`, found struct `Foo`
+   |     |                 help: consider borrowing here: `&f`
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&Foo<foo>`
                  found struct `Foo<foo>`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:48:26
    |
 LL |     want::<&Foo<foo, B>>(f);
-   |                          ^ expected `&Foo<foo, B>`, found struct `Foo`
+   |     -------------------- ^ expected `&Foo<foo, B>`, found struct `Foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&Foo<foo, B>`
                  found struct `Foo<foo>`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:52:19
    |
 LL |     want::<usize>(f);
-   |                   ^ expected `usize`, found struct `Foo`
+   |     ------------- ^ expected `usize`, found struct `Foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected type `usize`
             found struct `Foo<foo, B>`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:53:17
    |
 LL |     want::<foo>(f);
-   |                 ^ expected struct `foo`, found struct `Foo`
+   |     ----------- ^ expected struct `foo`, found struct `Foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `foo`
               found struct `Foo<foo, B>`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:54:17
    |
 LL |     want::<bar>(f);
-   |                 ^ expected struct `bar`, found struct `Foo`
+   |     ----------- ^ expected struct `bar`, found struct `Foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `bar`
               found struct `Foo<foo, B>`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:55:24
    |
 LL |     want::<Foo<usize>>(f);
-   |                        ^ expected `usize`, found struct `foo`
+   |     ------------------ ^ expected `usize`, found struct `foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `Foo<usize, A>`
               found struct `Foo<foo, B>`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:56:27
    |
 LL |     want::<Foo<usize, B>>(f);
-   |                           ^ expected `usize`, found struct `foo`
+   |     --------------------- ^ expected `usize`, found struct `foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `Foo<usize, _>`
               found struct `Foo<foo, _>`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:57:22
    |
 LL |     want::<Foo<foo>>(f);
-   |                      ^ expected struct `A`, found struct `B`
+   |     ---------------- ^ expected struct `A`, found struct `B`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `Foo<_, A>`
               found struct `Foo<_, B>`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:58:22
    |
 LL |     want::<Foo<bar>>(f);
-   |                      ^ expected struct `bar`, found struct `foo`
+   |     ---------------- ^ expected struct `bar`, found struct `foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `Foo<bar, A>`
               found struct `Foo<foo, B>`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:59:25
    |
 LL |     want::<Foo<bar, B>>(f);
-   |                         ^ expected struct `bar`, found struct `foo`
+   |     ------------------- ^ expected struct `bar`, found struct `foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `Foo<bar, _>`
               found struct `Foo<foo, _>`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:60:23
    |
 LL |     want::<&Foo<foo>>(f);
-   |                       ^ expected `&Foo<foo>`, found struct `Foo`
+   |     ----------------- ^ expected `&Foo<foo>`, found struct `Foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&Foo<foo>`
                  found struct `Foo<foo, B>`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:61:26
    |
 LL |     want::<&Foo<foo, B>>(f);
-   |                          ^
-   |                          |
-   |                          expected `&Foo<foo, B>`, found struct `Foo`
-   |                          help: consider borrowing here: `&f`
+   |     -------------------- ^
+   |     |                    |
+   |     |                    expected `&Foo<foo, B>`, found struct `Foo`
+   |     |                    help: consider borrowing here: `&f`
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&Foo<foo, B>`
                  found struct `Foo<foo, B>`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:65:19
    |
 LL |     want::<usize>(f);
-   |                   ^ expected `usize`, found struct `Foo`
+   |     ------------- ^ expected `usize`, found struct `Foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected type `usize`
             found struct `Foo<foo, B, A>`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:66:17
    |
 LL |     want::<foo>(f);
-   |                 ^ expected struct `foo`, found struct `Foo`
+   |     ----------- ^ expected struct `foo`, found struct `Foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `foo`
               found struct `Foo<foo, B, A>`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:67:17
    |
 LL |     want::<bar>(f);
-   |                 ^ expected struct `bar`, found struct `Foo`
+   |     ----------- ^ expected struct `bar`, found struct `Foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `bar`
               found struct `Foo<foo, B, A>`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:68:24
    |
 LL |     want::<Foo<usize>>(f);
-   |                        ^ expected `usize`, found struct `foo`
+   |     ------------------ ^ expected `usize`, found struct `foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `Foo<usize, A, B>`
               found struct `Foo<foo, B, A>`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:69:27
    |
 LL |     want::<Foo<usize, B>>(f);
-   |                           ^ expected `usize`, found struct `foo`
+   |     --------------------- ^ expected `usize`, found struct `foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `Foo<usize, _, B>`
               found struct `Foo<foo, _, A>`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:70:22
    |
 LL |     want::<Foo<foo>>(f);
-   |                      ^ expected struct `A`, found struct `B`
+   |     ---------------- ^ expected struct `A`, found struct `B`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `Foo<_, A, B>`
               found struct `Foo<_, B, A>`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:71:25
    |
 LL |     want::<Foo<foo, B>>(f);
-   |                         ^ expected struct `B`, found struct `A`
+   |     ------------------- ^ expected struct `B`, found struct `A`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `Foo<_, _, B>`
               found struct `Foo<_, _, A>`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:72:22
    |
 LL |     want::<Foo<bar>>(f);
-   |                      ^ expected struct `bar`, found struct `foo`
+   |     ---------------- ^ expected struct `bar`, found struct `foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `Foo<bar, A, B>`
               found struct `Foo<foo, B, A>`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:73:25
    |
 LL |     want::<Foo<bar, B>>(f);
-   |                         ^ expected struct `bar`, found struct `foo`
+   |     ------------------- ^ expected struct `bar`, found struct `foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected struct `Foo<bar, _, B>`
               found struct `Foo<foo, _, A>`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:74:23
    |
 LL |     want::<&Foo<foo>>(f);
-   |                       ^ expected `&Foo<foo>`, found struct `Foo`
+   |     ----------------- ^ expected `&Foo<foo>`, found struct `Foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&Foo<foo>`
                  found struct `Foo<foo, B, A>`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error[E0308]: mismatched types
   --> $DIR/type-mismatch.rs:75:26
    |
 LL |     want::<&Foo<foo, B>>(f);
-   |                          ^ expected `&Foo<foo, B>`, found struct `Foo`
+   |     -------------------- ^ expected `&Foo<foo, B>`, found struct `Foo`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected reference `&Foo<foo, B>`
                  found struct `Foo<foo, B, A>`
+note: function defined here
+  --> $DIR/type-mismatch.rs:14:4
+   |
+LL | fn want<T>(t: T) {}
+   |    ^^^^    ----
 
 error: aborting due to 47 previous errors
 
index 39bff88e7f81a3624cbbf3ec0aa5bc3bc2e26122..9346150750128c4b61fdd256e71d081a0d086df4 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/issue-46112.rs:9:21
    |
 LL | fn main() { test(Ok(())); }
-   |                     ^^ expected enum `Option`, found `()`
+   |                  -- ^^ expected enum `Option`, found `()`
+   |                  |
+   |                  arguments to this enum variant are incorrect
    |
    = note:   expected enum `Option<()>`
            found unit type `()`
index 0a79d539ea96246da68fc42f57b0fb72155e1c41..04dc0e36520b4e7e9b5033f746c8270b3abeedce 100644 (file)
@@ -8,10 +8,17 @@ error[E0308]: mismatched types
   --> $DIR/issue-84768.rs:7:42
    |
 LL |     <F as FnOnce(&mut u8)>::call_once(f, 1)
-   |                                          ^ expected tuple, found integer
+   |     ---------------------------------    ^ expected tuple, found integer
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected tuple `(&mut u8,)`
                found type `{integer}`
+note: associated function defined here
+  --> $SRC_DIR/core/src/ops/function.rs:LL:COL
+   |
+LL |     extern "rust-call" fn call_once(self, args: Args) -> Self::Output;
+   |                           ^^^^^^^^^
 
 error: aborting due to 2 previous errors
 
index 4cb46a34a07a11b76b93c7cbc4b0f3014077bf9a..5fa1ae1a54f722591a341779584652c702b3aef2 100644 (file)
@@ -2,10 +2,17 @@ error[E0308]: mismatched types
   --> $DIR/issue-89856.rs:6:20
    |
 LL |     take_str_maybe(option);
-   |                    ^^^^^^ expected `str`, found struct `String`
+   |     -------------- ^^^^^^ expected `str`, found struct `String`
+   |     |
+   |     arguments to this function are incorrect
    |
    = note: expected enum `Option<&str>`
               found enum `Option<&String>`
+note: function defined here
+  --> $DIR/issue-89856.rs:1:4
+   |
+LL | fn take_str_maybe(x: Option<&str>) -> Option<&str> { None }
+   |    ^^^^^^^^^^^^^^ ---------------
 help: try converting the passed type into a `&str`
    |
 LL |     take_str_maybe(option.map(|x| &**x));
index 6e99feed33f9c9d99c43ceeb17961e0c319aee5d..721b2c821efec8b185b68d0d3918795a960c9647 100644 (file)
@@ -2,95 +2,116 @@ error[E0061]: this enum variant takes 1 argument but 2 arguments were supplied
   --> $DIR/struct-enum-wrong-args.rs:6:13
    |
 LL |     let _ = Some(3, 2);
-   |             ^^^^ -  - supplied 2 arguments
-   |             |
-   |             expected 1 argument
+   |             ^^^^    - argument unexpected
+   |
+help: remove the extra argument
+   |
+LL |     let _ = Some(3);
+   |             ~~~~~~~
 
 error[E0061]: this enum variant takes 1 argument but 3 arguments were supplied
   --> $DIR/struct-enum-wrong-args.rs:7:13
    |
 LL |     let _ = Ok(3, 6, 2);
-   |             ^^ -  -  - supplied 3 arguments
-   |             |
-   |             expected 1 argument
+   |             ^^    -  - argument unexpected
+   |                   |
+   |                   argument unexpected
+   |
+help: remove the extra arguments
+   |
+LL |     let _ = Ok(3);
+   |             ~~~~~
 
 error[E0061]: this enum variant takes 1 argument but 0 arguments were supplied
   --> $DIR/struct-enum-wrong-args.rs:8:13
    |
 LL |     let _ = Ok();
-   |             ^^-- supplied 0 arguments
-   |             |
-   |             expected 1 argument
+   |             ^^-- an argument is missing
+   |
+help: provide the argument
+   |
+LL |     let _ = Ok({_});
+   |             ~~~~~~~
 
 error[E0061]: this struct takes 1 argument but 0 arguments were supplied
   --> $DIR/struct-enum-wrong-args.rs:9:13
    |
 LL |     let _ = Wrapper();
-   |             ^^^^^^^-- supplied 0 arguments
-   |             |
-   |             expected 1 argument
+   |             ^^^^^^^-- an argument of type `i32` is missing
    |
 note: tuple struct defined here
   --> $DIR/struct-enum-wrong-args.rs:2:8
    |
 LL | struct Wrapper(i32);
    |        ^^^^^^^
+help: provide the argument
+   |
+LL |     let _ = Wrapper({i32});
+   |             ~~~~~~~~~~~~~~
 
 error[E0061]: this struct takes 1 argument but 2 arguments were supplied
   --> $DIR/struct-enum-wrong-args.rs:10:13
    |
 LL |     let _ = Wrapper(5, 2);
-   |             ^^^^^^^ -  - supplied 2 arguments
-   |             |
-   |             expected 1 argument
+   |             ^^^^^^^    - argument unexpected
    |
 note: tuple struct defined here
   --> $DIR/struct-enum-wrong-args.rs:2:8
    |
 LL | struct Wrapper(i32);
    |        ^^^^^^^
+help: remove the extra argument
+   |
+LL |     let _ = Wrapper(5);
+   |             ~~~~~~~~~~
 
 error[E0061]: this struct takes 2 arguments but 0 arguments were supplied
   --> $DIR/struct-enum-wrong-args.rs:11:13
    |
 LL |     let _ = DoubleWrapper();
-   |             ^^^^^^^^^^^^^-- supplied 0 arguments
-   |             |
-   |             expected 2 arguments
+   |             ^^^^^^^^^^^^^-- two arguments of type `i32` and `i32` are missing
    |
 note: tuple struct defined here
   --> $DIR/struct-enum-wrong-args.rs:3:8
    |
 LL | struct DoubleWrapper(i32, i32);
    |        ^^^^^^^^^^^^^
+help: provide the arguments
+   |
+LL |     let _ = DoubleWrapper({i32}, {i32});
+   |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 error[E0061]: this struct takes 2 arguments but 1 argument was supplied
   --> $DIR/struct-enum-wrong-args.rs:12:13
    |
 LL |     let _ = DoubleWrapper(5);
-   |             ^^^^^^^^^^^^^ - supplied 1 argument
-   |             |
-   |             expected 2 arguments
+   |             ^^^^^^^^^^^^^--- an argument of type `i32` is missing
    |
 note: tuple struct defined here
   --> $DIR/struct-enum-wrong-args.rs:3:8
    |
 LL | struct DoubleWrapper(i32, i32);
    |        ^^^^^^^^^^^^^
+help: provide the argument
+   |
+LL |     let _ = DoubleWrapper(5, {i32});
+   |             ~~~~~~~~~~~~~~~~~~~~~~~
 
 error[E0061]: this struct takes 2 arguments but 3 arguments were supplied
   --> $DIR/struct-enum-wrong-args.rs:13:13
    |
 LL |     let _ = DoubleWrapper(5, 2, 7);
-   |             ^^^^^^^^^^^^^ -  -  - supplied 3 arguments
-   |             |
-   |             expected 2 arguments
+   |             ^^^^^^^^^^^^^       - argument unexpected
    |
 note: tuple struct defined here
   --> $DIR/struct-enum-wrong-args.rs:3:8
    |
 LL | struct DoubleWrapper(i32, i32);
    |        ^^^^^^^^^^^^^
+help: remove the extra argument
+   |
+LL |     let _ = DoubleWrapper(5, 2);
+   |             ~~~~~~~~~~~~~~~~~~~
 
 error: aborting due to 8 previous errors
 
index 74766d9fdd1b12559e50bda4cf02579761cddc48..c6f9b3661a232a84efb7c90365134c266866aa3c 100644 (file)
@@ -20,8 +20,15 @@ error[E0308]: mismatched types
   --> $DIR/ufcs-qpath-self-mismatch.rs:6:28
    |
 LL |     <i32 as Add<i32>>::add(1u32, 2);
-   |                            ^^^^ expected `i32`, found `u32`
+   |     ---------------------- ^^^^ expected `i32`, found `u32`
+   |     |
+   |     arguments to this function are incorrect
    |
+note: associated function defined here
+  --> $SRC_DIR/core/src/ops/arith.rs:LL:COL
+   |
+LL |     fn add(self, rhs: Rhs) -> Self::Output;
+   |        ^^^
 help: change the type of the numeric literal from `u32` to `i32`
    |
 LL |     <i32 as Add<i32>>::add(1i32, 2);
@@ -31,8 +38,15 @@ error[E0308]: mismatched types
   --> $DIR/ufcs-qpath-self-mismatch.rs:8:31
    |
 LL |     <i32 as Add<i32>>::add(1, 2u32);
-   |                               ^^^^ expected `i32`, found `u32`
+   |     ----------------------    ^^^^ expected `i32`, found `u32`
+   |     |
+   |     arguments to this function are incorrect
+   |
+note: associated function defined here
+  --> $SRC_DIR/core/src/ops/arith.rs:LL:COL
    |
+LL |     fn add(self, rhs: Rhs) -> Self::Output;
+   |        ^^^
 help: change the type of the numeric literal from `u32` to `i32`
    |
 LL |     <i32 as Add<i32>>::add(1, 2i32);
index f791ea62ceb65f50ca68d90891bb18aebbc68bce..ea1ca380b1c7a853c20c2b15e007f85f325649e6 100644 (file)
@@ -2,7 +2,9 @@ error[E0308]: mismatched types
   --> $DIR/unboxed-closures-type-mismatch.rs:5:15
    |
 LL |     let z = f(1_usize, 2);
-   |               ^^^^^^^ expected `isize`, found `usize`
+   |             - ^^^^^^^ expected `isize`, found `usize`
+   |             |
+   |             arguments to this function are incorrect
    |
 help: change the type of the numeric literal from `usize` to `isize`
    |