X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_trait_selection%2Fsrc%2Ftraits%2Ferror_reporting%2Fmod.rs;h=0c38c829760bedf64d8f9dcd67aee5f6dd13af92;hb=ddd326fda4358df67f1efa185e1f16e9acf3d234;hp=1fbc904eb48e83f2aed1968d2a0e638b4550361a;hpb=3d9dd681f520d1d59f38aed0056cf9474894cc74;p=rust.git diff --git a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs index 1fbc904eb48..0c38c829760 100644 --- a/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs +++ b/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs @@ -634,9 +634,9 @@ fn report_selection_error( &format!( "expected a closure taking {} argument{}, but one taking {} argument{} was given", given.len(), - if given.len() == 1 { "" } else { "s" }, + pluralize!(given.len()), expected.len(), - if expected.len() == 1 { "" } else { "s" }, + pluralize!(expected.len()), ) ); } else if !self.same_type_modulo_infer(given_ty, expected_ty) { @@ -788,24 +788,9 @@ fn report_selection_error( span_bug!(span, "coerce requirement gave wrong error: `{:?}`", predicate) } - ty::PredicateKind::RegionOutlives(predicate) => { - let predicate = bound_predicate.rebind(predicate); - let predicate = self.resolve_vars_if_possible(predicate); - let err = self - .region_outlives_predicate(&obligation.cause, predicate) - .err() - .unwrap(); - struct_span_err!( - self.tcx.sess, - span, - E0279, - "the requirement `{}` is not satisfied (`{}`)", - predicate, - err, - ) - } - - ty::PredicateKind::Projection(..) | ty::PredicateKind::TypeOutlives(..) => { + ty::PredicateKind::RegionOutlives(..) + | ty::PredicateKind::Projection(..) + | ty::PredicateKind::TypeOutlives(..) => { let predicate = self.resolve_vars_if_possible(obligation.predicate); struct_span_err!( self.tcx.sess,