diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index 2c8590aa4e3..4f942a22cb8 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -2750,3 +2750,16 @@ pub enum Node<'hir> { Crate, } + +impl<'hir> Node<'hir> { + pub fn ident(&self) -> Option { + + match self { + Node::TraitItem(TraitItem { ident, .. }) | + Node::ImplItem(ImplItem { ident, .. }) | + Node::ForeignItem(ForeignItem { ident, .. }) | + Node::Item(Item { ident, .. }) => Some(*ident), + _ => None, + } + } +} diff --git a/src/librustc/traits/error_reporting.rs b/src/librustc/traits/error_reporting.rs index c9018f1c290..03f8ac250e9 100644 --- a/src/librustc/traits/error_reporting.rs +++ b/src/librustc/traits/error_reporting.rs @@ -40,10 +40,12 @@ use syntax::symbol::{sym, kw}; use syntax_pos::{DUMMY_SP, Span, ExpnKind}; impl<'a, 'tcx> InferCtxt<'a, 'tcx> { - pub fn report_fulfillment_errors(&self, - errors: &[FulfillmentError<'tcx>], - body_id: Option, - fallback_has_occurred: bool) { + pub fn report_fulfillment_errors( + &self, + errors: &[FulfillmentError<'tcx>], + body_id: Option, + fallback_has_occurred: bool, + ) { #[derive(Debug)] struct ErrorDescriptor<'tcx> { predicate: ty::Predicate<'tcx>, @@ -1651,6 +1653,18 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> { err.note(&msg); } } + ObligationCauseCode::BindingObligation(item_def_id, span) => { + let item_name = tcx.def_path_str(item_def_id); + let msg = format!("required by this bound in `{}`", item_name); + if let Some(ident) = tcx.opt_item_name(item_def_id) { + err.span_label(ident.span, ""); + } + if span != DUMMY_SP { + err.span_label(span, &msg); + } else { + err.note(&msg); + } + } ObligationCauseCode::ObjectCastObligation(object_ty) => { err.note(&format!("required for the cast to the object type `{}`", self.ty_to_string(object_ty))); diff --git a/src/librustc/traits/mod.rs b/src/librustc/traits/mod.rs index 27e4d1237c2..1123422ad60 100644 --- a/src/librustc/traits/mod.rs +++ b/src/librustc/traits/mod.rs @@ -176,6 +176,9 @@ pub enum ObligationCauseCode<'tcx> { /// also implement all supertraits of `X`. ItemObligation(DefId), + /// Like `ItemObligation`, but with extra detail on the source of the obligation. + BindingObligation(DefId, Span), + /// A type like `&'a T` is WF only if `T: 'a`. ReferenceOutlivesReferent(Ty<'tcx>), diff --git a/src/librustc/traits/structural_impls.rs b/src/librustc/traits/structural_impls.rs index 6930c936828..68c97226f89 100644 --- a/src/librustc/traits/structural_impls.rs +++ b/src/librustc/traits/structural_impls.rs @@ -472,6 +472,7 @@ impl<'a, 'tcx> Lift<'tcx> for traits::ObligationCauseCode<'a> { super::TupleElem => Some(super::TupleElem), super::ProjectionWf(proj) => tcx.lift(&proj).map(super::ProjectionWf), super::ItemObligation(def_id) => Some(super::ItemObligation(def_id)), + super::BindingObligation(def_id, span) => Some(super::BindingObligation(def_id, span)), super::ReferenceOutlivesReferent(ty) => { tcx.lift(&ty).map(super::ReferenceOutlivesReferent) } diff --git a/src/librustc/ty/mod.rs b/src/librustc/ty/mod.rs index 5ca819e12f2..8bb9648e031 100644 --- a/src/librustc/ty/mod.rs +++ b/src/librustc/ty/mod.rs @@ -2797,6 +2797,10 @@ impl<'tcx> TyCtxt<'tcx> { }) } + pub fn opt_item_name(self, def_id: DefId) -> Option { + self.hir().as_local_hir_id(def_id).and_then(|hir_id| self.hir().get(hir_id).ident()) + } + pub fn opt_associated_item(self, def_id: DefId) -> Option { let is_associated_item = if let Some(hir_id) = self.hir().as_local_hir_id(def_id) { match self.hir().get(hir_id) { diff --git a/src/librustc_typeck/check/mod.rs b/src/librustc_typeck/check/mod.rs index c96eab86298..743e6661247 100644 --- a/src/librustc_typeck/check/mod.rs +++ b/src/librustc_typeck/check/mod.rs @@ -2617,16 +2617,24 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { /// As `instantiate_type_scheme`, but for the bounds found in a /// generic type scheme. - fn instantiate_bounds(&self, span: Span, def_id: DefId, substs: SubstsRef<'tcx>) - -> ty::InstantiatedPredicates<'tcx> { + fn instantiate_bounds( + &self, + span: Span, + def_id: DefId, + substs: SubstsRef<'tcx>, + ) -> (ty::InstantiatedPredicates<'tcx>, Vec) { let bounds = self.tcx.predicates_of(def_id); + let spans: Vec = bounds.predicates.iter().map(|(_, span)| *span).collect(); let result = bounds.instantiate(self.tcx, substs); let result = self.normalize_associated_types_in(span, &result); - debug!("instantiate_bounds(bounds={:?}, substs={:?}) = {:?}", + debug!( + "instantiate_bounds(bounds={:?}, substs={:?}) = {:?}, {:?}", bounds, substs, - result); - result + result, + spans, + ); + (result, spans) } /// Replaces the opaque types from the given value with type variables, @@ -3194,8 +3202,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { // All the input types from the fn signature must outlive the call // so as to validate implied bounds. - for &fn_input_ty in fn_inputs { - self.register_wf_obligation(fn_input_ty, sp, traits::MiscObligation); + for (fn_input_ty, arg_expr) in fn_inputs.iter().zip(args.iter()) { + self.register_wf_obligation(fn_input_ty, arg_expr.span, traits::MiscObligation); } let expected_arg_count = fn_inputs.len(); @@ -3604,7 +3612,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { self.write_user_type_annotation_from_substs(hir_id, did, substs, None); // Check bounds on type arguments used in the path. - let bounds = self.instantiate_bounds(path_span, did, substs); + let (bounds, _) = self.instantiate_bounds(path_span, did, substs); let cause = traits::ObligationCause::new( path_span, self.body_id, @@ -4730,11 +4738,23 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { // Add all the obligations that are required, substituting and // normalized appropriately. - let bounds = self.instantiate_bounds(span, def_id, &substs); - self.add_obligations_for_parameters( - traits::ObligationCause::new(span, self.body_id, traits::ItemObligation(def_id)), + let (bounds, spans) = self.instantiate_bounds(span, def_id, &substs); + + for (i, mut obligation) in traits::predicates_for_generics( + traits::ObligationCause::new( + span, + self.body_id, + traits::ItemObligation(def_id), + ), + self.param_env, &bounds, - ); + ).into_iter().enumerate() { + // This makes the error point at the bound, but we want to point at the argument + if let Some(span) = spans.get(i) { + obligation.cause.code = traits::BindingObligation(def_id, *span); + } + self.register_predicate(obligation); + } // Substitute the values for the type parameters into the type of // the referenced item. diff --git a/src/test/ui/anonymous-higher-ranked-lifetime.stderr b/src/test/ui/anonymous-higher-ranked-lifetime.stderr index c65a44bfbcc..51550e1471e 100644 --- a/src/test/ui/anonymous-higher-ranked-lifetime.stderr +++ b/src/test/ui/anonymous-higher-ranked-lifetime.stderr @@ -7,7 +7,7 @@ LL | f1(|_: (), _: ()| {}); | expected signature of `for<'r, 's> fn(&'r (), &'s ()) -> _` ... LL | fn f1(_: F) where F: Fn(&(), &()) {} - | ------------------------------------ required by `f1` + | -- ------------ required by this bound in `f1` error[E0631]: type mismatch in closure arguments --> $DIR/anonymous-higher-ranked-lifetime.rs:2:5 @@ -18,7 +18,7 @@ LL | f1(|_: (), _: ()| {}); | expected signature of `fn(&(), &()) -> _` ... LL | fn f1(_: F) where F: Fn(&(), &()) {} - | ------------------------------------ required by `f1` + | -- ---------- required by this bound in `f1` error[E0631]: type mismatch in closure arguments --> $DIR/anonymous-higher-ranked-lifetime.rs:4:5 @@ -29,7 +29,7 @@ LL | f2(|_: (), _: ()| {}); | expected signature of `for<'a, 'r> fn(&'a (), &'r ()) -> _` ... LL | fn f2(_: F) where F: for<'a> Fn(&'a (), &()) {} - | ----------------------------------------------- required by `f2` + | -- ----------------------- required by this bound in `f2` error[E0631]: type mismatch in closure arguments --> $DIR/anonymous-higher-ranked-lifetime.rs:4:5 @@ -40,7 +40,7 @@ LL | f2(|_: (), _: ()| {}); | expected signature of `fn(&'a (), &()) -> _` ... LL | fn f2(_: F) where F: for<'a> Fn(&'a (), &()) {} - | ----------------------------------------------- required by `f2` + | -- ------------- required by this bound in `f2` error[E0631]: type mismatch in closure arguments --> $DIR/anonymous-higher-ranked-lifetime.rs:6:5 @@ -51,7 +51,7 @@ LL | f3(|_: (), _: ()| {}); | expected signature of `for<'r> fn(&(), &'r ()) -> _` ... LL | fn f3<'a, F>(_: F) where F: Fn(&'a (), &()) {} - | ------------------------------------------- required by `f3` + | -- --------------- required by this bound in `f3` error[E0631]: type mismatch in closure arguments --> $DIR/anonymous-higher-ranked-lifetime.rs:6:5 @@ -62,7 +62,7 @@ LL | f3(|_: (), _: ()| {}); | expected signature of `fn(&(), &()) -> _` ... LL | fn f3<'a, F>(_: F) where F: Fn(&'a (), &()) {} - | ------------------------------------------- required by `f3` + | -- ------------- required by this bound in `f3` error[E0631]: type mismatch in closure arguments --> $DIR/anonymous-higher-ranked-lifetime.rs:8:5 @@ -73,7 +73,7 @@ LL | f4(|_: (), _: ()| {}); | expected signature of `for<'s, 'r> fn(&'s (), &'r ()) -> _` ... LL | fn f4(_: F) where F: for<'r> Fn(&(), &'r ()) {} - | ----------------------------------------------- required by `f4` + | -- ----------------------- required by this bound in `f4` error[E0631]: type mismatch in closure arguments --> $DIR/anonymous-higher-ranked-lifetime.rs:8:5 @@ -84,7 +84,7 @@ LL | f4(|_: (), _: ()| {}); | expected signature of `fn(&(), &'r ()) -> _` ... LL | fn f4(_: F) where F: for<'r> Fn(&(), &'r ()) {} - | ----------------------------------------------- required by `f4` + | -- ------------- required by this bound in `f4` error[E0631]: type mismatch in closure arguments --> $DIR/anonymous-higher-ranked-lifetime.rs:10:5 @@ -95,7 +95,7 @@ LL | f5(|_: (), _: ()| {}); | expected signature of `for<'r> fn(&'r (), &'r ()) -> _` ... LL | fn f5(_: F) where F: for<'r> Fn(&'r (), &'r ()) {} - | -------------------------------------------------- required by `f5` + | -- -------------------------- required by this bound in `f5` error[E0631]: type mismatch in closure arguments --> $DIR/anonymous-higher-ranked-lifetime.rs:10:5 @@ -106,7 +106,7 @@ LL | f5(|_: (), _: ()| {}); | expected signature of `fn(&'r (), &'r ()) -> _` ... LL | fn f5(_: F) where F: for<'r> Fn(&'r (), &'r ()) {} - | -------------------------------------------------- required by `f5` + | -- ---------------- required by this bound in `f5` error[E0631]: type mismatch in closure arguments --> $DIR/anonymous-higher-ranked-lifetime.rs:12:5 @@ -117,7 +117,7 @@ LL | g1(|_: (), _: ()| {}); | expected signature of `for<'r> fn(&'r (), std::boxed::Box<(dyn for<'s> std::ops::Fn(&'s ()) + 'static)>) -> _` ... LL | fn g1(_: F) where F: Fn(&(), Box) {} - | ------------------------------------------------- required by `g1` + | -- ------------------------- required by this bound in `g1` error[E0631]: type mismatch in closure arguments --> $DIR/anonymous-higher-ranked-lifetime.rs:12:5 @@ -128,7 +128,7 @@ LL | g1(|_: (), _: ()| {}); | expected signature of `fn(&(), std::boxed::Box<(dyn for<'r> std::ops::Fn(&'r ()) + 'static)>) -> _` ... LL | fn g1(_: F) where F: Fn(&(), Box) {} - | ------------------------------------------------- required by `g1` + | -- ----------------------- required by this bound in `g1` error[E0631]: type mismatch in closure arguments --> $DIR/anonymous-higher-ranked-lifetime.rs:14:5 @@ -139,7 +139,7 @@ LL | g2(|_: (), _: ()| {}); | expected signature of `for<'r> fn(&'r (), for<'s> fn(&'s ())) -> _` ... LL | fn g2(_: F) where F: Fn(&(), fn(&())) {} - | ---------------------------------------- required by `g2` + | -- ---------------- required by this bound in `g2` error[E0631]: type mismatch in closure arguments --> $DIR/anonymous-higher-ranked-lifetime.rs:14:5 @@ -150,7 +150,7 @@ LL | g2(|_: (), _: ()| {}); | expected signature of `fn(&(), for<'r> fn(&'r ())) -> _` ... LL | fn g2(_: F) where F: Fn(&(), fn(&())) {} - | ---------------------------------------- required by `g2` + | -- -------------- required by this bound in `g2` error[E0631]: type mismatch in closure arguments --> $DIR/anonymous-higher-ranked-lifetime.rs:16:5 @@ -161,7 +161,7 @@ LL | g3(|_: (), _: ()| {}); | expected signature of `for<'s> fn(&'s (), std::boxed::Box<(dyn for<'r> std::ops::Fn(&'r ()) + 'static)>) -> _` ... LL | fn g3(_: F) where F: for<'s> Fn(&'s (), Box) {} - | ------------------------------------------------------------ required by `g3` + | -- ------------------------------------ required by this bound in `g3` error[E0631]: type mismatch in closure arguments --> $DIR/anonymous-higher-ranked-lifetime.rs:16:5 @@ -172,7 +172,7 @@ LL | g3(|_: (), _: ()| {}); | expected signature of `fn(&'s (), std::boxed::Box<(dyn for<'r> std::ops::Fn(&'r ()) + 'static)>) -> _` ... LL | fn g3(_: F) where F: for<'s> Fn(&'s (), Box) {} - | ------------------------------------------------------------ required by `g3` + | -- -------------------------- required by this bound in `g3` error[E0631]: type mismatch in closure arguments --> $DIR/anonymous-higher-ranked-lifetime.rs:18:5 @@ -183,7 +183,7 @@ LL | g4(|_: (), _: ()| {}); | expected signature of `for<'s> fn(&'s (), for<'r> fn(&'r ())) -> _` ... LL | fn g4(_: F) where F: Fn(&(), for<'r> fn(&'r ())) {} - | --------------------------------------------------- required by `g4` + | -- --------------------------- required by this bound in `g4` error[E0631]: type mismatch in closure arguments --> $DIR/anonymous-higher-ranked-lifetime.rs:18:5 @@ -194,7 +194,7 @@ LL | g4(|_: (), _: ()| {}); | expected signature of `fn(&(), for<'r> fn(&'r ())) -> _` ... LL | fn g4(_: F) where F: Fn(&(), for<'r> fn(&'r ())) {} - | --------------------------------------------------- required by `g4` + | -- ------------------------- required by this bound in `g4` error[E0631]: type mismatch in closure arguments --> $DIR/anonymous-higher-ranked-lifetime.rs:20:5 @@ -205,7 +205,7 @@ LL | h1(|_: (), _: (), _: (), _: ()| {}); | expected signature of `for<'r, 's> fn(&'r (), std::boxed::Box<(dyn for<'t0> std::ops::Fn(&'t0 ()) + 'static)>, &'s (), for<'t0, 't1> fn(&'t0 (), &'t1 ())) -> _` ... LL | fn h1(_: F) where F: Fn(&(), Box, &(), fn(&(), &())) {} - | -------------------------------------------------------------------- required by `h1` + | -- -------------------------------------------- required by this bound in `h1` error[E0631]: type mismatch in closure arguments --> $DIR/anonymous-higher-ranked-lifetime.rs:20:5 @@ -216,7 +216,7 @@ LL | h1(|_: (), _: (), _: (), _: ()| {}); | expected signature of `fn(&(), std::boxed::Box<(dyn for<'r> std::ops::Fn(&'r ()) + 'static)>, &(), for<'r, 's> fn(&'r (), &'s ())) -> _` ... LL | fn h1(_: F) where F: Fn(&(), Box, &(), fn(&(), &())) {} - | -------------------------------------------------------------------- required by `h1` + | -- ------------------------------------------ required by this bound in `h1` error[E0631]: type mismatch in closure arguments --> $DIR/anonymous-higher-ranked-lifetime.rs:22:5 @@ -227,7 +227,7 @@ LL | h2(|_: (), _: (), _: (), _: ()| {}); | expected signature of `for<'r, 't0> fn(&'r (), std::boxed::Box<(dyn for<'s> std::ops::Fn(&'s ()) + 'static)>, &'t0 (), for<'s, 't1> fn(&'s (), &'t1 ())) -> _` ... LL | fn h2(_: F) where F: for<'t0> Fn(&(), Box, &'t0 (), fn(&(), &())) {} - | --------------------------------------------------------------------------------- required by `h2` + | -- --------------------------------------------------------- required by this bound in `h2` error[E0631]: type mismatch in closure arguments --> $DIR/anonymous-higher-ranked-lifetime.rs:22:5 @@ -238,7 +238,7 @@ LL | h2(|_: (), _: (), _: (), _: ()| {}); | expected signature of `fn(&(), std::boxed::Box<(dyn for<'r> std::ops::Fn(&'r ()) + 'static)>, &'t0 (), for<'r, 's> fn(&'r (), &'s ())) -> _` ... LL | fn h2(_: F) where F: for<'t0> Fn(&(), Box, &'t0 (), fn(&(), &())) {} - | --------------------------------------------------------------------------------- required by `h2` + | -- ---------------------------------------------- required by this bound in `h2` error: aborting due to 22 previous errors diff --git a/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr b/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr index a3049892abc..6a2135ca464 100644 --- a/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr +++ b/src/test/ui/associated-types/associated-types-binding-to-type-defined-in-supertrait.stderr @@ -2,7 +2,7 @@ error[E0271]: type mismatch resolving `::Color == Blue` --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:31:10 | LL | fn blue_car>(c: C) { - | ------------------------------------ required by `blue_car` + | -------- ---------- required by this bound in `blue_car` ... LL | fn b() { blue_car(ModelT); } | ^^^^^^^^ expected struct `Black`, found struct `Blue` @@ -14,7 +14,7 @@ error[E0271]: type mismatch resolving `::Color == Black` --> $DIR/associated-types-binding-to-type-defined-in-supertrait.rs:32:10 | LL | fn black_car>(c: C) { - | -------------------------------------- required by `black_car` + | --------- ----------- required by this bound in `black_car` ... LL | fn c() { black_car(ModelU); } | ^^^^^^^^^ expected struct `Blue`, found struct `Black` diff --git a/src/test/ui/associated-types/associated-types-eq-3.stderr b/src/test/ui/associated-types/associated-types-eq-3.stderr index c9d88b7af07..83d89924944 100644 --- a/src/test/ui/associated-types/associated-types-eq-3.stderr +++ b/src/test/ui/associated-types/associated-types-eq-3.stderr @@ -13,7 +13,7 @@ error[E0271]: type mismatch resolving `::A == Bar` --> $DIR/associated-types-eq-3.rs:38:5 | LL | fn foo1>(x: I) { - | ---------------------------- required by `foo1` + | ---- ----- required by this bound in `foo1` ... LL | foo1(a); | ^^^^ expected usize, found struct `Bar` diff --git a/src/test/ui/associated-types/associated-types-eq-hr.stderr b/src/test/ui/associated-types/associated-types-eq-hr.stderr index 05e6ed69812..f560aefd637 100644 --- a/src/test/ui/associated-types/associated-types-eq-hr.stderr +++ b/src/test/ui/associated-types/associated-types-eq-hr.stderr @@ -1,15 +1,13 @@ error[E0271]: type mismatch resolving `for<'x> >::A == &'x isize` --> $DIR/associated-types-eq-hr.rs:82:5 | -LL | / fn foo() -LL | | where T : for<'x> TheTrait<&'x isize, A = &'x isize> -LL | | { -LL | | // ok for IntStruct, but not UintStruct -LL | | } - | |_- required by `foo` +LL | fn foo() + | --- +LL | where T : for<'x> TheTrait<&'x isize, A = &'x isize> + | ------------- required by this bound in `foo` ... -LL | foo::(); - | ^^^^^^^^^^^^^^^^^ expected usize, found isize +LL | foo::(); + | ^^^^^^^^^^^^^^^^^ expected usize, found isize | = note: expected type `&usize` found type `&isize` @@ -17,15 +15,13 @@ LL | foo::(); error[E0271]: type mismatch resolving `for<'x> >::A == &'x usize` --> $DIR/associated-types-eq-hr.rs:86:5 | -LL | / fn bar() -LL | | where T : for<'x> TheTrait<&'x isize, A = &'x usize> -LL | | { -LL | | // ok for UintStruct, but not IntStruct -LL | | } - | |_- required by `bar` +LL | fn bar() + | --- +LL | where T : for<'x> TheTrait<&'x isize, A = &'x usize> + | ------------- required by this bound in `bar` ... -LL | bar::(); - | ^^^^^^^^^^^^^^^^ expected isize, found usize +LL | bar::(); + | ^^^^^^^^^^^^^^^^ expected isize, found usize | = note: expected type `&isize` found type `&usize` @@ -33,15 +29,13 @@ LL | bar::(); error[E0277]: the trait bound `for<'x, 'y> Tuple: TheTrait<(&'x isize, &'y isize)>` is not satisfied --> $DIR/associated-types-eq-hr.rs:91:5 | -LL | / fn tuple_one() -LL | | where T : for<'x,'y> TheTrait<(&'x isize, &'y isize), A = &'x isize> -LL | | { -LL | | // not ok for tuple, two lifetimes and we pick first -LL | | } - | |_- required by `tuple_one` +LL | fn tuple_one() + | --------- +LL | where T : for<'x,'y> TheTrait<(&'x isize, &'y isize), A = &'x isize> + | ---------------------------------------------------------- required by this bound in `tuple_one` ... -LL | tuple_one::(); - | ^^^^^^^^^^^^^^^^^^ the trait `for<'x, 'y> TheTrait<(&'x isize, &'y isize)>` is not implemented for `Tuple` +LL | tuple_one::(); + | ^^^^^^^^^^^^^^^^^^ the trait `for<'x, 'y> TheTrait<(&'x isize, &'y isize)>` is not implemented for `Tuple` | = help: the following implementations were found: > @@ -49,28 +43,24 @@ LL | tuple_one::(); error[E0271]: type mismatch resolving `for<'x, 'y> >::A == &'x isize` --> $DIR/associated-types-eq-hr.rs:91:5 | -LL | / fn tuple_one() -LL | | where T : for<'x,'y> TheTrait<(&'x isize, &'y isize), A = &'x isize> -LL | | { -LL | | // not ok for tuple, two lifetimes and we pick first -LL | | } - | |_- required by `tuple_one` +LL | fn tuple_one() + | --------- +LL | where T : for<'x,'y> TheTrait<(&'x isize, &'y isize), A = &'x isize> + | ------------- required by this bound in `tuple_one` ... -LL | tuple_one::(); - | ^^^^^^^^^^^^^^^^^^ expected bound lifetime parameter 'x, found concrete lifetime +LL | tuple_one::(); + | ^^^^^^^^^^^^^^^^^^ expected bound lifetime parameter 'x, found concrete lifetime error[E0277]: the trait bound `for<'x, 'y> Tuple: TheTrait<(&'x isize, &'y isize)>` is not satisfied --> $DIR/associated-types-eq-hr.rs:97:5 | -LL | / fn tuple_two() -LL | | where T : for<'x,'y> TheTrait<(&'x isize, &'y isize), A = &'y isize> -LL | | { -LL | | // not ok for tuple, two lifetimes and we pick second -LL | | } - | |_- required by `tuple_two` +LL | fn tuple_two() + | --------- +LL | where T : for<'x,'y> TheTrait<(&'x isize, &'y isize), A = &'y isize> + | ---------------------------------------------------------- required by this bound in `tuple_two` ... -LL | tuple_two::(); - | ^^^^^^^^^^^^^^^^^^ the trait `for<'x, 'y> TheTrait<(&'x isize, &'y isize)>` is not implemented for `Tuple` +LL | tuple_two::(); + | ^^^^^^^^^^^^^^^^^^ the trait `for<'x, 'y> TheTrait<(&'x isize, &'y isize)>` is not implemented for `Tuple` | = help: the following implementations were found: > @@ -78,28 +68,24 @@ LL | tuple_two::(); error[E0271]: type mismatch resolving `for<'x, 'y> >::A == &'y isize` --> $DIR/associated-types-eq-hr.rs:97:5 | -LL | / fn tuple_two() -LL | | where T : for<'x,'y> TheTrait<(&'x isize, &'y isize), A = &'y isize> -LL | | { -LL | | // not ok for tuple, two lifetimes and we pick second -LL | | } - | |_- required by `tuple_two` +LL | fn tuple_two() + | --------- +LL | where T : for<'x,'y> TheTrait<(&'x isize, &'y isize), A = &'y isize> + | ------------- required by this bound in `tuple_two` ... -LL | tuple_two::(); - | ^^^^^^^^^^^^^^^^^^ expected bound lifetime parameter 'x, found concrete lifetime +LL | tuple_two::(); + | ^^^^^^^^^^^^^^^^^^ expected bound lifetime parameter 'x, found concrete lifetime error[E0277]: the trait bound `for<'x, 'y> Tuple: TheTrait<(&'x isize, &'y isize)>` is not satisfied --> $DIR/associated-types-eq-hr.rs:107:5 | -LL | / fn tuple_four() -LL | | where T : for<'x,'y> TheTrait<(&'x isize, &'y isize)> -LL | | { -LL | | // not ok for tuple, two lifetimes, and lifetime matching is invariant -LL | | } - | |_- required by `tuple_four` +LL | fn tuple_four() + | ---------- +LL | where T : for<'x,'y> TheTrait<(&'x isize, &'y isize)> + | ------------------------------------------- required by this bound in `tuple_four` ... -LL | tuple_four::(); - | ^^^^^^^^^^^^^^^^^^^ the trait `for<'x, 'y> TheTrait<(&'x isize, &'y isize)>` is not implemented for `Tuple` +LL | tuple_four::(); + | ^^^^^^^^^^^^^^^^^^^ the trait `for<'x, 'y> TheTrait<(&'x isize, &'y isize)>` is not implemented for `Tuple` | = help: the following implementations were found: > diff --git a/src/test/ui/associated-types/associated-types-issue-20346.stderr b/src/test/ui/associated-types/associated-types-issue-20346.stderr index e037bd851ca..c8f8725afc4 100644 --- a/src/test/ui/associated-types/associated-types-issue-20346.stderr +++ b/src/test/ui/associated-types/associated-types-issue-20346.stderr @@ -2,7 +2,7 @@ error[E0271]: type mismatch resolving ` as Iterator>::Item == std::op --> $DIR/associated-types-issue-20346.rs:34:5 | LL | fn is_iterator_of>(_: &I) {} - | ------------------------------------------------ required by `is_iterator_of` + | -------------- ------ required by this bound in `is_iterator_of` ... LL | is_iterator_of::, _>(&adapter); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected type parameter, found enum `std::option::Option` diff --git a/src/test/ui/associated-types/associated-types-multiple-types-one-trait.stderr b/src/test/ui/associated-types/associated-types-multiple-types-one-trait.stderr index d6328a64c7c..c7de186c1d3 100644 --- a/src/test/ui/associated-types/associated-types-multiple-types-one-trait.stderr +++ b/src/test/ui/associated-types/associated-types-multiple-types-one-trait.stderr @@ -5,7 +5,7 @@ LL | want_y(t); | ^^^^^^ expected associated type, found i32 ... LL | fn want_y>(t: &T) { } - | ------------------------------ required by `want_y` + | ------ ----- required by this bound in `want_y` | = note: expected type `::Y` found type `i32` @@ -19,7 +19,7 @@ LL | want_x(t); | ^^^^^^ expected associated type, found u32 ... LL | fn want_x>(t: &T) { } - | ------------------------------ required by `want_x` + | ------ ----- required by this bound in `want_x` | = note: expected type `::X` found type `u32` diff --git a/src/test/ui/associated-types/associated-types-path-2.stderr b/src/test/ui/associated-types/associated-types-path-2.stderr index a8fcaeac95d..bb2e7251849 100644 --- a/src/test/ui/associated-types/associated-types-path-2.stderr +++ b/src/test/ui/associated-types/associated-types-path-2.stderr @@ -12,7 +12,7 @@ error[E0277]: the trait bound `u32: Foo` is not satisfied --> $DIR/associated-types-path-2.rs:29:5 | LL | pub fn f1(a: T, x: T::A) {} - | -------------------------------- required by `f1` + | -- --- required by this bound in `f1` ... LL | f1(2u32, 4u32); | ^^ the trait `Foo` is not implemented for `u32` @@ -27,7 +27,7 @@ error[E0277]: the trait bound `u32: Foo` is not satisfied --> $DIR/associated-types-path-2.rs:35:5 | LL | pub fn f1(a: T, x: T::A) {} - | -------------------------------- required by `f1` + | -- --- required by this bound in `f1` ... LL | f1(2u32, 4i32); | ^^ the trait `Foo` is not implemented for `u32` diff --git a/src/test/ui/associated-types/higher-ranked-projection.bad.stderr b/src/test/ui/associated-types/higher-ranked-projection.bad.stderr index 22d44888e95..74c9ad2c39e 100644 --- a/src/test/ui/associated-types/higher-ranked-projection.bad.stderr +++ b/src/test/ui/associated-types/higher-ranked-projection.bad.stderr @@ -1,13 +1,13 @@ error[E0271]: type mismatch resolving `for<'a> <&'a _ as Mirror>::Image == _` --> $DIR/higher-ranked-projection.rs:25:5 | -LL | / fn foo(_t: T) -LL | | where for<'a> &'a T: Mirror -LL | | {} - | |__- required by `foo` +LL | fn foo(_t: T) + | --- +LL | where for<'a> &'a T: Mirror + | ------- required by this bound in `foo` ... -LL | foo(()); - | ^^^ expected bound lifetime parameter 'a, found concrete lifetime +LL | foo(()); + | ^^^ expected bound lifetime parameter 'a, found concrete lifetime error: aborting due to previous error diff --git a/src/test/ui/async-await/async-fn-nonsend.stderr b/src/test/ui/async-await/async-fn-nonsend.stderr index d2f92f04f40..001e0b1cad3 100644 --- a/src/test/ui/async-await/async-fn-nonsend.stderr +++ b/src/test/ui/async-await/async-fn-nonsend.stderr @@ -2,7 +2,7 @@ error[E0277]: `std::rc::Rc<()>` cannot be sent between threads safely --> $DIR/async-fn-nonsend.rs:50:5 | LL | fn assert_send(_: impl Send) {} - | ---------------------------- required by `assert_send` + | ----------- ---- required by this bound in `assert_send` ... LL | assert_send(local_dropped_before_await()); | ^^^^^^^^^^^ `std::rc::Rc<()>` cannot be sent between threads safely @@ -19,7 +19,7 @@ error[E0277]: `std::rc::Rc<()>` cannot be sent between threads safely --> $DIR/async-fn-nonsend.rs:52:5 | LL | fn assert_send(_: impl Send) {} - | ---------------------------- required by `assert_send` + | ----------- ---- required by this bound in `assert_send` ... LL | assert_send(non_send_temporary_in_match()); | ^^^^^^^^^^^ `std::rc::Rc<()>` cannot be sent between threads safely @@ -36,7 +36,7 @@ error[E0277]: `dyn std::fmt::Write` cannot be sent between threads safely --> $DIR/async-fn-nonsend.rs:54:5 | LL | fn assert_send(_: impl Send) {} - | ---------------------------- required by `assert_send` + | ----------- ---- required by this bound in `assert_send` ... LL | assert_send(non_sync_with_method_call()); | ^^^^^^^^^^^ `dyn std::fmt::Write` cannot be sent between threads safely @@ -55,7 +55,7 @@ error[E0277]: `*mut (dyn std::ops::Fn() + 'static)` cannot be shared between thr --> $DIR/async-fn-nonsend.rs:54:5 | LL | fn assert_send(_: impl Send) {} - | ---------------------------- required by `assert_send` + | ----------- ---- required by this bound in `assert_send` ... LL | assert_send(non_sync_with_method_call()); | ^^^^^^^^^^^ `*mut (dyn std::ops::Fn() + 'static)` cannot be shared between threads safely diff --git a/src/test/ui/async-await/issues/issue-62009-1.stderr b/src/test/ui/async-await/issues/issue-62009-1.stderr index cd155f0fc32..3d8028635f5 100644 --- a/src/test/ui/async-await/issues/issue-62009-1.stderr +++ b/src/test/ui/async-await/issues/issue-62009-1.stderr @@ -32,8 +32,11 @@ error[E0277]: the trait bound `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]: std: | LL | (|_| 2333).await; | ^^^^^^^^^^^^^^^^ the trait `std::future::Future` is not implemented for `[closure@$DIR/issue-62009-1.rs:12:5: 12:15]` + | + ::: $SRC_DIR/libstd/future.rs:LL:COL | - = note: required by `std::future::poll_with_tls_context` +LL | F: Future + | ------ required by this bound in `std::future::poll_with_tls_context` error: aborting due to 4 previous errors diff --git a/src/test/ui/chalkify/type_inference.stderr b/src/test/ui/chalkify/type_inference.stderr index 15c52f461c1..c6bc306e45a 100644 --- a/src/test/ui/chalkify/type_inference.stderr +++ b/src/test/ui/chalkify/type_inference.stderr @@ -11,7 +11,7 @@ error[E0277]: the trait bound `{float}: Bar` is not satisfied --> $DIR/type_inference.rs:25:5 | LL | fn only_bar(_x: T) { } - | -------------------------- required by `only_bar` + | -------- --- required by this bound in `only_bar` ... LL | only_bar(x); | ^^^^^^^^ the trait `Bar` is not implemented for `{float}` diff --git a/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr b/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr index c618c2c550b..6fadea31f7e 100644 --- a/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr +++ b/src/test/ui/closure-expected-type/expect-fn-supply-fn.stderr @@ -39,44 +39,41 @@ LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {}); error[E0631]: type mismatch in closure arguments --> $DIR/expect-fn-supply-fn.rs:30:5 | -LL | / fn with_closure_expecting_fn_with_free_region(_: F) -LL | | where F: for<'a> FnOnce(fn(&'a u32), &i32) -LL | | { -LL | | } - | |_- required by `with_closure_expecting_fn_with_free_region` +LL | fn with_closure_expecting_fn_with_free_region(_: F) + | ------------------------------------------ +LL | where F: for<'a> FnOnce(fn(&'a u32), &i32) + | ------------------- required by this bound in `with_closure_expecting_fn_with_free_region` ... -LL | with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {}); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ---------------- found signature of `fn(for<'r> fn(&'r u32), _) -> _` - | | - | expected signature of `fn(fn(&'a u32), &i32) -> _` +LL | with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {}); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ---------------- found signature of `fn(for<'r> fn(&'r u32), _) -> _` + | | + | expected signature of `fn(fn(&'a u32), &i32) -> _` error[E0631]: type mismatch in closure arguments --> $DIR/expect-fn-supply-fn.rs:37:5 | -LL | / fn with_closure_expecting_fn_with_bound_region(_: F) -LL | | where F: FnOnce(fn(&u32), &i32) -LL | | { -LL | | } - | |_- required by `with_closure_expecting_fn_with_bound_region` +LL | fn with_closure_expecting_fn_with_bound_region(_: F) + | ------------------------------------------- +LL | where F: FnOnce(fn(&u32), &i32) + | ---------------- required by this bound in `with_closure_expecting_fn_with_bound_region` ... -LL | with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {}); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ------------------- found signature of `fn(fn(&'x u32), _) -> _` - | | - | expected signature of `fn(for<'r> fn(&'r u32), &i32) -> _` +LL | with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {}); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ------------------- found signature of `fn(fn(&'x u32), _) -> _` + | | + | expected signature of `fn(for<'r> fn(&'r u32), &i32) -> _` error[E0631]: type mismatch in closure arguments --> $DIR/expect-fn-supply-fn.rs:46:5 | -LL | / fn with_closure_expecting_fn_with_bound_region(_: F) -LL | | where F: FnOnce(fn(&u32), &i32) -LL | | { -LL | | } - | |_- required by `with_closure_expecting_fn_with_bound_region` +LL | fn with_closure_expecting_fn_with_bound_region(_: F) + | ------------------------------------------- +LL | where F: FnOnce(fn(&u32), &i32) + | ---------------- required by this bound in `with_closure_expecting_fn_with_bound_region` ... -LL | with_closure_expecting_fn_with_bound_region(|x: Foo<'_>, y| { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --------------- found signature of `for<'r> fn(fn(&'r u32), _) -> _` - | | - | expected signature of `fn(for<'r> fn(&'r u32), &i32) -> _` +LL | with_closure_expecting_fn_with_bound_region(|x: Foo<'_>, y| { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --------------- found signature of `for<'r> fn(fn(&'r u32), _) -> _` + | | + | expected signature of `fn(for<'r> fn(&'r u32), &i32) -> _` error: aborting due to 5 previous errors diff --git a/src/test/ui/closure-expected-type/expect-infer-var-appearing-twice.stderr b/src/test/ui/closure-expected-type/expect-infer-var-appearing-twice.stderr index a2b3a66dc4d..9fbe95a9c39 100644 --- a/src/test/ui/closure-expected-type/expect-infer-var-appearing-twice.stderr +++ b/src/test/ui/closure-expected-type/expect-infer-var-appearing-twice.stderr @@ -1,16 +1,15 @@ error[E0631]: type mismatch in closure arguments --> $DIR/expect-infer-var-appearing-twice.rs:14:5 | -LL | / fn with_closure(_: F) -LL | | where F: FnOnce(A, A) -LL | | { -LL | | } - | |_- required by `with_closure` +LL | fn with_closure(_: F) + | ------------ +LL | where F: FnOnce(A, A) + | ------------ required by this bound in `with_closure` ... -LL | with_closure(|x: u32, y: i32| { - | ^^^^^^^^^^^^ ---------------- found signature of `fn(u32, i32) -> _` - | | - | expected signature of `fn(_, _) -> _` +LL | with_closure(|x: u32, y: i32| { + | ^^^^^^^^^^^^ ---------------- found signature of `fn(u32, i32) -> _` + | | + | expected signature of `fn(_, _) -> _` error: aborting due to previous error diff --git a/src/test/ui/closures/closure-bounds-subtype.stderr b/src/test/ui/closures/closure-bounds-subtype.stderr index e9b34e05ac2..4b703eded69 100644 --- a/src/test/ui/closures/closure-bounds-subtype.stderr +++ b/src/test/ui/closures/closure-bounds-subtype.stderr @@ -2,7 +2,7 @@ error[E0277]: `F` cannot be shared between threads safely --> $DIR/closure-bounds-subtype.rs:13:22 | LL | fn take_const_owned(_: F) where F: FnOnce() + Sync + Send { - | ------------------------------------------------------------ required by `take_const_owned` + | ---------------- ---- required by this bound in `take_const_owned` ... LL | take_const_owned(f); | ^ `F` cannot be shared between threads safely diff --git a/src/test/ui/closures/closure-move-sync.stderr b/src/test/ui/closures/closure-move-sync.stderr index 8afebc7c748..aaa5f76233f 100644 --- a/src/test/ui/closures/closure-move-sync.stderr +++ b/src/test/ui/closures/closure-move-sync.stderr @@ -3,22 +3,30 @@ error[E0277]: `std::sync::mpsc::Receiver<()>` cannot be shared between threads s | LL | let t = thread::spawn(|| { | ^^^^^^^^^^^^^ `std::sync::mpsc::Receiver<()>` cannot be shared between threads safely + | + ::: $SRC_DIR/libstd/thread/mod.rs:LL:COL + | +LL | F: FnOnce() -> T, F: Send + 'static, T: Send + 'static + | ---- required by this bound in `std::thread::spawn` | = help: the trait `std::marker::Sync` is not implemented for `std::sync::mpsc::Receiver<()>` = note: required because of the requirements on the impl of `std::marker::Send` for `&std::sync::mpsc::Receiver<()>` = note: required because it appears within the type `[closure@$DIR/closure-move-sync.rs:6:27: 9:6 recv:&std::sync::mpsc::Receiver<()>]` - = note: required by `std::thread::spawn` error[E0277]: `std::sync::mpsc::Sender<()>` cannot be shared between threads safely --> $DIR/closure-move-sync.rs:18:5 | LL | thread::spawn(|| tx.send(()).unwrap()); | ^^^^^^^^^^^^^ `std::sync::mpsc::Sender<()>` cannot be shared between threads safely + | + ::: $SRC_DIR/libstd/thread/mod.rs:LL:COL + | +LL | F: FnOnce() -> T, F: Send + 'static, T: Send + 'static + | ---- required by this bound in `std::thread::spawn` | = help: the trait `std::marker::Sync` is not implemented for `std::sync::mpsc::Sender<()>` = note: required because of the requirements on the impl of `std::marker::Send` for `&std::sync::mpsc::Sender<()>` = note: required because it appears within the type `[closure@$DIR/closure-move-sync.rs:18:19: 18:42 tx:&std::sync::mpsc::Sender<()>]` - = note: required by `std::thread::spawn` error: aborting due to 2 previous errors diff --git a/src/test/ui/defaulted-never-note.rs b/src/test/ui/defaulted-never-note.rs index cf1922ecc78..d3fb8a09414 100644 --- a/src/test/ui/defaulted-never-note.rs +++ b/src/test/ui/defaulted-never-note.rs @@ -19,7 +19,8 @@ trait ImplementedForUnitButNotNever {} impl ImplementedForUnitButNotNever for () {} fn foo(_t: T) {} -//~^ NOTE required by `foo` +//~^ NOTE required by this bound in `foo` +//~| NOTE fn smeg() { let _x = return; diff --git a/src/test/ui/defaulted-never-note.stderr b/src/test/ui/defaulted-never-note.stderr index 277477a0b0a..28c9da059ed 100644 --- a/src/test/ui/defaulted-never-note.stderr +++ b/src/test/ui/defaulted-never-note.stderr @@ -1,8 +1,8 @@ error[E0277]: the trait bound `!: ImplementedForUnitButNotNever` is not satisfied - --> $DIR/defaulted-never-note.rs:26:5 + --> $DIR/defaulted-never-note.rs:27:5 | LL | fn foo(_t: T) {} - | ----------------------------------------------- required by `foo` + | --- ----------------------------- required by this bound in `foo` ... LL | foo(_x); | ^^^ the trait `ImplementedForUnitButNotNever` is not implemented for `!` diff --git a/src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr b/src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr index 417c720c63e..4752ef3713d 100644 --- a/src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr +++ b/src/test/ui/derives/derives-span-Hash-enum-struct-variant.stderr @@ -3,8 +3,11 @@ error[E0277]: the trait bound `Error: std::hash::Hash` is not satisfied | LL | x: Error | ^^^^^^^^ the trait `std::hash::Hash` is not implemented for `Error` + | + ::: $SRC_DIR/libcore/hash/mod.rs:LL:COL | - = note: required by `std::hash::Hash::hash` +LL | fn hash(&self, state: &mut H); + | - required by this bound in `std::hash::Hash::hash` error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-Hash-enum.stderr b/src/test/ui/derives/derives-span-Hash-enum.stderr index 25be8794889..efaa679c410 100644 --- a/src/test/ui/derives/derives-span-Hash-enum.stderr +++ b/src/test/ui/derives/derives-span-Hash-enum.stderr @@ -3,8 +3,11 @@ error[E0277]: the trait bound `Error: std::hash::Hash` is not satisfied | LL | Error | ^^^^^ the trait `std::hash::Hash` is not implemented for `Error` + | + ::: $SRC_DIR/libcore/hash/mod.rs:LL:COL | - = note: required by `std::hash::Hash::hash` +LL | fn hash(&self, state: &mut H); + | - required by this bound in `std::hash::Hash::hash` error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-Hash-struct.stderr b/src/test/ui/derives/derives-span-Hash-struct.stderr index c0574453a7a..a92103032ee 100644 --- a/src/test/ui/derives/derives-span-Hash-struct.stderr +++ b/src/test/ui/derives/derives-span-Hash-struct.stderr @@ -3,8 +3,11 @@ error[E0277]: the trait bound `Error: std::hash::Hash` is not satisfied | LL | x: Error | ^^^^^^^^ the trait `std::hash::Hash` is not implemented for `Error` + | + ::: $SRC_DIR/libcore/hash/mod.rs:LL:COL | - = note: required by `std::hash::Hash::hash` +LL | fn hash(&self, state: &mut H); + | - required by this bound in `std::hash::Hash::hash` error: aborting due to previous error diff --git a/src/test/ui/derives/derives-span-Hash-tuple-struct.stderr b/src/test/ui/derives/derives-span-Hash-tuple-struct.stderr index 6339c38578e..4af96ada66c 100644 --- a/src/test/ui/derives/derives-span-Hash-tuple-struct.stderr +++ b/src/test/ui/derives/derives-span-Hash-tuple-struct.stderr @@ -3,8 +3,11 @@ error[E0277]: the trait bound `Error: std::hash::Hash` is not satisfied | LL | Error | ^^^^^ the trait `std::hash::Hash` is not implemented for `Error` + | + ::: $SRC_DIR/libcore/hash/mod.rs:LL:COL | - = note: required by `std::hash::Hash::hash` +LL | fn hash(&self, state: &mut H); + | - required by this bound in `std::hash::Hash::hash` error: aborting due to previous error diff --git a/src/test/ui/derives/deriving-copyclone.stderr b/src/test/ui/derives/deriving-copyclone.stderr index f142257604c..4cca14ae089 100644 --- a/src/test/ui/derives/deriving-copyclone.stderr +++ b/src/test/ui/derives/deriving-copyclone.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `C: std::marker::Copy` is not satisfied --> $DIR/deriving-copyclone.rs:31:13 | LL | fn is_copy(_: T) {} - | ------------------------- required by `is_copy` + | ------- ---- required by this bound in `is_copy` ... LL | is_copy(B { a: 1, b: C }); | ^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `C` @@ -13,7 +13,7 @@ error[E0277]: the trait bound `C: std::clone::Clone` is not satisfied --> $DIR/deriving-copyclone.rs:32:14 | LL | fn is_clone(_: T) {} - | --------------------------- required by `is_clone` + | -------- ----- required by this bound in `is_clone` ... LL | is_clone(B { a: 1, b: C }); | ^^^^^^^^^^^^^^^^ the trait `std::clone::Clone` is not implemented for `C` @@ -24,7 +24,7 @@ error[E0277]: the trait bound `D: std::marker::Copy` is not satisfied --> $DIR/deriving-copyclone.rs:35:13 | LL | fn is_copy(_: T) {} - | ------------------------- required by `is_copy` + | ------- ---- required by this bound in `is_copy` ... LL | is_copy(B { a: 1, b: D }); | ^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `D` diff --git a/src/test/ui/did_you_mean/recursion_limit.stderr b/src/test/ui/did_you_mean/recursion_limit.stderr index 745d90a5d4c..b05b92bf1e9 100644 --- a/src/test/ui/did_you_mean/recursion_limit.stderr +++ b/src/test/ui/did_you_mean/recursion_limit.stderr @@ -2,7 +2,7 @@ error[E0275]: overflow evaluating the requirement `J: std::marker::Send` --> $DIR/recursion_limit.rs:34:5 | LL | fn is_send() { } - | -------------------- required by `is_send` + | ------- ---- required by this bound in `is_send` ... LL | is_send::(); | ^^^^^^^^^^^^ diff --git a/src/test/ui/error-codes/E0271.stderr b/src/test/ui/error-codes/E0271.stderr index 0afcbcc79ee..c56853f45a0 100644 --- a/src/test/ui/error-codes/E0271.stderr +++ b/src/test/ui/error-codes/E0271.stderr @@ -2,7 +2,7 @@ error[E0271]: type mismatch resolving `::AssociatedType == u32` --> $DIR/E0271.rs:10:5 | LL | fn foo(t: T) where T: Trait { - | -------------------------------------------------- required by `foo` + | --- ------------------ required by this bound in `foo` ... LL | foo(3_i8); | ^^^ expected reference, found u32 diff --git a/src/test/ui/error-codes/E0277-2.stderr b/src/test/ui/error-codes/E0277-2.stderr index b42849cd842..407e51e4f5f 100644 --- a/src/test/ui/error-codes/E0277-2.stderr +++ b/src/test/ui/error-codes/E0277-2.stderr @@ -2,7 +2,7 @@ error[E0277]: `*const u8` cannot be sent between threads safely --> $DIR/E0277-2.rs:16:5 | LL | fn is_send() { } - | --------------------- required by `is_send` + | ------- ---- required by this bound in `is_send` ... LL | is_send::(); | ^^^^^^^^^^^^^^ `*const u8` cannot be sent between threads safely diff --git a/src/test/ui/error-codes/E0277.stderr b/src/test/ui/error-codes/E0277.stderr index 9cd0dc7a68e..a069d048c88 100644 --- a/src/test/ui/error-codes/E0277.stderr +++ b/src/test/ui/error-codes/E0277.stderr @@ -14,7 +14,7 @@ error[E0277]: the trait bound `i32: Foo` is not satisfied --> $DIR/E0277.rs:17:15 | LL | fn some_func(foo: T) { - | ---------------------------- required by `some_func` + | --------- --- required by this bound in `some_func` ... LL | some_func(5i32); | ^^^^ the trait `Foo` is not implemented for `i32` diff --git a/src/test/ui/error-should-say-copy-not-pod.stderr b/src/test/ui/error-should-say-copy-not-pod.stderr index df79aeea054..d0148f418e3 100644 --- a/src/test/ui/error-should-say-copy-not-pod.stderr +++ b/src/test/ui/error-should-say-copy-not-pod.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `std::string::String: std::marker::Copy` is not sa --> $DIR/error-should-say-copy-not-pod.rs:6:17 | LL | fn check_bound(_: T) {} - | ---------------------------- required by `check_bound` + | ----------- ---- required by this bound in `check_bound` ... LL | check_bound("nocopy".to_string()); | ^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::string::String` diff --git a/src/test/ui/extern/extern-types-not-sync-send.stderr b/src/test/ui/extern/extern-types-not-sync-send.stderr index 0f32d4489de..803bd9dbac6 100644 --- a/src/test/ui/extern/extern-types-not-sync-send.stderr +++ b/src/test/ui/extern/extern-types-not-sync-send.stderr @@ -2,7 +2,7 @@ error[E0277]: `A` cannot be shared between threads safely --> $DIR/extern-types-not-sync-send.rs:13:5 | LL | fn assert_sync() { } - | ---------------------------------- required by `assert_sync` + | ----------- ---- required by this bound in `assert_sync` ... LL | assert_sync::(); | ^^^^^^^^^^^^^^^^ `A` cannot be shared between threads safely @@ -13,7 +13,7 @@ error[E0277]: `A` cannot be sent between threads safely --> $DIR/extern-types-not-sync-send.rs:16:5 | LL | fn assert_send() { } - | ---------------------------------- required by `assert_send` + | ----------- ---- required by this bound in `assert_send` ... LL | assert_send::(); | ^^^^^^^^^^^^^^^^ `A` cannot be sent between threads safely diff --git a/src/test/ui/extern/extern-types-unsized.stderr b/src/test/ui/extern/extern-types-unsized.stderr index 06527d973e2..1f69a4e154e 100644 --- a/src/test/ui/extern/extern-types-unsized.stderr +++ b/src/test/ui/extern/extern-types-unsized.stderr @@ -2,7 +2,7 @@ error[E0277]: the size for values of type `A` cannot be known at compilation tim --> $DIR/extern-types-unsized.rs:22:5 | LL | fn assert_sized() { } - | -------------------- required by `assert_sized` + | ------------ - required by this bound in `assert_sized` ... LL | assert_sized::(); | ^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time @@ -14,7 +14,7 @@ error[E0277]: the size for values of type `A` cannot be known at compilation tim --> $DIR/extern-types-unsized.rs:25:5 | LL | fn assert_sized() { } - | -------------------- required by `assert_sized` + | ------------ - required by this bound in `assert_sized` ... LL | assert_sized::(); | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time @@ -27,7 +27,7 @@ error[E0277]: the size for values of type `A` cannot be known at compilation tim --> $DIR/extern-types-unsized.rs:28:5 | LL | fn assert_sized() { } - | -------------------- required by `assert_sized` + | ------------ - required by this bound in `assert_sized` ... LL | assert_sized::>(); | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time @@ -40,7 +40,7 @@ error[E0277]: the size for values of type `A` cannot be known at compilation tim --> $DIR/extern-types-unsized.rs:31:5 | LL | fn assert_sized() { } - | -------------------- required by `assert_sized` + | ------------ - required by this bound in `assert_sized` ... LL | assert_sized::>>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time diff --git a/src/test/ui/extern/extern-wrong-value-type.stderr b/src/test/ui/extern/extern-wrong-value-type.stderr index f2468895d21..9a6af8119a8 100644 --- a/src/test/ui/extern/extern-wrong-value-type.stderr +++ b/src/test/ui/extern/extern-wrong-value-type.stderr @@ -2,7 +2,7 @@ error[E0277]: expected a `std::ops::Fn<()>` closure, found `extern "C" fn() {f}` --> $DIR/extern-wrong-value-type.rs:9:11 | LL | fn is_fn(_: F) where F: Fn() {} - | ------------------------------- required by `is_fn` + | ----- ---- required by this bound in `is_fn` ... LL | is_fn(f); | ^ expected an `Fn<()>` closure, found `extern "C" fn() {f}` diff --git a/src/test/ui/fmt/send-sync.stderr b/src/test/ui/fmt/send-sync.stderr index 599dcfaa726..be6e41afaf8 100644 --- a/src/test/ui/fmt/send-sync.stderr +++ b/src/test/ui/fmt/send-sync.stderr @@ -2,7 +2,7 @@ error[E0277]: `*mut (dyn std::ops::Fn() + 'static)` cannot be shared between thr --> $DIR/send-sync.rs:8:5 | LL | fn send(_: T) {} - | ---------------------- required by `send` + | ---- ---- required by this bound in `send` ... LL | send(format_args!("{:?}", c)); | ^^^^ `*mut (dyn std::ops::Fn() + 'static)` cannot be shared between threads safely @@ -20,7 +20,7 @@ error[E0277]: `*mut (dyn std::ops::Fn() + 'static)` cannot be shared between thr --> $DIR/send-sync.rs:9:5 | LL | fn sync(_: T) {} - | ---------------------- required by `sync` + | ---- ---- required by this bound in `sync` ... LL | sync(format_args!("{:?}", c)); | ^^^^ `*mut (dyn std::ops::Fn() + 'static)` cannot be shared between threads safely diff --git a/src/test/ui/fn/fn-trait-formatting.stderr b/src/test/ui/fn/fn-trait-formatting.stderr index 4d610b49dff..f891b9c6439 100644 --- a/src/test/ui/fn/fn-trait-formatting.stderr +++ b/src/test/ui/fn/fn-trait-formatting.stderr @@ -29,7 +29,7 @@ error[E0277]: expected a `std::ops::Fn<(isize,)>` closure, found `{integer}` --> $DIR/fn-trait-formatting.rs:19:14 | LL | fn needs_fn(x: F) where F: Fn(isize) -> isize {} - | ------------------------------------------------ required by `needs_fn` + | -------- ------------------ required by this bound in `needs_fn` ... LL | needs_fn(1); | ^ expected an `Fn<(isize,)>` closure, found `{integer}` diff --git a/src/test/ui/generator-yielding-or-returning-itself.stderr b/src/test/ui/generator-yielding-or-returning-itself.stderr index 1049bb6240a..c9a71e03858 100644 --- a/src/test/ui/generator-yielding-or-returning-itself.stderr +++ b/src/test/ui/generator-yielding-or-returning-itself.stderr @@ -16,14 +16,13 @@ LL | | }) error[E0271]: type mismatch resolving `<[generator@$DIR/generator-yielding-or-returning-itself.rs:28:33: 32:6 _] as std::ops::Generator>::Yield == [generator@$DIR/generator-yielding-or-returning-itself.rs:28:33: 32:6 _]` --> $DIR/generator-yielding-or-returning-itself.rs:28:5 | -LL | / pub fn want_cyclic_generator_yield(_: T) -LL | | where T: Generator -LL | | { -LL | | } - | |_- required by `want_cyclic_generator_yield` +LL | pub fn want_cyclic_generator_yield(_: T) + | --------------------------- +LL | where T: Generator + | --------- required by this bound in `want_cyclic_generator_yield` ... -LL | want_cyclic_generator_yield(|| { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ cyclic type of infinite size +LL | want_cyclic_generator_yield(|| { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ cyclic type of infinite size | = note: closures cannot capture themselves or take themselves as argument; this error may be the result of a recent compiler bug-fix, diff --git a/src/test/ui/generator/not-send-sync.stderr b/src/test/ui/generator/not-send-sync.stderr index 51416ce0d2f..620db245d3e 100644 --- a/src/test/ui/generator/not-send-sync.stderr +++ b/src/test/ui/generator/not-send-sync.stderr @@ -2,7 +2,7 @@ error[E0277]: `std::cell::Cell` cannot be shared between threads safely --> $DIR/not-send-sync.rs:16:5 | LL | fn assert_send(_: T) {} - | ----------------------------- required by `main::assert_send` + | ----------- ---- required by this bound in `main::assert_send` ... LL | assert_send(|| { | ^^^^^^^^^^^ `std::cell::Cell` cannot be shared between threads safely @@ -15,7 +15,7 @@ error[E0277]: `std::cell::Cell` cannot be shared between threads safely --> $DIR/not-send-sync.rs:9:5 | LL | fn assert_sync(_: T) {} - | ----------------------------- required by `main::assert_sync` + | ----------- ---- required by this bound in `main::assert_sync` ... LL | assert_sync(|| { | ^^^^^^^^^^^ `std::cell::Cell` cannot be shared between threads safely diff --git a/src/test/ui/generator/static-not-unpin.stderr b/src/test/ui/generator/static-not-unpin.stderr index b7871ee3478..f2b1078e2b5 100644 --- a/src/test/ui/generator/static-not-unpin.stderr +++ b/src/test/ui/generator/static-not-unpin.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `[static generator@$DIR/static-not-unpin.rs:11:25: --> $DIR/static-not-unpin.rs:14:18 | LL | fn assert_unpin(_: T) { - | ------------------------------- required by `assert_unpin` + | ------------ ----- required by this bound in `assert_unpin` ... LL | assert_unpin(generator); | ^^^^^^^^^ the trait `std::marker::Unpin` is not implemented for `[static generator@$DIR/static-not-unpin.rs:11:25: 13:6 _]` diff --git a/src/test/ui/hrtb/hrtb-conflate-regions.stderr b/src/test/ui/hrtb/hrtb-conflate-regions.stderr index e0b968b6764..205fa2b5bc8 100644 --- a/src/test/ui/hrtb/hrtb-conflate-regions.stderr +++ b/src/test/ui/hrtb/hrtb-conflate-regions.stderr @@ -1,14 +1,13 @@ error[E0277]: the trait bound `for<'a, 'b> SomeStruct: Foo<(&'a isize, &'b isize)>` is not satisfied --> $DIR/hrtb-conflate-regions.rs:27:10 | -LL | / fn want_foo2() -LL | | where T : for<'a,'b> Foo<(&'a isize, &'b isize)> -LL | | { -LL | | } - | |_- required by `want_foo2` +LL | fn want_foo2() + | --------- +LL | where T : for<'a,'b> Foo<(&'a isize, &'b isize)> + | -------------------------------------- required by this bound in `want_foo2` ... -LL | fn b() { want_foo2::(); } - | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a, 'b> Foo<(&'a isize, &'b isize)>` is not implemented for `SomeStruct` +LL | fn b() { want_foo2::(); } + | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a, 'b> Foo<(&'a isize, &'b isize)>` is not implemented for `SomeStruct` | = help: the following implementations were found: > diff --git a/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.stderr b/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.stderr index bc58b8e16aa..ceba22234be 100644 --- a/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.stderr +++ b/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.stderr @@ -1,15 +1,14 @@ error[E0277]: the trait bound `(): Trait fn(&'b u32)>` is not satisfied --> $DIR/hrtb-exists-forall-trait-contravariant.rs:34:5 | -LL | / fn foo() -LL | | where -LL | | T: Trait fn(&'b u32)>, -LL | | { -LL | | } - | |_- required by `foo` +LL | fn foo() + | --- +LL | where +LL | T: Trait fn(&'b u32)>, + | -------------------------- required by this bound in `foo` ... -LL | foo::<()>(); - | ^^^^^^^^^ the trait `Trait fn(&'b u32)>` is not implemented for `()` +LL | foo::<()>(); + | ^^^^^^^^^ the trait `Trait fn(&'b u32)>` is not implemented for `()` | = help: the following implementations were found: <() as Trait> diff --git a/src/test/ui/hrtb/hrtb-exists-forall-trait-covariant.stderr b/src/test/ui/hrtb/hrtb-exists-forall-trait-covariant.stderr index 441f75135f3..a1cb3b230fe 100644 --- a/src/test/ui/hrtb/hrtb-exists-forall-trait-covariant.stderr +++ b/src/test/ui/hrtb/hrtb-exists-forall-trait-covariant.stderr @@ -1,15 +1,14 @@ error[E0277]: the trait bound `(): Trait fn(fn(&'b u32))>` is not satisfied --> $DIR/hrtb-exists-forall-trait-covariant.rs:36:5 | -LL | / fn foo() -LL | | where -LL | | T: Trait fn(fn(&'b u32))>, -LL | | { -LL | | } - | |_- required by `foo` +LL | fn foo() + | --- +LL | where +LL | T: Trait fn(fn(&'b u32))>, + | ------------------------------ required by this bound in `foo` ... -LL | foo::<()>(); - | ^^^^^^^^^ the trait `Trait fn(fn(&'b u32))>` is not implemented for `()` +LL | foo::<()>(); + | ^^^^^^^^^ the trait `Trait fn(fn(&'b u32))>` is not implemented for `()` | = help: the following implementations were found: <() as Trait> diff --git a/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.stderr b/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.stderr index a11949735b9..093bee375bb 100644 --- a/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.stderr +++ b/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.stderr @@ -1,15 +1,14 @@ error[E0277]: the trait bound `(): Trait fn(std::cell::Cell<&'b u32>)>` is not satisfied --> $DIR/hrtb-exists-forall-trait-invariant.rs:28:5 | -LL | / fn foo() -LL | | where -LL | | T: Trait fn(Cell<&'b u32>)>, -LL | | { -LL | | } - | |_- required by `foo` +LL | fn foo() + | --- +LL | where +LL | T: Trait fn(Cell<&'b u32>)>, + | -------------------------------- required by this bound in `foo` ... -LL | foo::<()>(); - | ^^^^^^^^^ the trait `Trait fn(std::cell::Cell<&'b u32>)>` is not implemented for `()` +LL | foo::<()>(); + | ^^^^^^^^^ the trait `Trait fn(std::cell::Cell<&'b u32>)>` is not implemented for `()` | = help: the following implementations were found: <() as Trait)>> diff --git a/src/test/ui/hrtb/hrtb-higher-ranker-supertraits-transitive.stderr b/src/test/ui/hrtb/hrtb-higher-ranker-supertraits-transitive.stderr index 18f49089302..c2cc8ebad27 100644 --- a/src/test/ui/hrtb/hrtb-higher-ranker-supertraits-transitive.stderr +++ b/src/test/ui/hrtb/hrtb-higher-ranker-supertraits-transitive.stderr @@ -1,14 +1,13 @@ error[E0277]: the trait bound `for<'ccx> B: Bar<'ccx>` is not satisfied --> $DIR/hrtb-higher-ranker-supertraits-transitive.rs:47:26 | -LL | / fn want_bar_for_any_ccx(b: &B) -LL | | where B : for<'ccx> Bar<'ccx> -LL | | { -LL | | } - | |_- required by `want_bar_for_any_ccx` +LL | fn want_bar_for_any_ccx(b: &B) + | -------------------- +LL | where B : for<'ccx> Bar<'ccx> + | ------------------- required by this bound in `want_bar_for_any_ccx` ... -LL | want_bar_for_any_ccx(b); - | ^ the trait `for<'ccx> Bar<'ccx>` is not implemented for `B` +LL | want_bar_for_any_ccx(b); + | ^ the trait `for<'ccx> Bar<'ccx>` is not implemented for `B` | = help: consider adding a `where for<'ccx> B: Bar<'ccx>` bound diff --git a/src/test/ui/hrtb/hrtb-higher-ranker-supertraits.stderr b/src/test/ui/hrtb/hrtb-higher-ranker-supertraits.stderr index 7857ab6e86a..a93814ad4c2 100644 --- a/src/test/ui/hrtb/hrtb-higher-ranker-supertraits.stderr +++ b/src/test/ui/hrtb/hrtb-higher-ranker-supertraits.stderr @@ -1,33 +1,26 @@ error[E0277]: the trait bound `for<'tcx> F: Foo<'tcx>` is not satisfied --> $DIR/hrtb-higher-ranker-supertraits.rs:18:26 | -LL | want_foo_for_any_tcx(f); - | ^ the trait `for<'tcx> Foo<'tcx>` is not implemented for `F` +LL | want_foo_for_any_tcx(f); + | ^ the trait `for<'tcx> Foo<'tcx>` is not implemented for `F` ... -LL | / fn want_foo_for_any_tcx(f: &F) -LL | | where F : for<'tcx> Foo<'tcx> -LL | | { -LL | | want_foo_for_some_tcx(f); -LL | | want_foo_for_any_tcx(f); -LL | | } - | |_- required by `want_foo_for_any_tcx` +LL | fn want_foo_for_any_tcx(f: &F) + | -------------------- +LL | where F : for<'tcx> Foo<'tcx> + | ------------------- required by this bound in `want_foo_for_any_tcx` | = help: consider adding a `where for<'tcx> F: Foo<'tcx>` bound error[E0277]: the trait bound `for<'ccx> B: Bar<'ccx>` is not satisfied --> $DIR/hrtb-higher-ranker-supertraits.rs:35:26 | -LL | want_bar_for_any_ccx(b); - | ^ the trait `for<'ccx> Bar<'ccx>` is not implemented for `B` +LL | want_bar_for_any_ccx(b); + | ^ the trait `for<'ccx> Bar<'ccx>` is not implemented for `B` ... -LL | / fn want_bar_for_any_ccx(b: &B) -LL | | where B : for<'ccx> Bar<'ccx> -LL | | { -LL | | want_foo_for_some_tcx(b); -... | -LL | | want_bar_for_any_ccx(b); -LL | | } - | |_- required by `want_bar_for_any_ccx` +LL | fn want_bar_for_any_ccx(b: &B) + | -------------------- +LL | where B : for<'ccx> Bar<'ccx> + | ------------------- required by this bound in `want_bar_for_any_ccx` | = help: consider adding a `where for<'ccx> B: Bar<'ccx>` bound diff --git a/src/test/ui/hrtb/hrtb-just-for-static.stderr b/src/test/ui/hrtb/hrtb-just-for-static.stderr index b2938e541fd..f4cf3555868 100644 --- a/src/test/ui/hrtb/hrtb-just-for-static.stderr +++ b/src/test/ui/hrtb/hrtb-just-for-static.stderr @@ -1,14 +1,13 @@ error[E0277]: the trait bound `for<'a> StaticInt: Foo<&'a isize>` is not satisfied --> $DIR/hrtb-just-for-static.rs:24:5 | -LL | / fn want_hrtb() -LL | | where T : for<'a> Foo<&'a isize> -LL | | { -LL | | } - | |_- required by `want_hrtb` +LL | fn want_hrtb() + | --------- +LL | where T : for<'a> Foo<&'a isize> + | ---------------------- required by this bound in `want_hrtb` ... -LL | want_hrtb::() - | ^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> Foo<&'a isize>` is not implemented for `StaticInt` +LL | want_hrtb::() + | ^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> Foo<&'a isize>` is not implemented for `StaticInt` | = help: the following implementations were found: > @@ -16,14 +15,13 @@ LL | want_hrtb::() error[E0277]: the trait bound `for<'a> &'a u32: Foo<&'a isize>` is not satisfied --> $DIR/hrtb-just-for-static.rs:30:5 | -LL | / fn want_hrtb() -LL | | where T : for<'a> Foo<&'a isize> -LL | | { -LL | | } - | |_- required by `want_hrtb` +LL | fn want_hrtb() + | --------- +LL | where T : for<'a> Foo<&'a isize> + | ---------------------- required by this bound in `want_hrtb` ... -LL | want_hrtb::<&'a u32>() - | ^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> Foo<&'a isize>` is not implemented for `&'a u32` +LL | want_hrtb::<&'a u32>() + | ^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> Foo<&'a isize>` is not implemented for `&'a u32` | = help: the following implementations were found: <&'a u32 as Foo<&'a isize>> diff --git a/src/test/ui/hrtb/issue-46989.stderr b/src/test/ui/hrtb/issue-46989.stderr index 57eaf2aad2b..4da3e3ddb7e 100644 --- a/src/test/ui/hrtb/issue-46989.stderr +++ b/src/test/ui/hrtb/issue-46989.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `for<'r> fn(&'r i32): Foo` is not satisfied --> $DIR/issue-46989.rs:40:5 | LL | fn assert_foo() {} - | ----------------------- required by `assert_foo` + | ---------- --- required by this bound in `assert_foo` ... LL | assert_foo::(); | ^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `for<'r> fn(&'r i32)` diff --git a/src/test/ui/impl-trait/auto-trait-leak.stderr b/src/test/ui/impl-trait/auto-trait-leak.stderr index af641a89e7f..d11941fee18 100644 --- a/src/test/ui/impl-trait/auto-trait-leak.stderr +++ b/src/test/ui/impl-trait/auto-trait-leak.stderr @@ -73,7 +73,7 @@ error[E0277]: `std::rc::Rc` cannot be sent between threads --> $DIR/auto-trait-leak.rs:15:5 | LL | fn send(_: T) {} - | ---------------------- required by `send` + | ---- ---- required by this bound in `send` ... LL | send(cycle2().clone()); | ^^^^ `std::rc::Rc` cannot be sent between threads safely diff --git a/src/test/ui/impl-trait/auto-trait-leak2.stderr b/src/test/ui/impl-trait/auto-trait-leak2.stderr index 460af7dedbe..d163e1dff7a 100644 --- a/src/test/ui/impl-trait/auto-trait-leak2.stderr +++ b/src/test/ui/impl-trait/auto-trait-leak2.stderr @@ -2,7 +2,7 @@ error[E0277]: `std::rc::Rc>` cannot be sent between threads --> $DIR/auto-trait-leak2.rs:13:5 | LL | fn send(_: T) {} - | ---------------------- required by `send` + | ---- ---- required by this bound in `send` ... LL | send(before()); | ^^^^ `std::rc::Rc>` cannot be sent between threads safely @@ -15,7 +15,7 @@ error[E0277]: `std::rc::Rc>` cannot be sent between threads --> $DIR/auto-trait-leak2.rs:16:5 | LL | fn send(_: T) {} - | ---------------------- required by `send` + | ---- ---- required by this bound in `send` ... LL | send(after()); | ^^^^ `std::rc::Rc>` cannot be sent between threads safely diff --git a/src/test/ui/interior-mutability/interior-mutability.stderr b/src/test/ui/interior-mutability/interior-mutability.stderr index 31390bc6cce..1a726be4aa6 100644 --- a/src/test/ui/interior-mutability/interior-mutability.stderr +++ b/src/test/ui/interior-mutability/interior-mutability.stderr @@ -3,12 +3,16 @@ error[E0277]: the type `std::cell::UnsafeCell` may contain interior mutabil | LL | catch_unwind(|| { x.set(23); }); | ^^^^^^^^^^^^ `std::cell::UnsafeCell` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary + | + ::: $SRC_DIR/libstd/panic.rs:LL:COL + | +LL | pub fn catch_unwind R + UnwindSafe, R>(f: F) -> Result { + | ---------- required by this bound in `std::panic::catch_unwind` | = help: within `std::cell::Cell`, the trait `std::panic::RefUnwindSafe` is not implemented for `std::cell::UnsafeCell` = note: required because it appears within the type `std::cell::Cell` = note: required because of the requirements on the impl of `std::panic::UnwindSafe` for `&std::cell::Cell` = note: required because it appears within the type `[closure@$DIR/interior-mutability.rs:5:18: 5:35 x:&std::cell::Cell]` - = note: required by `std::panic::catch_unwind` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-1920-1.stderr b/src/test/ui/issues/issue-1920-1.stderr index c62cbb0cf8b..56f70aa296c 100644 --- a/src/test/ui/issues/issue-1920-1.stderr +++ b/src/test/ui/issues/issue-1920-1.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `foo::issue_1920::S: std::clone::Clone` is not sat --> $DIR/issue-1920-1.rs:12:5 | LL | fn assert_clone() where T : Clone { } - | ------------------------------------ required by `assert_clone` + | ------------ ----- required by this bound in `assert_clone` ... LL | assert_clone::(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::clone::Clone` is not implemented for `foo::issue_1920::S` diff --git a/src/test/ui/issues/issue-1920-2.stderr b/src/test/ui/issues/issue-1920-2.stderr index aad07624469..37027b05792 100644 --- a/src/test/ui/issues/issue-1920-2.stderr +++ b/src/test/ui/issues/issue-1920-2.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `bar::S: std::clone::Clone` is not satisfied --> $DIR/issue-1920-2.rs:10:5 | LL | fn assert_clone() where T : Clone { } - | ------------------------------------ required by `assert_clone` + | ------------ ----- required by this bound in `assert_clone` ... LL | assert_clone::(); | ^^^^^^^^^^^^^^^^^^^^^^ the trait `std::clone::Clone` is not implemented for `bar::S` diff --git a/src/test/ui/issues/issue-1920-3.stderr b/src/test/ui/issues/issue-1920-3.stderr index 4378ea49755..dbcb3aee117 100644 --- a/src/test/ui/issues/issue-1920-3.stderr +++ b/src/test/ui/issues/issue-1920-3.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `issue_1920::S: std::clone::Clone` is not satisfie --> $DIR/issue-1920-3.rs:14:5 | LL | fn assert_clone() where T : Clone { } - | ------------------------------------ required by `assert_clone` + | ------------ ----- required by this bound in `assert_clone` ... LL | assert_clone::(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::clone::Clone` is not implemented for `issue_1920::S` diff --git a/src/test/ui/issues/issue-21160.stderr b/src/test/ui/issues/issue-21160.stderr index e32343e9682..577baa97d8f 100644 --- a/src/test/ui/issues/issue-21160.stderr +++ b/src/test/ui/issues/issue-21160.stderr @@ -3,8 +3,11 @@ error[E0277]: the trait bound `Bar: std::hash::Hash` is not satisfied | LL | struct Foo(Bar); | ^^^ the trait `std::hash::Hash` is not implemented for `Bar` + | + ::: $SRC_DIR/libcore/hash/mod.rs:LL:COL | - = note: required by `std::hash::Hash::hash` +LL | fn hash(&self, state: &mut H); + | - required by this bound in `std::hash::Hash::hash` error: aborting due to previous error diff --git a/src/test/ui/issues/issue-21763.stderr b/src/test/ui/issues/issue-21763.stderr index 99d004a973a..2bede9120cf 100644 --- a/src/test/ui/issues/issue-21763.stderr +++ b/src/test/ui/issues/issue-21763.stderr @@ -2,7 +2,7 @@ error[E0277]: `std::rc::Rc<()>` cannot be sent between threads safely --> $DIR/issue-21763.rs:9:5 | LL | fn foo() {} - | ----------------- required by `foo` + | --- ---- required by this bound in `foo` ... LL | foo::, Rc<()>>>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::rc::Rc<()>` cannot be sent between threads safely diff --git a/src/test/ui/issues/issue-25076.stderr b/src/test/ui/issues/issue-25076.stderr index a7b6626b16a..0a13a2bc330 100644 --- a/src/test/ui/issues/issue-25076.stderr +++ b/src/test/ui/issues/issue-25076.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `(): InOut<_>` is not satisfied --> $DIR/issue-25076.rs:10:20 | LL | fn do_fold>(init: B, f: F) {} - | ------------------------------------------------ required by `do_fold` + | ------- --------------- required by this bound in `do_fold` ... LL | do_fold(bot(), ()); | ^^ the trait `InOut<_>` is not implemented for `()` diff --git a/src/test/ui/issues/issue-32963.stderr b/src/test/ui/issues/issue-32963.stderr index 2960f4e5989..e3564e86701 100644 --- a/src/test/ui/issues/issue-32963.stderr +++ b/src/test/ui/issues/issue-32963.stderr @@ -13,7 +13,7 @@ error[E0277]: the trait bound `dyn Misc: std::marker::Copy` is not satisfied --> $DIR/issue-32963.rs:8:5 | LL | fn size_of_copy() -> usize { mem::size_of::() } - | ------------------------------------------ required by `size_of_copy` + | ------------ ---- required by this bound in `size_of_copy` ... LL | size_of_copy::(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `dyn Misc` diff --git a/src/test/ui/issues/issue-40827.stderr b/src/test/ui/issues/issue-40827.stderr index 9131120671f..3fe47e249f1 100644 --- a/src/test/ui/issues/issue-40827.stderr +++ b/src/test/ui/issues/issue-40827.stderr @@ -2,7 +2,7 @@ error[E0277]: `std::rc::Rc` cannot be sent between threads safely --> $DIR/issue-40827.rs:14:5 | LL | fn f(_: T) {} - | ------------------- required by `f` + | - ---- required by this bound in `f` ... LL | f(Foo(Arc::new(Bar::B(None)))); | ^ `std::rc::Rc` cannot be sent between threads safely @@ -16,7 +16,7 @@ error[E0277]: `std::rc::Rc` cannot be shared between threads safely --> $DIR/issue-40827.rs:14:5 | LL | fn f(_: T) {} - | ------------------- required by `f` + | - ---- required by this bound in `f` ... LL | f(Foo(Arc::new(Bar::B(None)))); | ^ `std::rc::Rc` cannot be shared between threads safely diff --git a/src/test/ui/issues/issue-43623.stderr b/src/test/ui/issues/issue-43623.stderr index d843629e8a2..210d831abf0 100644 --- a/src/test/ui/issues/issue-43623.stderr +++ b/src/test/ui/issues/issue-43623.stderr @@ -1,31 +1,27 @@ error[E0631]: type mismatch in function arguments --> $DIR/issue-43623.rs:14:5 | -LL | / pub fn break_me(f: F) -LL | | where T: for<'b> Trait<'b>, -LL | | F: for<'b> FnMut(>::Assoc) { -LL | | break_me::; - | | ^^^^^^^^^^^^^^^^^^^^^^^ - | | | - | | expected signature of `for<'b> fn(>::Assoc) -> _` - | | found signature of `fn(_) -> _` -LL | | -LL | | -LL | | } - | |_- required by `break_me` +LL | pub fn break_me(f: F) + | -------- +LL | where T: for<'b> Trait<'b>, +LL | F: for<'b> FnMut(>::Assoc) { + | -------------------------------------- required by this bound in `break_me` +LL | break_me::; + | ^^^^^^^^^^^^^^^^^^^^^^^ + | | + | expected signature of `for<'b> fn(>::Assoc) -> _` + | found signature of `fn(_) -> _` error[E0271]: type mismatch resolving `for<'b> >::Assoc,)>>::Output == ()` --> $DIR/issue-43623.rs:14:5 | -LL | / pub fn break_me(f: F) -LL | | where T: for<'b> Trait<'b>, -LL | | F: for<'b> FnMut(>::Assoc) { -LL | | break_me::; - | | ^^^^^^^^^^^^^^^^^^^^^^^ expected bound lifetime parameter 'b, found concrete lifetime -LL | | -LL | | -LL | | } - | |_- required by `break_me` +LL | pub fn break_me(f: F) + | -------- +LL | where T: for<'b> Trait<'b>, +LL | F: for<'b> FnMut(>::Assoc) { + | ------------------------- required by this bound in `break_me` +LL | break_me::; + | ^^^^^^^^^^^^^^^^^^^^^^^ expected bound lifetime parameter 'b, found concrete lifetime error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-47706.stderr b/src/test/ui/issues/issue-47706.stderr index 4f64a643fe5..6cde9373466 100644 --- a/src/test/ui/issues/issue-47706.stderr +++ b/src/test/ui/issues/issue-47706.stderr @@ -10,18 +10,17 @@ LL | self.foo.map(Foo::new) error[E0593]: function is expected to take 0 arguments, but it takes 1 argument --> $DIR/issue-47706.rs:27:9 | -LL | Bar(i32), - | -------- takes 1 argument +LL | Bar(i32), + | -------- takes 1 argument ... -LL | / fn foo(f: F) -LL | | where -LL | | F: Fn(), -LL | | { -LL | | } - | |_- required by `foo` +LL | fn foo(f: F) + | --- +LL | where +LL | F: Fn(), + | ---- required by this bound in `foo` ... -LL | foo(Qux::Bar); - | ^^^^^^^^ expected function that takes 0 arguments +LL | foo(Qux::Bar); + | ^^^^^^^^ expected function that takes 0 arguments error: aborting due to 2 previous errors diff --git a/src/test/ui/issues/issue-60283.stderr b/src/test/ui/issues/issue-60283.stderr index 2b01a64d39a..dc7952200b1 100644 --- a/src/test/ui/issues/issue-60283.stderr +++ b/src/test/ui/issues/issue-60283.stderr @@ -1,27 +1,29 @@ error[E0631]: type mismatch in function arguments --> $DIR/issue-60283.rs:14:13 | -LL | / pub fn foo(_: T, _: F) -LL | | where T: for<'a> Trait<'a>, -LL | | F: for<'a> FnMut(>::Item) {} - | |_________________________________________________- required by `foo` +LL | pub fn foo(_: T, _: F) + | --- +LL | where T: for<'a> Trait<'a>, +LL | F: for<'a> FnMut(>::Item) {} + | ------------------------------------- required by this bound in `foo` ... -LL | foo((), drop) - | ^^^^ - | | - | expected signature of `for<'a> fn(<() as Trait<'a>>::Item) -> _` - | found signature of `fn(_) -> _` +LL | foo((), drop) + | ^^^^ + | | + | expected signature of `for<'a> fn(<() as Trait<'a>>::Item) -> _` + | found signature of `fn(_) -> _` error[E0271]: type mismatch resolving `for<'a> } as std::ops::FnOnce<(<() as Trait<'a>>::Item,)>>::Output == ()` --> $DIR/issue-60283.rs:14:5 | -LL | / pub fn foo(_: T, _: F) -LL | | where T: for<'a> Trait<'a>, -LL | | F: for<'a> FnMut(>::Item) {} - | |_________________________________________________- required by `foo` +LL | pub fn foo(_: T, _: F) + | --- +LL | where T: for<'a> Trait<'a>, +LL | F: for<'a> FnMut(>::Item) {} + | ------------------------ required by this bound in `foo` ... -LL | foo((), drop) - | ^^^ expected bound lifetime parameter 'a, found concrete lifetime +LL | foo((), drop) + | ^^^ expected bound lifetime parameter 'a, found concrete lifetime error: aborting due to 2 previous errors diff --git a/src/test/ui/kindck/kindck-copy.stderr b/src/test/ui/kindck/kindck-copy.stderr index 1fe59460e05..53b4448a757 100644 --- a/src/test/ui/kindck/kindck-copy.stderr +++ b/src/test/ui/kindck/kindck-copy.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `&'static mut isize: std::marker::Copy` is not sat --> $DIR/kindck-copy.rs:27:5 | LL | fn assert_copy() { } - | ------------------------ required by `assert_copy` + | ----------- ---- required by this bound in `assert_copy` ... LL | assert_copy::<&'static mut isize>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `&'static mut isize` @@ -14,7 +14,7 @@ error[E0277]: the trait bound `&'a mut isize: std::marker::Copy` is not satisfie --> $DIR/kindck-copy.rs:28:5 | LL | fn assert_copy() { } - | ------------------------ required by `assert_copy` + | ----------- ---- required by this bound in `assert_copy` ... LL | assert_copy::<&'a mut isize>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `&'a mut isize` @@ -26,7 +26,7 @@ error[E0277]: the trait bound `std::boxed::Box: std::marker::Copy` is not --> $DIR/kindck-copy.rs:31:5 | LL | fn assert_copy() { } - | ------------------------ required by `assert_copy` + | ----------- ---- required by this bound in `assert_copy` ... LL | assert_copy::>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::boxed::Box` @@ -35,7 +35,7 @@ error[E0277]: the trait bound `std::string::String: std::marker::Copy` is not sa --> $DIR/kindck-copy.rs:32:5 | LL | fn assert_copy() { } - | ------------------------ required by `assert_copy` + | ----------- ---- required by this bound in `assert_copy` ... LL | assert_copy::(); | ^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::string::String` @@ -44,7 +44,7 @@ error[E0277]: the trait bound `std::vec::Vec: std::marker::Copy` is not s --> $DIR/kindck-copy.rs:33:5 | LL | fn assert_copy() { } - | ------------------------ required by `assert_copy` + | ----------- ---- required by this bound in `assert_copy` ... LL | assert_copy:: >(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::vec::Vec` @@ -53,7 +53,7 @@ error[E0277]: the trait bound `std::boxed::Box<&'a mut isize>: std::marker::Copy --> $DIR/kindck-copy.rs:34:5 | LL | fn assert_copy() { } - | ------------------------ required by `assert_copy` + | ----------- ---- required by this bound in `assert_copy` ... LL | assert_copy::>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::boxed::Box<&'a mut isize>` @@ -62,7 +62,7 @@ error[E0277]: the trait bound `std::boxed::Box: std::marker::Copy` is --> $DIR/kindck-copy.rs:42:5 | LL | fn assert_copy() { } - | ------------------------ required by `assert_copy` + | ----------- ---- required by this bound in `assert_copy` ... LL | assert_copy::>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::boxed::Box` @@ -71,7 +71,7 @@ error[E0277]: the trait bound `std::boxed::Box: s --> $DIR/kindck-copy.rs:43:5 | LL | fn assert_copy() { } - | ------------------------ required by `assert_copy` + | ----------- ---- required by this bound in `assert_copy` ... LL | assert_copy::>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::boxed::Box` @@ -80,7 +80,7 @@ error[E0277]: the trait bound `&'a mut (dyn Dummy + std::marker::Send + 'a): std --> $DIR/kindck-copy.rs:46:5 | LL | fn assert_copy() { } - | ------------------------ required by `assert_copy` + | ----------- ---- required by this bound in `assert_copy` ... LL | assert_copy::<&'a mut (dyn Dummy + Send)>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `&'a mut (dyn Dummy + std::marker::Send + 'a)` @@ -89,7 +89,7 @@ error[E0277]: the trait bound `MyNoncopyStruct: std::marker::Copy` is not satisf --> $DIR/kindck-copy.rs:64:5 | LL | fn assert_copy() { } - | ------------------------ required by `assert_copy` + | ----------- ---- required by this bound in `assert_copy` ... LL | assert_copy::(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `MyNoncopyStruct` @@ -98,7 +98,7 @@ error[E0277]: the trait bound `std::rc::Rc: std::marker::Copy` is not sat --> $DIR/kindck-copy.rs:67:5 | LL | fn assert_copy() { } - | ------------------------ required by `assert_copy` + | ----------- ---- required by this bound in `assert_copy` ... LL | assert_copy::>(); | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::rc::Rc` diff --git a/src/test/ui/kindck/kindck-impl-type-params-2.stderr b/src/test/ui/kindck/kindck-impl-type-params-2.stderr index 5e6eca6f057..8e989113244 100644 --- a/src/test/ui/kindck/kindck-impl-type-params-2.stderr +++ b/src/test/ui/kindck/kindck-impl-type-params-2.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `std::boxed::Box<{integer}>: std::marker::Copy` is --> $DIR/kindck-impl-type-params-2.rs:13:16 | LL | fn take_param(foo: &T) { } - | ----------------------------- required by `take_param` + | ---------- --- required by this bound in `take_param` ... LL | take_param(&x); | ^^ the trait `std::marker::Copy` is not implemented for `std::boxed::Box<{integer}>` diff --git a/src/test/ui/kindck/kindck-inherited-copy-bound.stderr b/src/test/ui/kindck/kindck-inherited-copy-bound.stderr index 9f548083e73..27901d06927 100644 --- a/src/test/ui/kindck/kindck-inherited-copy-bound.stderr +++ b/src/test/ui/kindck/kindck-inherited-copy-bound.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `std::boxed::Box<{integer}>: std::marker::Copy` is --> $DIR/kindck-inherited-copy-bound.rs:18:16 | LL | fn take_param(foo: &T) { } - | ----------------------------- required by `take_param` + | ---------- --- required by this bound in `take_param` ... LL | take_param(&x); | ^^ the trait `std::marker::Copy` is not implemented for `std::boxed::Box<{integer}>` diff --git a/src/test/ui/kindck/kindck-nonsendable-1.stderr b/src/test/ui/kindck/kindck-nonsendable-1.stderr index 6d60de888c9..40b67f8fe8c 100644 --- a/src/test/ui/kindck/kindck-nonsendable-1.stderr +++ b/src/test/ui/kindck/kindck-nonsendable-1.stderr @@ -2,7 +2,7 @@ error[E0277]: `std::rc::Rc` cannot be sent between threads safely --> $DIR/kindck-nonsendable-1.rs:9:5 | LL | fn bar(_: F) { } - | ------------------------------- required by `bar` + | --- ---- required by this bound in `bar` ... LL | bar(move|| foo(x)); | ^^^ `std::rc::Rc` cannot be sent between threads safely diff --git a/src/test/ui/kindck/kindck-send-object.stderr b/src/test/ui/kindck/kindck-send-object.stderr index 3ca2d730cba..8708537f863 100644 --- a/src/test/ui/kindck/kindck-send-object.stderr +++ b/src/test/ui/kindck/kindck-send-object.stderr @@ -2,7 +2,7 @@ error[E0277]: `(dyn Dummy + 'static)` cannot be shared between threads safely --> $DIR/kindck-send-object.rs:12:5 | LL | fn assert_send() { } - | ------------------------ required by `assert_send` + | ----------- ---- required by this bound in `assert_send` ... LL | assert_send::<&'static (dyn Dummy + 'static)>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'static)` cannot be shared between threads safely @@ -14,7 +14,7 @@ error[E0277]: `dyn Dummy` cannot be sent between threads safely --> $DIR/kindck-send-object.rs:17:5 | LL | fn assert_send() { } - | ------------------------ required by `assert_send` + | ----------- ---- required by this bound in `assert_send` ... LL | assert_send::>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `dyn Dummy` cannot be sent between threads safely diff --git a/src/test/ui/kindck/kindck-send-object1.stderr b/src/test/ui/kindck/kindck-send-object1.stderr index 0f5f7e0890b..436b92637aa 100644 --- a/src/test/ui/kindck/kindck-send-object1.stderr +++ b/src/test/ui/kindck/kindck-send-object1.stderr @@ -2,7 +2,7 @@ error[E0277]: `(dyn Dummy + 'a)` cannot be shared between threads safely --> $DIR/kindck-send-object1.rs:10:5 | LL | fn assert_send() { } - | -------------------------------- required by `assert_send` + | ----------- ---- required by this bound in `assert_send` ... LL | assert_send::<&'a dyn Dummy>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be shared between threads safely @@ -22,7 +22,7 @@ error[E0277]: `(dyn Dummy + 'a)` cannot be sent between threads safely --> $DIR/kindck-send-object1.rs:29:5 | LL | fn assert_send() { } - | -------------------------------- required by `assert_send` + | ----------- ---- required by this bound in `assert_send` ... LL | assert_send::>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be sent between threads safely diff --git a/src/test/ui/kindck/kindck-send-object2.stderr b/src/test/ui/kindck/kindck-send-object2.stderr index 72cd985cc86..6cb82edf263 100644 --- a/src/test/ui/kindck/kindck-send-object2.stderr +++ b/src/test/ui/kindck/kindck-send-object2.stderr @@ -2,7 +2,7 @@ error[E0277]: `(dyn Dummy + 'static)` cannot be shared between threads safely --> $DIR/kindck-send-object2.rs:7:5 | LL | fn assert_send() { } - | ------------------------ required by `assert_send` + | ----------- ---- required by this bound in `assert_send` ... LL | assert_send::<&'static dyn Dummy>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'static)` cannot be shared between threads safely @@ -14,7 +14,7 @@ error[E0277]: `dyn Dummy` cannot be sent between threads safely --> $DIR/kindck-send-object2.rs:12:5 | LL | fn assert_send() { } - | ------------------------ required by `assert_send` + | ----------- ---- required by this bound in `assert_send` ... LL | assert_send::>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `dyn Dummy` cannot be sent between threads safely diff --git a/src/test/ui/kindck/kindck-send-owned.stderr b/src/test/ui/kindck/kindck-send-owned.stderr index ee919f02d65..c7403495424 100644 --- a/src/test/ui/kindck/kindck-send-owned.stderr +++ b/src/test/ui/kindck/kindck-send-owned.stderr @@ -2,7 +2,7 @@ error[E0277]: `*mut u8` cannot be sent between threads safely --> $DIR/kindck-send-owned.rs:12:5 | LL | fn assert_send() { } - | ------------------------ required by `assert_send` + | ----------- ---- required by this bound in `assert_send` ... LL | assert_send::>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*mut u8` cannot be sent between threads safely diff --git a/src/test/ui/kindck/kindck-send-unsafe.stderr b/src/test/ui/kindck/kindck-send-unsafe.stderr index a87e1c7db2a..a46705ab175 100644 --- a/src/test/ui/kindck/kindck-send-unsafe.stderr +++ b/src/test/ui/kindck/kindck-send-unsafe.stderr @@ -2,7 +2,7 @@ error[E0277]: `*mut &'a isize` cannot be sent between threads safely --> $DIR/kindck-send-unsafe.rs:6:5 | LL | fn assert_send() { } - | ------------------------ required by `assert_send` + | ----------- ---- required by this bound in `assert_send` ... LL | assert_send::<*mut &'a isize>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*mut &'a isize` cannot be sent between threads safely diff --git a/src/test/ui/marker_trait_attr/overlap-marker-trait.stderr b/src/test/ui/marker_trait_attr/overlap-marker-trait.stderr index 4e79fbdeadc..be5e649ef83 100644 --- a/src/test/ui/marker_trait_attr/overlap-marker-trait.stderr +++ b/src/test/ui/marker_trait_attr/overlap-marker-trait.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `NotDebugOrDisplay: Marker` is not satisfied --> $DIR/overlap-marker-trait.rs:27:5 | LL | fn is_marker() { } - | ------------------------- required by `is_marker` + | --------- ------ required by this bound in `is_marker` ... LL | is_marker::(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Marker` is not implemented for `NotDebugOrDisplay` diff --git a/src/test/ui/mismatched_types/E0631.stderr b/src/test/ui/mismatched_types/E0631.stderr index 64ddf1deb06..88c1efdbb90 100644 --- a/src/test/ui/mismatched_types/E0631.stderr +++ b/src/test/ui/mismatched_types/E0631.stderr @@ -2,7 +2,7 @@ error[E0631]: type mismatch in closure arguments --> $DIR/E0631.rs:7:5 | LL | fn foo(_: F) {} - | -------------------------- required by `foo` + | --- --------- required by this bound in `foo` ... LL | foo(|_: isize| {}); | ^^^ ---------- found signature of `fn(isize) -> _` @@ -13,7 +13,7 @@ error[E0631]: type mismatch in closure arguments --> $DIR/E0631.rs:8:5 | LL | fn bar>(_: F) {} - | -------------------------- required by `bar` + | --- --------- required by this bound in `bar` ... LL | bar(|_: isize| {}); | ^^^ ---------- found signature of `fn(isize) -> _` @@ -24,7 +24,7 @@ error[E0631]: type mismatch in function arguments --> $DIR/E0631.rs:9:9 | LL | fn foo(_: F) {} - | -------------------------- required by `foo` + | --- --------- required by this bound in `foo` ... LL | fn f(_: u64) {} | ------------ found signature of `fn(u64) -> _` @@ -36,7 +36,7 @@ error[E0631]: type mismatch in function arguments --> $DIR/E0631.rs:10:9 | LL | fn bar>(_: F) {} - | -------------------------- required by `bar` + | --- --------- required by this bound in `bar` LL | fn main() { LL | fn f(_: u64) {} | ------------ found signature of `fn(u64) -> _` diff --git a/src/test/ui/mismatched_types/closure-arg-count.stderr b/src/test/ui/mismatched_types/closure-arg-count.stderr index 12ae8acaee5..ed2b3f0c3ce 100644 --- a/src/test/ui/mismatched_types/closure-arg-count.stderr +++ b/src/test/ui/mismatched_types/closure-arg-count.stderr @@ -46,7 +46,7 @@ error[E0593]: closure is expected to take 1 argument, but it takes 0 arguments --> $DIR/closure-arg-count.rs:13:5 | LL | fn f>(_: F) {} - | ------------------------ required by `f` + | - --------- required by this bound in `f` ... LL | f(|| panic!()); | ^ -- takes 0 arguments @@ -61,7 +61,7 @@ error[E0593]: closure is expected to take 1 argument, but it takes 0 arguments --> $DIR/closure-arg-count.rs:15:5 | LL | fn f>(_: F) {} - | ------------------------ required by `f` + | - --------- required by this bound in `f` ... LL | f( move || panic!()); | ^ ---------- takes 0 arguments @@ -143,7 +143,7 @@ LL | call(Foo); | ^^^ expected function that takes 0 arguments ... LL | fn call(_: F) where F: FnOnce() -> R {} - | ------------------------------------------ required by `call` + | ---- ------------- required by this bound in `call` LL | struct Foo(u8); | --------------- takes 1 argument diff --git a/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr b/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr index 68bc17b4966..a731891bf76 100644 --- a/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr +++ b/src/test/ui/mismatched_types/closure-arg-type-mismatch.stderr @@ -26,7 +26,7 @@ error[E0631]: type mismatch in function arguments --> $DIR/closure-arg-type-mismatch.rs:10:9 | LL | fn baz(_: F) {} - | ------------------------------ required by `baz` + | --- ------------- required by this bound in `baz` LL | fn _test<'a>(f: fn(*mut &'a u32)) { LL | baz(f); | ^ @@ -38,7 +38,7 @@ error[E0271]: type mismatch resolving `for<'r> $DIR/closure-arg-type-mismatch.rs:10:5 | LL | fn baz(_: F) {} - | ------------------------------ required by `baz` + | --- ----------- required by this bound in `baz` LL | fn _test<'a>(f: fn(*mut &'a u32)) { LL | baz(f); | ^^^ expected bound lifetime parameter, found concrete lifetime diff --git a/src/test/ui/mismatched_types/closure-mismatch.stderr b/src/test/ui/mismatched_types/closure-mismatch.stderr index 0fe4909eaa7..fd2b9f3c66b 100644 --- a/src/test/ui/mismatched_types/closure-mismatch.stderr +++ b/src/test/ui/mismatched_types/closure-mismatch.stderr @@ -2,7 +2,7 @@ error[E0271]: type mismatch resolving `for<'r> <[closure@$DIR/closure-mismatch.r --> $DIR/closure-mismatch.rs:8:5 | LL | fn baz(_: T) {} - | -------------------- required by `baz` + | --- --- required by this bound in `baz` ... LL | baz(|_| ()); | ^^^ expected bound lifetime parameter, found concrete lifetime @@ -13,7 +13,7 @@ error[E0631]: type mismatch in closure arguments --> $DIR/closure-mismatch.rs:8:5 | LL | fn baz(_: T) {} - | -------------------- required by `baz` + | --- --- required by this bound in `baz` ... LL | baz(|_| ()); | ^^^ ------ found signature of `fn(_) -> _` diff --git a/src/test/ui/mismatched_types/fn-variance-1.stderr b/src/test/ui/mismatched_types/fn-variance-1.stderr index 6342ee770dd..1a82dd53edc 100644 --- a/src/test/ui/mismatched_types/fn-variance-1.stderr +++ b/src/test/ui/mismatched_types/fn-variance-1.stderr @@ -5,7 +5,7 @@ LL | fn takes_mut(x: &mut isize) { } | --------------------------- found signature of `for<'r> fn(&'r mut isize) -> _` LL | LL | fn apply(t: T, f: F) where F: FnOnce(T) { - | --------------------------------------------- required by `apply` + | ----- --------- required by this bound in `apply` ... LL | apply(&3, takes_mut); | ^^^^^^^^^ expected signature of `fn(&{integer}) -> _` @@ -17,7 +17,7 @@ LL | fn takes_imm(x: &isize) { } | ----------------------- found signature of `for<'r> fn(&'r isize) -> _` ... LL | fn apply(t: T, f: F) where F: FnOnce(T) { - | --------------------------------------------- required by `apply` + | ----- --------- required by this bound in `apply` ... LL | apply(&mut 3, takes_imm); | ^^^^^^^^^ expected signature of `fn(&mut {integer}) -> _` diff --git a/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.rs b/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.rs index 88bea979b97..2bd4d338446 100644 --- a/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.rs +++ b/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.rs @@ -5,7 +5,8 @@ use std::ops::FnMut; fn to_fn_mut>(f: F) -> F { f } fn call_itisize>(y: isize, mut f: F) -> isize { -//~^ NOTE required by `call_it` +//~^ NOTE required by this bound in `call_it` +//~| NOTE f(2, y) } diff --git a/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.stderr b/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.stderr index 139d87d58b6..6c249f62751 100644 --- a/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.stderr +++ b/src/test/ui/mismatched_types/unboxed-closures-vtable-mismatch.stderr @@ -1,8 +1,8 @@ error[E0631]: type mismatch in closure arguments - --> $DIR/unboxed-closures-vtable-mismatch.rs:15:24 + --> $DIR/unboxed-closures-vtable-mismatch.rs:16:13 | LL | fn call_itisize>(y: isize, mut f: F) -> isize { - | -------------------------------------------------------------------- required by `call_it` + | ------- ------------------------- required by this bound in `call_it` ... LL | let f = to_fn_mut(|x: usize, y: isize| -> isize { (x as isize) + y }); | ----------------------------- found signature of `fn(usize, isize) -> _` diff --git a/src/test/ui/mut/mutable-enum-indirect.stderr b/src/test/ui/mut/mutable-enum-indirect.stderr index 4efb10b5629..0290efc3d96 100644 --- a/src/test/ui/mut/mutable-enum-indirect.stderr +++ b/src/test/ui/mut/mutable-enum-indirect.stderr @@ -2,7 +2,7 @@ error[E0277]: `NoSync` cannot be shared between threads safely --> $DIR/mutable-enum-indirect.rs:17:5 | LL | fn bar(_: T) {} - | --------------------- required by `bar` + | --- ---- required by this bound in `bar` ... LL | bar(&x); | ^^^ `NoSync` cannot be shared between threads safely diff --git a/src/test/ui/mutexguard-sync.stderr b/src/test/ui/mutexguard-sync.stderr index 1cda2da5061..71a06fce4b9 100644 --- a/src/test/ui/mutexguard-sync.stderr +++ b/src/test/ui/mutexguard-sync.stderr @@ -2,7 +2,7 @@ error[E0277]: `std::cell::Cell` cannot be shared between threads safely --> $DIR/mutexguard-sync.rs:11:15 | LL | fn test_sync(_t: T) {} - | ---------------------------- required by `test_sync` + | --------- ---- required by this bound in `test_sync` ... LL | test_sync(guard); | ^^^^^ `std::cell::Cell` cannot be shared between threads safely diff --git a/src/test/ui/namespace/namespace-mix.stderr b/src/test/ui/namespace/namespace-mix.stderr index 249ad1c5844..aa21928aaef 100644 --- a/src/test/ui/namespace/namespace-mix.stderr +++ b/src/test/ui/namespace/namespace-mix.stderr @@ -70,7 +70,7 @@ error[E0277]: the trait bound `c::Item: Impossible` is not satisfied --> $DIR/namespace-mix.rs:33:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(m1::S{}); | ^^^^^^^ the trait `Impossible` is not implemented for `c::Item` @@ -79,7 +79,7 @@ error[E0277]: the trait bound `c::S: Impossible` is not satisfied --> $DIR/namespace-mix.rs:35:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(m2::S{}); | ^^^^^^^ the trait `Impossible` is not implemented for `c::S` @@ -88,7 +88,7 @@ error[E0277]: the trait bound `c::Item: Impossible` is not satisfied --> $DIR/namespace-mix.rs:36:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(m2::S); | ^^^^^ the trait `Impossible` is not implemented for `c::Item` @@ -97,7 +97,7 @@ error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisf --> $DIR/namespace-mix.rs:39:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(xm1::S{}); | ^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` @@ -106,7 +106,7 @@ error[E0277]: the trait bound `namespace_mix::c::S: Impossible` is not satisfied --> $DIR/namespace-mix.rs:41:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(xm2::S{}); | ^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::S` @@ -115,7 +115,7 @@ error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisf --> $DIR/namespace-mix.rs:42:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(xm2::S); | ^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` @@ -124,7 +124,7 @@ error[E0277]: the trait bound `c::Item: Impossible` is not satisfied --> $DIR/namespace-mix.rs:55:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(m3::TS{}); | ^^^^^^^^ the trait `Impossible` is not implemented for `c::Item` @@ -133,7 +133,7 @@ error[E0277]: the trait bound `fn() -> c::TS {c::TS}: Impossible` is not satisfi --> $DIR/namespace-mix.rs:56:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(m3::TS); | ^^^^^^ the trait `Impossible` is not implemented for `fn() -> c::TS {c::TS}` @@ -142,7 +142,7 @@ error[E0277]: the trait bound `c::TS: Impossible` is not satisfied --> $DIR/namespace-mix.rs:57:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(m4::TS{}); | ^^^^^^^^ the trait `Impossible` is not implemented for `c::TS` @@ -151,7 +151,7 @@ error[E0277]: the trait bound `c::Item: Impossible` is not satisfied --> $DIR/namespace-mix.rs:58:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(m4::TS); | ^^^^^^ the trait `Impossible` is not implemented for `c::Item` @@ -160,7 +160,7 @@ error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisf --> $DIR/namespace-mix.rs:61:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(xm3::TS{}); | ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` @@ -169,7 +169,7 @@ error[E0277]: the trait bound `fn() -> namespace_mix::c::TS {namespace_mix::c::T --> $DIR/namespace-mix.rs:62:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(xm3::TS); | ^^^^^^^ the trait `Impossible` is not implemented for `fn() -> namespace_mix::c::TS {namespace_mix::c::TS}` @@ -178,7 +178,7 @@ error[E0277]: the trait bound `namespace_mix::c::TS: Impossible` is not satisfie --> $DIR/namespace-mix.rs:63:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(xm4::TS{}); | ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::TS` @@ -187,7 +187,7 @@ error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisf --> $DIR/namespace-mix.rs:64:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(xm4::TS); | ^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` @@ -196,7 +196,7 @@ error[E0277]: the trait bound `c::Item: Impossible` is not satisfied --> $DIR/namespace-mix.rs:77:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(m5::US{}); | ^^^^^^^^ the trait `Impossible` is not implemented for `c::Item` @@ -205,7 +205,7 @@ error[E0277]: the trait bound `c::US: Impossible` is not satisfied --> $DIR/namespace-mix.rs:78:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(m5::US); | ^^^^^^ the trait `Impossible` is not implemented for `c::US` @@ -214,7 +214,7 @@ error[E0277]: the trait bound `c::US: Impossible` is not satisfied --> $DIR/namespace-mix.rs:79:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(m6::US{}); | ^^^^^^^^ the trait `Impossible` is not implemented for `c::US` @@ -223,7 +223,7 @@ error[E0277]: the trait bound `c::Item: Impossible` is not satisfied --> $DIR/namespace-mix.rs:80:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(m6::US); | ^^^^^^ the trait `Impossible` is not implemented for `c::Item` @@ -232,7 +232,7 @@ error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisf --> $DIR/namespace-mix.rs:83:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(xm5::US{}); | ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` @@ -241,7 +241,7 @@ error[E0277]: the trait bound `namespace_mix::c::US: Impossible` is not satisfie --> $DIR/namespace-mix.rs:84:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(xm5::US); | ^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::US` @@ -250,7 +250,7 @@ error[E0277]: the trait bound `namespace_mix::c::US: Impossible` is not satisfie --> $DIR/namespace-mix.rs:85:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(xm6::US{}); | ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::US` @@ -259,7 +259,7 @@ error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisf --> $DIR/namespace-mix.rs:86:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(xm6::US); | ^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` @@ -268,7 +268,7 @@ error[E0277]: the trait bound `c::Item: Impossible` is not satisfied --> $DIR/namespace-mix.rs:99:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(m7::V{}); | ^^^^^^^ the trait `Impossible` is not implemented for `c::Item` @@ -277,7 +277,7 @@ error[E0277]: the trait bound `c::E: Impossible` is not satisfied --> $DIR/namespace-mix.rs:101:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(m8::V{}); | ^^^^^^^ the trait `Impossible` is not implemented for `c::E` @@ -286,7 +286,7 @@ error[E0277]: the trait bound `c::Item: Impossible` is not satisfied --> $DIR/namespace-mix.rs:102:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(m8::V); | ^^^^^ the trait `Impossible` is not implemented for `c::Item` @@ -295,7 +295,7 @@ error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisf --> $DIR/namespace-mix.rs:105:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(xm7::V{}); | ^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` @@ -304,7 +304,7 @@ error[E0277]: the trait bound `namespace_mix::c::E: Impossible` is not satisfied --> $DIR/namespace-mix.rs:107:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(xm8::V{}); | ^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::E` @@ -313,7 +313,7 @@ error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisf --> $DIR/namespace-mix.rs:108:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(xm8::V); | ^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` @@ -322,7 +322,7 @@ error[E0277]: the trait bound `c::Item: Impossible` is not satisfied --> $DIR/namespace-mix.rs:121:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(m9::TV{}); | ^^^^^^^^ the trait `Impossible` is not implemented for `c::Item` @@ -331,7 +331,7 @@ error[E0277]: the trait bound `fn() -> c::E {c::E::TV}: Impossible` is not satis --> $DIR/namespace-mix.rs:122:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(m9::TV); | ^^^^^^ the trait `Impossible` is not implemented for `fn() -> c::E {c::E::TV}` @@ -340,7 +340,7 @@ error[E0277]: the trait bound `c::E: Impossible` is not satisfied --> $DIR/namespace-mix.rs:123:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(mA::TV{}); | ^^^^^^^^ the trait `Impossible` is not implemented for `c::E` @@ -349,7 +349,7 @@ error[E0277]: the trait bound `c::Item: Impossible` is not satisfied --> $DIR/namespace-mix.rs:124:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(mA::TV); | ^^^^^^ the trait `Impossible` is not implemented for `c::Item` @@ -358,7 +358,7 @@ error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisf --> $DIR/namespace-mix.rs:127:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(xm9::TV{}); | ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` @@ -367,7 +367,7 @@ error[E0277]: the trait bound `fn() -> namespace_mix::c::E {namespace_mix::xm7:: --> $DIR/namespace-mix.rs:128:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(xm9::TV); | ^^^^^^^ the trait `Impossible` is not implemented for `fn() -> namespace_mix::c::E {namespace_mix::xm7::TV}` @@ -376,7 +376,7 @@ error[E0277]: the trait bound `namespace_mix::c::E: Impossible` is not satisfied --> $DIR/namespace-mix.rs:129:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(xmA::TV{}); | ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::E` @@ -385,7 +385,7 @@ error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisf --> $DIR/namespace-mix.rs:130:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(xmA::TV); | ^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` @@ -394,7 +394,7 @@ error[E0277]: the trait bound `c::Item: Impossible` is not satisfied --> $DIR/namespace-mix.rs:143:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(mB::UV{}); | ^^^^^^^^ the trait `Impossible` is not implemented for `c::Item` @@ -403,7 +403,7 @@ error[E0277]: the trait bound `c::E: Impossible` is not satisfied --> $DIR/namespace-mix.rs:144:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(mB::UV); | ^^^^^^ the trait `Impossible` is not implemented for `c::E` @@ -412,7 +412,7 @@ error[E0277]: the trait bound `c::E: Impossible` is not satisfied --> $DIR/namespace-mix.rs:145:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(mC::UV{}); | ^^^^^^^^ the trait `Impossible` is not implemented for `c::E` @@ -421,7 +421,7 @@ error[E0277]: the trait bound `c::Item: Impossible` is not satisfied --> $DIR/namespace-mix.rs:146:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(mC::UV); | ^^^^^^ the trait `Impossible` is not implemented for `c::Item` @@ -430,7 +430,7 @@ error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisf --> $DIR/namespace-mix.rs:149:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(xmB::UV{}); | ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` @@ -439,7 +439,7 @@ error[E0277]: the trait bound `namespace_mix::c::E: Impossible` is not satisfied --> $DIR/namespace-mix.rs:150:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(xmB::UV); | ^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::E` @@ -448,7 +448,7 @@ error[E0277]: the trait bound `namespace_mix::c::E: Impossible` is not satisfied --> $DIR/namespace-mix.rs:151:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(xmC::UV{}); | ^^^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::E` @@ -457,7 +457,7 @@ error[E0277]: the trait bound `namespace_mix::c::Item: Impossible` is not satisf --> $DIR/namespace-mix.rs:152:11 | LL | fn check(_: T) {} - | ----------------------------- required by `check` + | ----- ---------- required by this bound in `check` ... LL | check(xmC::UV); | ^^^^^^^ the trait `Impossible` is not implemented for `namespace_mix::c::Item` diff --git a/src/test/ui/no-send-res-ports.stderr b/src/test/ui/no-send-res-ports.stderr index 515b948cc7e..20f88badbef 100644 --- a/src/test/ui/no-send-res-ports.stderr +++ b/src/test/ui/no-send-res-ports.stderr @@ -3,12 +3,16 @@ error[E0277]: `std::rc::Rc<()>` cannot be sent between threads safely | LL | thread::spawn(move|| { | ^^^^^^^^^^^^^ `std::rc::Rc<()>` cannot be sent between threads safely + | + ::: $SRC_DIR/libstd/thread/mod.rs:LL:COL + | +LL | F: FnOnce() -> T, F: Send + 'static, T: Send + 'static + | ---- required by this bound in `std::thread::spawn` | = help: within `[closure@$DIR/no-send-res-ports.rs:25:19: 29:6 x:main::Foo]`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<()>` = note: required because it appears within the type `Port<()>` = note: required because it appears within the type `main::Foo` = note: required because it appears within the type `[closure@$DIR/no-send-res-ports.rs:25:19: 29:6 x:main::Foo]` - = note: required by `std::thread::spawn` error: aborting due to previous error diff --git a/src/test/ui/no_send-enum.stderr b/src/test/ui/no_send-enum.stderr index d1f3398ff90..8a4b2e9c7a7 100644 --- a/src/test/ui/no_send-enum.stderr +++ b/src/test/ui/no_send-enum.stderr @@ -2,7 +2,7 @@ error[E0277]: `NoSend` cannot be sent between threads safely --> $DIR/no_send-enum.rs:16:5 | LL | fn bar(_: T) {} - | --------------------- required by `bar` + | --- ---- required by this bound in `bar` ... LL | bar(x); | ^^^ `NoSend` cannot be sent between threads safely diff --git a/src/test/ui/no_send-rc.stderr b/src/test/ui/no_send-rc.stderr index de08634e16a..bd646d0509d 100644 --- a/src/test/ui/no_send-rc.stderr +++ b/src/test/ui/no_send-rc.stderr @@ -2,7 +2,7 @@ error[E0277]: `std::rc::Rc<{integer}>` cannot be sent between threads safely --> $DIR/no_send-rc.rs:7:9 | LL | fn bar(_: T) {} - | --------------------- required by `bar` + | --- ---- required by this bound in `bar` ... LL | bar(x); | ^ `std::rc::Rc<{integer}>` cannot be sent between threads safely diff --git a/src/test/ui/no_send-struct.stderr b/src/test/ui/no_send-struct.stderr index 3865971fcfd..4823852c2ff 100644 --- a/src/test/ui/no_send-struct.stderr +++ b/src/test/ui/no_send-struct.stderr @@ -2,7 +2,7 @@ error[E0277]: `Foo` cannot be sent between threads safely --> $DIR/no_send-struct.rs:15:9 | LL | fn bar(_: T) {} - | --------------------- required by `bar` + | --- ---- required by this bound in `bar` ... LL | bar(x); | ^ `Foo` cannot be sent between threads safely diff --git a/src/test/ui/no_share-enum.stderr b/src/test/ui/no_share-enum.stderr index 5a9b7cae0b9..f42228ef6ab 100644 --- a/src/test/ui/no_share-enum.stderr +++ b/src/test/ui/no_share-enum.stderr @@ -2,7 +2,7 @@ error[E0277]: `NoSync` cannot be shared between threads safely --> $DIR/no_share-enum.rs:14:5 | LL | fn bar(_: T) {} - | --------------------- required by `bar` + | --- ---- required by this bound in `bar` ... LL | bar(x); | ^^^ `NoSync` cannot be shared between threads safely diff --git a/src/test/ui/no_share-struct.stderr b/src/test/ui/no_share-struct.stderr index 13de5bd6fe8..620b5427b9a 100644 --- a/src/test/ui/no_share-struct.stderr +++ b/src/test/ui/no_share-struct.stderr @@ -2,7 +2,7 @@ error[E0277]: `Foo` cannot be shared between threads safely --> $DIR/no_share-struct.rs:12:9 | LL | fn bar(_: T) {} - | --------------------- required by `bar` + | --- ---- required by this bound in `bar` ... LL | bar(x); | ^ `Foo` cannot be shared between threads safely diff --git a/src/test/ui/not-panic/not-panic-safe-2.stderr b/src/test/ui/not-panic/not-panic-safe-2.stderr index 5bacf0bbc6b..6668d2d0db1 100644 --- a/src/test/ui/not-panic/not-panic-safe-2.stderr +++ b/src/test/ui/not-panic/not-panic-safe-2.stderr @@ -2,7 +2,7 @@ error[E0277]: the type `std::cell::UnsafeCell` may contain interior mutabil --> $DIR/not-panic-safe-2.rs:10:5 | LL | fn assert() {} - | ----------------------------------- required by `assert` + | ------ ---------- required by this bound in `assert` ... LL | assert::>>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary @@ -15,7 +15,7 @@ error[E0277]: the type `std::cell::UnsafeCell` may contain interior mutab --> $DIR/not-panic-safe-2.rs:10:5 | LL | fn assert() {} - | ----------------------------------- required by `assert` + | ------ ---------- required by this bound in `assert` ... LL | assert::>>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary diff --git a/src/test/ui/not-panic/not-panic-safe-3.stderr b/src/test/ui/not-panic/not-panic-safe-3.stderr index 6d2a450115d..c23b08fc9ed 100644 --- a/src/test/ui/not-panic/not-panic-safe-3.stderr +++ b/src/test/ui/not-panic/not-panic-safe-3.stderr @@ -2,7 +2,7 @@ error[E0277]: the type `std::cell::UnsafeCell` may contain interior mutabil --> $DIR/not-panic-safe-3.rs:10:5 | LL | fn assert() {} - | ----------------------------------- required by `assert` + | ------ ---------- required by this bound in `assert` ... LL | assert::>>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary @@ -15,7 +15,7 @@ error[E0277]: the type `std::cell::UnsafeCell` may contain interior mutab --> $DIR/not-panic-safe-3.rs:10:5 | LL | fn assert() {} - | ----------------------------------- required by `assert` + | ------ ---------- required by this bound in `assert` ... LL | assert::>>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary diff --git a/src/test/ui/not-panic/not-panic-safe-4.stderr b/src/test/ui/not-panic/not-panic-safe-4.stderr index e28f169b72b..916804a834f 100644 --- a/src/test/ui/not-panic/not-panic-safe-4.stderr +++ b/src/test/ui/not-panic/not-panic-safe-4.stderr @@ -2,7 +2,7 @@ error[E0277]: the type `std::cell::UnsafeCell` may contain interior mutabil --> $DIR/not-panic-safe-4.rs:9:5 | LL | fn assert() {} - | ----------------------------------- required by `assert` + | ------ ---------- required by this bound in `assert` ... LL | assert::<&RefCell>(); | ^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary @@ -15,7 +15,7 @@ error[E0277]: the type `std::cell::UnsafeCell` may contain interior mutab --> $DIR/not-panic-safe-4.rs:9:5 | LL | fn assert() {} - | ----------------------------------- required by `assert` + | ------ ---------- required by this bound in `assert` ... LL | assert::<&RefCell>(); | ^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary diff --git a/src/test/ui/not-panic/not-panic-safe-5.stderr b/src/test/ui/not-panic/not-panic-safe-5.stderr index f8c4fe68dde..d5c189723f4 100644 --- a/src/test/ui/not-panic/not-panic-safe-5.stderr +++ b/src/test/ui/not-panic/not-panic-safe-5.stderr @@ -2,7 +2,7 @@ error[E0277]: the type `std::cell::UnsafeCell` may contain interior mutabil --> $DIR/not-panic-safe-5.rs:9:5 | LL | fn assert() {} - | ----------------------------------- required by `assert` + | ------ ---------- required by this bound in `assert` ... LL | assert::<*const UnsafeCell>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary diff --git a/src/test/ui/not-panic/not-panic-safe-6.stderr b/src/test/ui/not-panic/not-panic-safe-6.stderr index 2cd78059072..c8013a836a1 100644 --- a/src/test/ui/not-panic/not-panic-safe-6.stderr +++ b/src/test/ui/not-panic/not-panic-safe-6.stderr @@ -2,7 +2,7 @@ error[E0277]: the type `std::cell::UnsafeCell` may contain interior mutabil --> $DIR/not-panic-safe-6.rs:9:5 | LL | fn assert() {} - | ----------------------------------- required by `assert` + | ------ ---------- required by this bound in `assert` ... LL | assert::<*mut RefCell>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary @@ -15,7 +15,7 @@ error[E0277]: the type `std::cell::UnsafeCell` may contain interior mutab --> $DIR/not-panic-safe-6.rs:9:5 | LL | fn assert() {} - | ----------------------------------- required by `assert` + | ------ ---------- required by this bound in `assert` ... LL | assert::<*mut RefCell>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell` may contain interior mutability and a reference may not be safely transferrable across a catch_unwind boundary diff --git a/src/test/ui/not-panic/not-panic-safe.stderr b/src/test/ui/not-panic/not-panic-safe.stderr index 315ea17971a..aa18b923044 100644 --- a/src/test/ui/not-panic/not-panic-safe.stderr +++ b/src/test/ui/not-panic/not-panic-safe.stderr @@ -2,7 +2,7 @@ error[E0277]: the type `&mut i32` may not be safely transferred across an unwind --> $DIR/not-panic-safe.rs:9:5 | LL | fn assert() {} - | ----------------------------------- required by `assert` + | ------ ---------- required by this bound in `assert` ... LL | assert::<&mut i32>(); | ^^^^^^^^^^^^^^^^^^ `&mut i32` may not be safely transferred across an unwind boundary diff --git a/src/test/ui/not-sync.stderr b/src/test/ui/not-sync.stderr index 57f1122be2b..8871abedd00 100644 --- a/src/test/ui/not-sync.stderr +++ b/src/test/ui/not-sync.stderr @@ -2,7 +2,7 @@ error[E0277]: `std::cell::Cell` cannot be shared between threads safely --> $DIR/not-sync.rs:8:5 | LL | fn test() {} - | ------------------ required by `test` + | ---- ---- required by this bound in `test` ... LL | test::>(); | ^^^^^^^^^^^^^^^^^ `std::cell::Cell` cannot be shared between threads safely @@ -13,7 +13,7 @@ error[E0277]: `std::cell::RefCell` cannot be shared between threads safely --> $DIR/not-sync.rs:10:5 | LL | fn test() {} - | ------------------ required by `test` + | ---- ---- required by this bound in `test` ... LL | test::>(); | ^^^^^^^^^^^^^^^^^^^^ `std::cell::RefCell` cannot be shared between threads safely @@ -24,7 +24,7 @@ error[E0277]: `std::rc::Rc` cannot be shared between threads safely --> $DIR/not-sync.rs:13:5 | LL | fn test() {} - | ------------------ required by `test` + | ---- ---- required by this bound in `test` ... LL | test::>(); | ^^^^^^^^^^^^^^^ `std::rc::Rc` cannot be shared between threads safely @@ -35,7 +35,7 @@ error[E0277]: `std::rc::Weak` cannot be shared between threads safely --> $DIR/not-sync.rs:15:5 | LL | fn test() {} - | ------------------ required by `test` + | ---- ---- required by this bound in `test` ... LL | test::>(); | ^^^^^^^^^^^^^^^^^ `std::rc::Weak` cannot be shared between threads safely @@ -46,7 +46,7 @@ error[E0277]: `std::sync::mpsc::Receiver` cannot be shared between threads --> $DIR/not-sync.rs:18:5 | LL | fn test() {} - | ------------------ required by `test` + | ---- ---- required by this bound in `test` ... LL | test::>(); | ^^^^^^^^^^^^^^^^^^^^^ `std::sync::mpsc::Receiver` cannot be shared between threads safely @@ -57,7 +57,7 @@ error[E0277]: `std::sync::mpsc::Sender` cannot be shared between threads sa --> $DIR/not-sync.rs:20:5 | LL | fn test() {} - | ------------------ required by `test` + | ---- ---- required by this bound in `test` ... LL | test::>(); | ^^^^^^^^^^^^^^^^^^^ `std::sync::mpsc::Sender` cannot be shared between threads safely diff --git a/src/test/ui/object-does-not-impl-trait.stderr b/src/test/ui/object-does-not-impl-trait.stderr index 83ca9a7212b..7ac199d0943 100644 --- a/src/test/ui/object-does-not-impl-trait.stderr +++ b/src/test/ui/object-does-not-impl-trait.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `std::boxed::Box: Foo` is not satisfied --> $DIR/object-does-not-impl-trait.rs:6:44 | LL | fn take_foo(f: F) {} - | ------------------------ required by `take_foo` + | -------- --- required by this bound in `take_foo` LL | fn take_object(f: Box) { take_foo(f); } | ^ the trait `Foo` is not implemented for `std::boxed::Box` diff --git a/src/test/ui/on-unimplemented/on-trait.stderr b/src/test/ui/on-unimplemented/on-trait.stderr index 992f53b1da6..8fe7ed4a204 100644 --- a/src/test/ui/on-unimplemented/on-trait.stderr +++ b/src/test/ui/on-unimplemented/on-trait.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `std::option::Option>: MyFromIte --> $DIR/on-trait.rs:28:30 | LL | fn collect, B: MyFromIterator>(it: I) -> B { - | -------------------------------------------------------------------- required by `collect` + | ------- ----------------- required by this bound in `collect` ... LL | let y: Option> = collect(x.iter()); // this should give approximately the same error for x.iter().collect() | ^^^^^^^ a collection of type `std::option::Option>` cannot be built from an iterator over elements of type `&u8` @@ -13,7 +13,7 @@ error[E0277]: the trait bound `std::string::String: Bar::Foo` is not --> $DIR/on-trait.rs:31:21 | LL | fn foobar>() -> T { - | ---------------------------------------------- required by `foobar` + | ------ --------------- required by this bound in `foobar` ... LL | let x: String = foobar(); | ^^^^^^ test error `std::string::String` with `u8` `_` `u32` in `Bar::Foo` diff --git a/src/test/ui/overlap-marker-trait.stderr b/src/test/ui/overlap-marker-trait.stderr index a66e3990e8b..daf4e5e69a2 100644 --- a/src/test/ui/overlap-marker-trait.stderr +++ b/src/test/ui/overlap-marker-trait.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `NotDebugOrDisplay: Marker` is not satisfied --> $DIR/overlap-marker-trait.rs:30:5 | LL | fn is_marker() { } - | ------------------------- required by `is_marker` + | --------- ------ required by this bound in `is_marker` ... LL | is_marker::(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Marker` is not implemented for `NotDebugOrDisplay` diff --git a/src/test/ui/phantom-oibit.stderr b/src/test/ui/phantom-oibit.stderr index c1b60e0823f..ac48ee0cb0f 100644 --- a/src/test/ui/phantom-oibit.stderr +++ b/src/test/ui/phantom-oibit.stderr @@ -2,7 +2,7 @@ error[E0277]: `T` cannot be shared between threads safely --> $DIR/phantom-oibit.rs:21:12 | LL | fn is_zen(_: T) {} - | ----------------------- required by `is_zen` + | ------ --- required by this bound in `is_zen` ... LL | is_zen(x) | ^ `T` cannot be shared between threads safely @@ -17,7 +17,7 @@ error[E0277]: `T` cannot be shared between threads safely --> $DIR/phantom-oibit.rs:26:12 | LL | fn is_zen(_: T) {} - | ----------------------- required by `is_zen` + | ------ --- required by this bound in `is_zen` ... LL | is_zen(x) | ^ `T` cannot be shared between threads safely diff --git a/src/test/ui/regions/regions-close-object-into-object-5.stderr b/src/test/ui/regions/regions-close-object-into-object-5.stderr index 390f8e7baa3..01975d40fdf 100644 --- a/src/test/ui/regions/regions-close-object-into-object-5.stderr +++ b/src/test/ui/regions/regions-close-object-into-object-5.stderr @@ -52,26 +52,26 @@ LL | // oh dear! LL | box B(&*v) as Box | ^^^^^^ | -note: ...so that the reference type `&dyn A` does not outlive the data it points at +note: ...so that the type `T` will meet its required lifetime bounds --> $DIR/regions-close-object-into-object-5.rs:17:9 | LL | box B(&*v) as Box | ^^^^^^ error[E0310]: the parameter type `T` may not live long enough - --> $DIR/regions-close-object-into-object-5.rs:17:9 + --> $DIR/regions-close-object-into-object-5.rs:17:11 | LL | fn f<'a, T, U>(v: Box+'static>) -> Box { | - help: consider adding an explicit lifetime bound `T: 'static`... LL | // oh dear! LL | box B(&*v) as Box - | ^^^^^^ + | ^^^ | -note: ...so that the type `T` will meet its required lifetime bounds - --> $DIR/regions-close-object-into-object-5.rs:17:9 +note: ...so that the reference type `&dyn A` does not outlive the data it points at + --> $DIR/regions-close-object-into-object-5.rs:17:11 | LL | box B(&*v) as Box - | ^^^^^^ + | ^^^ error[E0310]: the parameter type `T` may not live long enough --> $DIR/regions-close-object-into-object-5.rs:17:11 diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr b/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr index f253b67a019..983063d1971 100644 --- a/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr +++ b/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr @@ -5,9 +5,13 @@ LL | / fn can_parse_zero_as_f32() -> Result { LL | | "0".parse() LL | | } | |_^ `main` can only return types that implement `std::process::Termination` + | + ::: $SRC_DIR/libtest/lib.rs:LL:COL + | +LL | pub fn assert_test_result(result: T) { + | ----------- required by this bound in `test::assert_test_result` | = help: the trait `std::process::Termination` is not implemented for `std::result::Result` - = note: required by `test::assert_test_result` error: aborting due to previous error diff --git a/src/test/ui/str/str-mut-idx.stderr b/src/test/ui/str/str-mut-idx.stderr index 372077a465e..3c957970e51 100644 --- a/src/test/ui/str/str-mut-idx.stderr +++ b/src/test/ui/str/str-mut-idx.stderr @@ -2,7 +2,7 @@ error[E0277]: the size for values of type `str` cannot be known at compilation t --> $DIR/str-mut-idx.rs:4:15 | LL | fn bot() -> T { loop {} } - | ---------------- required by `bot` + | --- - required by this bound in `bot` ... LL | s[1..2] = bot(); | ^^^ doesn't have a size known at compile-time diff --git a/src/test/ui/substs-ppaux.normal.stderr b/src/test/ui/substs-ppaux.normal.stderr index 4a8c99cdef3..cb55203c88e 100644 --- a/src/test/ui/substs-ppaux.normal.stderr +++ b/src/test/ui/substs-ppaux.normal.stderr @@ -62,7 +62,7 @@ error[E0277]: the size for values of type `str` cannot be known at compilation t --> $DIR/substs-ppaux.rs:49:5 | LL | fn bar<'a, T>() where T: 'a {} - | --------------------------- required by `Foo::bar` + | --- -- required by this bound in `Foo::bar` ... LL | >::bar; | ^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time diff --git a/src/test/ui/substs-ppaux.verbose.stderr b/src/test/ui/substs-ppaux.verbose.stderr index 3314eb60cde..cafcba97b92 100644 --- a/src/test/ui/substs-ppaux.verbose.stderr +++ b/src/test/ui/substs-ppaux.verbose.stderr @@ -62,7 +62,7 @@ error[E0277]: the size for values of type `str` cannot be known at compilation t --> $DIR/substs-ppaux.rs:49:5 | LL | fn bar<'a, T>() where T: 'a {} - | --------------------------- required by `Foo::bar` + | --- -- required by this bound in `Foo::bar` ... LL | >::bar; | ^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time diff --git a/src/test/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr b/src/test/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr index 6bb65338996..1cc704b4433 100644 --- a/src/test/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr +++ b/src/test/ui/suggestions/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `fn() -> impl std::future::Future {foo}: std::futu --> $DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:9:9 | LL | fn bar(f: impl Future) {} - | --------------------------------- required by `bar` + | --- ----------------- required by this bound in `bar` ... LL | bar(foo); | ^^^ diff --git a/src/test/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr b/src/test/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr index 59726c82c23..7a49031bde7 100644 --- a/src/test/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr +++ b/src/test/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `fn() -> impl T {foo}: T` is not satisfied --> $DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:17:9 | LL | fn bar(f: impl T) {} - | ----------------------- required by `bar` + | --- ------- required by this bound in `bar` ... LL | bar(foo); | ^^^ diff --git a/src/test/ui/suggestions/into-str.stderr b/src/test/ui/suggestions/into-str.stderr index da5aeb63b90..fb3e1096ad5 100644 --- a/src/test/ui/suggestions/into-str.stderr +++ b/src/test/ui/suggestions/into-str.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `&str: std::convert::From` is --> $DIR/into-str.rs:4:5 | LL | fn foo<'a, T>(_t: T) where T: Into<&'a str> {} - | ------------------------------------------- required by `foo` + | --- ------------- required by this bound in `foo` ... LL | foo(String::new()); | ^^^ the trait `std::convert::From` is not implemented for `&str` diff --git a/src/test/ui/traits/trait-alias/trait-alias-cross-crate.stderr b/src/test/ui/traits/trait-alias/trait-alias-cross-crate.stderr index 8403b2ebaca..10a9506bd06 100644 --- a/src/test/ui/traits/trait-alias/trait-alias-cross-crate.stderr +++ b/src/test/ui/traits/trait-alias/trait-alias-cross-crate.stderr @@ -2,7 +2,7 @@ error[E0277]: `std::rc::Rc` cannot be sent between threads safely --> $DIR/trait-alias-cross-crate.rs:14:5 | LL | fn use_alias() {} - | --------------------------- required by `use_alias` + | --------- -------- required by this bound in `use_alias` ... LL | use_alias::>(); | ^^^^^^^^^^^^^^^^^^^^ `std::rc::Rc` cannot be sent between threads safely @@ -13,7 +13,7 @@ error[E0277]: `std::rc::Rc` cannot be shared between threads safely --> $DIR/trait-alias-cross-crate.rs:14:5 | LL | fn use_alias() {} - | --------------------------- required by `use_alias` + | --------- -------- required by this bound in `use_alias` ... LL | use_alias::>(); | ^^^^^^^^^^^^^^^^^^^^ `std::rc::Rc` cannot be shared between threads safely diff --git a/src/test/ui/traits/trait-suggest-where-clause.stderr b/src/test/ui/traits/trait-suggest-where-clause.stderr index f88dae37e48..0aa5f429334 100644 --- a/src/test/ui/traits/trait-suggest-where-clause.stderr +++ b/src/test/ui/traits/trait-suggest-where-clause.stderr @@ -3,23 +3,31 @@ error[E0277]: the size for values of type `U` cannot be known at compilation tim | LL | mem::size_of::(); | ^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + ::: $SRC_DIR/libcore/mem/mod.rs:LL:COL + | +LL | pub const fn size_of() -> usize { + | - required by this bound in `std::mem::size_of` | = help: the trait `std::marker::Sized` is not implemented for `U` = note: to learn more, visit = help: consider adding a `where U: std::marker::Sized` bound - = note: required by `std::mem::size_of` error[E0277]: the size for values of type `U` cannot be known at compilation time --> $DIR/trait-suggest-where-clause.rs:10:5 | LL | mem::size_of::>(); | ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + ::: $SRC_DIR/libcore/mem/mod.rs:LL:COL + | +LL | pub const fn size_of() -> usize { + | - required by this bound in `std::mem::size_of` | = help: within `Misc`, the trait `std::marker::Sized` is not implemented for `U` = note: to learn more, visit = help: consider adding a `where U: std::marker::Sized` bound = note: required because it appears within the type `Misc` - = note: required by `std::mem::size_of` error[E0277]: the trait bound `u64: std::convert::From` is not satisfied --> $DIR/trait-suggest-where-clause.rs:15:5 @@ -52,20 +60,28 @@ error[E0277]: the size for values of type `[T]` cannot be known at compilation t | LL | mem::size_of::<[T]>(); | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + ::: $SRC_DIR/libcore/mem/mod.rs:LL:COL + | +LL | pub const fn size_of() -> usize { + | - required by this bound in `std::mem::size_of` | = help: the trait `std::marker::Sized` is not implemented for `[T]` = note: to learn more, visit - = note: required by `std::mem::size_of` error[E0277]: the size for values of type `[&U]` cannot be known at compilation time --> $DIR/trait-suggest-where-clause.rs:31:5 | LL | mem::size_of::<[&U]>(); | ^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | + ::: $SRC_DIR/libcore/mem/mod.rs:LL:COL + | +LL | pub const fn size_of() -> usize { + | - required by this bound in `std::mem::size_of` | = help: the trait `std::marker::Sized` is not implemented for `[&U]` = note: to learn more, visit - = note: required by `std::mem::size_of` error: aborting due to 7 previous errors diff --git a/src/test/ui/traits/traits-inductive-overflow-simultaneous.stderr b/src/test/ui/traits/traits-inductive-overflow-simultaneous.stderr index b29d726fbba..6fd6a37b22d 100644 --- a/src/test/ui/traits/traits-inductive-overflow-simultaneous.stderr +++ b/src/test/ui/traits/traits-inductive-overflow-simultaneous.stderr @@ -2,7 +2,7 @@ error[E0275]: overflow evaluating the requirement `{integer}: Tweedledum` --> $DIR/traits-inductive-overflow-simultaneous.rs:18:5 | LL | fn is_ee(t: T) { - | ------------------------ required by `is_ee` + | ----- ----- required by this bound in `is_ee` ... LL | is_ee(4); | ^^^^^ diff --git a/src/test/ui/traits/traits-inductive-overflow-supertrait-oibit.stderr b/src/test/ui/traits/traits-inductive-overflow-supertrait-oibit.stderr index 76d486a51e5..40c2c2e4c9d 100644 --- a/src/test/ui/traits/traits-inductive-overflow-supertrait-oibit.stderr +++ b/src/test/ui/traits/traits-inductive-overflow-supertrait-oibit.stderr @@ -8,7 +8,7 @@ error[E0277]: the trait bound `NoClone: std::marker::Copy` is not satisfied --> $DIR/traits-inductive-overflow-supertrait-oibit.rs:15:23 | LL | fn copy(x: T) -> (T, T) { (x, x) } - | --------------------------------- required by `copy` + | ---- ----- required by this bound in `copy` ... LL | let (a, b) = copy(NoClone); | ^^^^^^^ the trait `std::marker::Copy` is not implemented for `NoClone` diff --git a/src/test/ui/traits/traits-inductive-overflow-supertrait.stderr b/src/test/ui/traits/traits-inductive-overflow-supertrait.stderr index 92747be7d2c..96a9343d4eb 100644 --- a/src/test/ui/traits/traits-inductive-overflow-supertrait.stderr +++ b/src/test/ui/traits/traits-inductive-overflow-supertrait.stderr @@ -2,7 +2,7 @@ error[E0275]: overflow evaluating the requirement `NoClone: Magic` --> $DIR/traits-inductive-overflow-supertrait.rs:13:18 | LL | fn copy(x: T) -> (T, T) { (x, x) } - | --------------------------------- required by `copy` + | ---- ----- required by this bound in `copy` ... LL | let (a, b) = copy(NoClone); | ^^^^ diff --git a/src/test/ui/traits/traits-inductive-overflow-two-traits.stderr b/src/test/ui/traits/traits-inductive-overflow-two-traits.stderr index 58d7fcd56c7..447fc564348 100644 --- a/src/test/ui/traits/traits-inductive-overflow-two-traits.stderr +++ b/src/test/ui/traits/traits-inductive-overflow-two-traits.stderr @@ -2,7 +2,7 @@ error[E0275]: overflow evaluating the requirement `*mut (): Magic` --> $DIR/traits-inductive-overflow-two-traits.rs:19:5 | LL | fn wizard() { check::<::X>(); } - | --------------------- required by `wizard` + | ------ ----- required by this bound in `wizard` ... LL | wizard::<*mut ()>(); | ^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/traits/traits-negative-impls.stderr b/src/test/ui/traits/traits-negative-impls.stderr index 022b12d256c..22b6d2a0c4e 100644 --- a/src/test/ui/traits/traits-negative-impls.stderr +++ b/src/test/ui/traits/traits-negative-impls.stderr @@ -24,7 +24,7 @@ error[E0277]: `dummy1b::TestType` cannot be sent between threads safely --> $DIR/traits-negative-impls.rs:32:13 | LL | fn is_send(_: T) {} - | ------------------------- required by `is_send` + | ------- ---- required by this bound in `is_send` ... LL | is_send(TestType); | ^^^^^^^^ `dummy1b::TestType` cannot be sent between threads safely @@ -35,7 +35,7 @@ error[E0277]: `dummy1c::TestType` cannot be sent between threads safely --> $DIR/traits-negative-impls.rs:40:13 | LL | fn is_send(_: T) {} - | ------------------------- required by `is_send` + | ------- ---- required by this bound in `is_send` ... LL | is_send((8, TestType)); | ^^^^^^^^^^^^^ `dummy1c::TestType` cannot be sent between threads safely @@ -47,7 +47,7 @@ error[E0277]: `dummy2::TestType` cannot be sent between threads safely --> $DIR/traits-negative-impls.rs:48:13 | LL | fn is_send(_: T) {} - | ------------------------- required by `is_send` + | ------- ---- required by this bound in `is_send` ... LL | is_send(Box::new(TestType)); | ^^^^^^^^^^^^^^^^^^ `dummy2::TestType` cannot be sent between threads safely @@ -60,7 +60,7 @@ error[E0277]: `dummy3::TestType` cannot be sent between threads safely --> $DIR/traits-negative-impls.rs:56:13 | LL | fn is_send(_: T) {} - | ------------------------- required by `is_send` + | ------- ---- required by this bound in `is_send` ... LL | is_send(Box::new(Outer2(TestType))); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ `dummy3::TestType` cannot be sent between threads safely @@ -74,7 +74,7 @@ error[E0277]: `main::TestType` cannot be sent between threads safely --> $DIR/traits-negative-impls.rs:66:13 | LL | fn is_sync(_: T) {} - | ------------------------- required by `is_sync` + | ------- ---- required by this bound in `is_sync` ... LL | is_sync(Outer2(TestType)); | ^^^^^^^^^^^^^^^^ `main::TestType` cannot be sent between threads safely diff --git a/src/test/ui/trivial-bounds/trivial-bounds-leak.stderr b/src/test/ui/trivial-bounds/trivial-bounds-leak.stderr index 49393a8678e..acf309ac608 100644 --- a/src/test/ui/trivial-bounds/trivial-bounds-leak.stderr +++ b/src/test/ui/trivial-bounds/trivial-bounds-leak.stderr @@ -34,7 +34,7 @@ LL | generic_function(5i32); | ^^^^ the trait `Foo` is not implemented for `i32` ... LL | fn generic_function(t: T) {} - | --------------------------------- required by `generic_function` + | ---------------- --- required by this bound in `generic_function` error: aborting due to 4 previous errors diff --git a/src/test/ui/try-operator-on-main.stderr b/src/test/ui/try-operator-on-main.stderr index 6878cd80629..de75d3e313d 100644 --- a/src/test/ui/try-operator-on-main.stderr +++ b/src/test/ui/try-operator-on-main.stderr @@ -23,7 +23,7 @@ LL | try_trait_generic::<()>(); | ^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::ops::Try` is not implemented for `()` ... LL | fn try_trait_generic() -> T { - | ----------------------------------- required by `try_trait_generic` + | ----------------- --- required by this bound in `try_trait_generic` error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try` --> $DIR/try-operator-on-main.rs:22:5 diff --git a/src/test/ui/type/type-annotation-needed.rs b/src/test/ui/type/type-annotation-needed.rs index ff2342c4455..ddf16f76995 100644 --- a/src/test/ui/type/type-annotation-needed.rs +++ b/src/test/ui/type/type-annotation-needed.rs @@ -1,5 +1,6 @@ fn foo>(x: i32) {} //~^ NOTE required by +//~| NOTE fn main() { foo(42); diff --git a/src/test/ui/type/type-annotation-needed.stderr b/src/test/ui/type/type-annotation-needed.stderr index 1dd2aafeb62..01287b727d2 100644 --- a/src/test/ui/type/type-annotation-needed.stderr +++ b/src/test/ui/type/type-annotation-needed.stderr @@ -1,8 +1,8 @@ error[E0283]: type annotations required: cannot resolve `_: std::convert::Into` - --> $DIR/type-annotation-needed.rs:5:5 + --> $DIR/type-annotation-needed.rs:6:5 | LL | fn foo>(x: i32) {} - | ------------------------------- required by `foo` + | --- ------------ required by this bound in `foo` ... LL | foo(42); | ^^^ diff --git a/src/test/ui/typeck/typeck-default-trait-impl-assoc-type.stderr b/src/test/ui/typeck/typeck-default-trait-impl-assoc-type.stderr index 7fb3731be23..b842d0ae1a2 100644 --- a/src/test/ui/typeck/typeck-default-trait-impl-assoc-type.stderr +++ b/src/test/ui/typeck/typeck-default-trait-impl-assoc-type.stderr @@ -5,7 +5,7 @@ LL | is_send::(); | ^^^^^^^^^^^^^^^^^^^^^^^ `::AssocType` cannot be sent between threads safely ... LL | fn is_send() { - | -------------------- required by `is_send` + | ------- ---- required by this bound in `is_send` | = help: the trait `std::marker::Send` is not implemented for `::AssocType` = help: consider adding a `where ::AssocType: std::marker::Send` bound diff --git a/src/test/ui/typeck/typeck-default-trait-impl-constituent-types-2.stderr b/src/test/ui/typeck/typeck-default-trait-impl-constituent-types-2.stderr index 8389356fdd6..f060afea24e 100644 --- a/src/test/ui/typeck/typeck-default-trait-impl-constituent-types-2.stderr +++ b/src/test/ui/typeck/typeck-default-trait-impl-constituent-types-2.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `MyS2: MyTrait` is not satisfied in `(MyS2, MyS)` --> $DIR/typeck-default-trait-impl-constituent-types-2.rs:16:5 | LL | fn is_mytrait() {} - | --------------------------- required by `is_mytrait` + | ---------- ------- required by this bound in `is_mytrait` ... LL | is_mytrait::<(MyS2, MyS)>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^ within `(MyS2, MyS)`, the trait `MyTrait` is not implemented for `MyS2` diff --git a/src/test/ui/typeck/typeck-default-trait-impl-constituent-types.stderr b/src/test/ui/typeck/typeck-default-trait-impl-constituent-types.stderr index eee186feea6..e5d275083df 100644 --- a/src/test/ui/typeck/typeck-default-trait-impl-constituent-types.stderr +++ b/src/test/ui/typeck/typeck-default-trait-impl-constituent-types.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `MyS2: MyTrait` is not satisfied --> $DIR/typeck-default-trait-impl-constituent-types.rs:20:5 | LL | fn is_mytrait() {} - | --------------------------- required by `is_mytrait` + | ---------- ------- required by this bound in `is_mytrait` ... LL | is_mytrait::(); | ^^^^^^^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `MyS2` diff --git a/src/test/ui/typeck/typeck-default-trait-impl-negation-send.stderr b/src/test/ui/typeck/typeck-default-trait-impl-negation-send.stderr index 1e6adeb4309..2f5be975c6d 100644 --- a/src/test/ui/typeck/typeck-default-trait-impl-negation-send.stderr +++ b/src/test/ui/typeck/typeck-default-trait-impl-negation-send.stderr @@ -2,7 +2,7 @@ error[E0277]: `MyNotSendable` cannot be sent between threads safely --> $DIR/typeck-default-trait-impl-negation-send.rs:19:5 | LL | fn is_send() {} - | --------------------- required by `is_send` + | ------- ---- required by this bound in `is_send` ... LL | is_send::(); | ^^^^^^^^^^^^^^^^^^^^^^^^ `MyNotSendable` cannot be sent between threads safely diff --git a/src/test/ui/typeck/typeck-default-trait-impl-negation-sync.stderr b/src/test/ui/typeck/typeck-default-trait-impl-negation-sync.stderr index d4f8f5ad82c..77e04a75a25 100644 --- a/src/test/ui/typeck/typeck-default-trait-impl-negation-sync.stderr +++ b/src/test/ui/typeck/typeck-default-trait-impl-negation-sync.stderr @@ -2,7 +2,7 @@ error[E0277]: `MyNotSync` cannot be shared between threads safely --> $DIR/typeck-default-trait-impl-negation-sync.rs:33:5 | LL | fn is_sync() {} - | --------------------- required by `is_sync` + | ------- ---- required by this bound in `is_sync` ... LL | is_sync::(); | ^^^^^^^^^^^^^^^^^^^^ `MyNotSync` cannot be shared between threads safely @@ -13,7 +13,7 @@ error[E0277]: `std::cell::UnsafeCell` cannot be shared between threads safel --> $DIR/typeck-default-trait-impl-negation-sync.rs:36:5 | LL | fn is_sync() {} - | --------------------- required by `is_sync` + | ------- ---- required by this bound in `is_sync` ... LL | is_sync::(); | ^^^^^^^^^^^^^^^^^^^^^^^^ `std::cell::UnsafeCell` cannot be shared between threads safely @@ -25,7 +25,7 @@ error[E0277]: `Managed` cannot be shared between threads safely --> $DIR/typeck-default-trait-impl-negation-sync.rs:39:5 | LL | fn is_sync() {} - | --------------------- required by `is_sync` + | ------- ---- required by this bound in `is_sync` ... LL | is_sync::(); | ^^^^^^^^^^^^^^^^^^^^^^^^ `Managed` cannot be shared between threads safely diff --git a/src/test/ui/typeck/typeck-default-trait-impl-negation.stderr b/src/test/ui/typeck/typeck-default-trait-impl-negation.stderr index e993098b2de..09c05825190 100644 --- a/src/test/ui/typeck/typeck-default-trait-impl-negation.stderr +++ b/src/test/ui/typeck/typeck-default-trait-impl-negation.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `ThisImplsUnsafeTrait: MyTrait` is not satisfied --> $DIR/typeck-default-trait-impl-negation.rs:21:5 | LL | fn is_my_trait() {} - | ---------------------------- required by `is_my_trait` + | ----------- ------- required by this bound in `is_my_trait` ... LL | is_my_trait::(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `ThisImplsUnsafeTrait` @@ -14,7 +14,7 @@ error[E0277]: the trait bound `ThisImplsTrait: MyUnsafeTrait` is not satisfied --> $DIR/typeck-default-trait-impl-negation.rs:24:5 | LL | fn is_my_unsafe_trait() {} - | ----------------------------------------- required by `is_my_unsafe_trait` + | ------------------ ------------- required by this bound in `is_my_unsafe_trait` ... LL | is_my_unsafe_trait::(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `MyUnsafeTrait` is not implemented for `ThisImplsTrait` diff --git a/src/test/ui/typeck/typeck-default-trait-impl-precedence.stderr b/src/test/ui/typeck/typeck-default-trait-impl-precedence.stderr index d87a6384e5c..15877304418 100644 --- a/src/test/ui/typeck/typeck-default-trait-impl-precedence.stderr +++ b/src/test/ui/typeck/typeck-default-trait-impl-precedence.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `u32: Signed` is not satisfied --> $DIR/typeck-default-trait-impl-precedence.rs:18:5 | LL | fn is_defaulted() { } - | ------------------------------ required by `is_defaulted` + | ------------ --------- required by this bound in `is_defaulted` ... LL | is_defaulted::<&'static u32>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Signed` is not implemented for `u32` diff --git a/src/test/ui/typeck/typeck-default-trait-impl-send-param.stderr b/src/test/ui/typeck/typeck-default-trait-impl-send-param.stderr index 5f3a5bc6e00..46731c0fbb0 100644 --- a/src/test/ui/typeck/typeck-default-trait-impl-send-param.stderr +++ b/src/test/ui/typeck/typeck-default-trait-impl-send-param.stderr @@ -5,7 +5,7 @@ LL | is_send::() | ^^^^^^^^^^^^ `T` cannot be sent between threads safely ... LL | fn is_send() { - | -------------------- required by `is_send` + | ------- ---- required by this bound in `is_send` | = help: the trait `std::marker::Send` is not implemented for `T` = help: consider adding a `where T: std::marker::Send` bound diff --git a/src/test/ui/typeck/typeck-unsafe-always-share.stderr b/src/test/ui/typeck/typeck-unsafe-always-share.stderr index 8b3032b088d..d08613238f8 100644 --- a/src/test/ui/typeck/typeck-unsafe-always-share.stderr +++ b/src/test/ui/typeck/typeck-unsafe-always-share.stderr @@ -2,7 +2,7 @@ error[E0277]: `std::cell::UnsafeCell>` cannot be shared betwee --> $DIR/typeck-unsafe-always-share.rs:19:10 | LL | fn test(s: T) {} - | ---------------------- required by `test` + | ---- ---- required by this bound in `test` ... LL | test(us); | ^^ `std::cell::UnsafeCell>` cannot be shared between threads safely @@ -13,7 +13,7 @@ error[E0277]: `std::cell::UnsafeCell` cannot be shared between threads s --> $DIR/typeck-unsafe-always-share.rs:23:10 | LL | fn test(s: T) {} - | ---------------------- required by `test` + | ---- ---- required by this bound in `test` ... LL | test(uns); | ^^^ `std::cell::UnsafeCell` cannot be shared between threads safely @@ -24,7 +24,7 @@ error[E0277]: `std::cell::UnsafeCell` cannot be shared between threads s --> $DIR/typeck-unsafe-always-share.rs:27:5 | LL | fn test(s: T) {} - | ---------------------- required by `test` + | ---- ---- required by this bound in `test` ... LL | test(ms); | ^^^^ `std::cell::UnsafeCell` cannot be shared between threads safely @@ -36,7 +36,7 @@ error[E0277]: `NoSync` cannot be shared between threads safely --> $DIR/typeck-unsafe-always-share.rs:30:10 | LL | fn test(s: T) {} - | ---------------------- required by `test` + | ---- ---- required by this bound in `test` ... LL | test(NoSync); | ^^^^^^ `NoSync` cannot be shared between threads safely diff --git a/src/test/ui/unboxed-closures/unboxed-closure-sugar-default.stderr b/src/test/ui/unboxed-closures/unboxed-closure-sugar-default.stderr index dd024b76c3b..6ec40638289 100644 --- a/src/test/ui/unboxed-closures/unboxed-closure-sugar-default.stderr +++ b/src/test/ui/unboxed-closures/unboxed-closure-sugar-default.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `dyn Foo<(isize,), isize, Output = ()>: Eq $DIR/unboxed-closure-sugar-default.rs:21:5 | LL | fn eq() where A : Eq { } - | -------------------------------------------- required by `eq` + | -- ----- required by this bound in `eq` ... LL | eq::, dyn Foo(isize)>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Eq>` is not implemented for `dyn Foo<(isize,), isize, Output = ()>` diff --git a/src/test/ui/unboxed-closures/unboxed-closure-sugar-equiv.stderr b/src/test/ui/unboxed-closures/unboxed-closure-sugar-equiv.stderr index 83754bd36ef..8dd32ee7f10 100644 --- a/src/test/ui/unboxed-closures/unboxed-closure-sugar-equiv.stderr +++ b/src/test/ui/unboxed-closures/unboxed-closure-sugar-equiv.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `dyn Foo<(char,), Output = ()>: Eq $DIR/unboxed-closure-sugar-equiv.rs:43:5 | LL | fn eq>() { } - | ----------------------------------- required by `eq` + | -- ----- required by this bound in `eq` ... LL | / eq::< dyn Foo<(),Output=()>, LL | | dyn Foo(char) >(); diff --git a/src/test/ui/unboxed-closures/unboxed-closures-fnmut-as-fn.stderr b/src/test/ui/unboxed-closures/unboxed-closures-fnmut-as-fn.stderr index d03397e4244..dc766181531 100644 --- a/src/test/ui/unboxed-closures/unboxed-closures-fnmut-as-fn.stderr +++ b/src/test/ui/unboxed-closures/unboxed-closures-fnmut-as-fn.stderr @@ -2,7 +2,7 @@ error[E0277]: expected a `std::ops::Fn<(isize,)>` closure, found `S` --> $DIR/unboxed-closures-fnmut-as-fn.rs:28:21 | LL | fn call_itisize>(f: &F, x: isize) -> isize { - | -------------------------------------------------------- required by `call_it` + | ------- ---------------- required by this bound in `call_it` ... LL | let x = call_it(&S, 22); | ^^ expected an `Fn<(isize,)>` closure, found `S` diff --git a/src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.stderr b/src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.stderr index bde30729a3c..0b86719df84 100644 --- a/src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.stderr +++ b/src/test/ui/unboxed-closures/unboxed-closures-unsafe-extern-fn.stderr @@ -2,7 +2,7 @@ error[E0277]: expected a `std::ops::Fn<(&isize,)>` closure, found `for<'r> unsaf --> $DIR/unboxed-closures-unsafe-extern-fn.rs:12:21 | LL | fn call_itisize>(_: &F, _: isize) -> isize { 0 } - | --------------------------------------------------------- required by `call_it` + | ------- ----------------- required by this bound in `call_it` ... LL | let x = call_it(&square, 22); | ^^^^^^^ expected an `Fn<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}` @@ -13,7 +13,7 @@ error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `for<'r> u --> $DIR/unboxed-closures-unsafe-extern-fn.rs:12:21 | LL | fn call_itisize>(_: &F, _: isize) -> isize { 0 } - | --------------------------------------------------------- required by `call_it` + | ------- ----- required by this bound in `call_it` ... LL | let x = call_it(&square, 22); | ^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}` @@ -24,7 +24,7 @@ error[E0277]: expected a `std::ops::FnMut<(&isize,)>` closure, found `for<'r> un --> $DIR/unboxed-closures-unsafe-extern-fn.rs:18:25 | LL | fn call_it_mutisize>(_: &mut F, _: isize) -> isize { 0 } - | -------------------------------------------------------------------- required by `call_it_mut` + | ----------- -------------------- required by this bound in `call_it_mut` ... LL | let y = call_it_mut(&mut square, 22); | ^^^^^^^^^^^ expected an `FnMut<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}` @@ -35,7 +35,7 @@ error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `for<'r> u --> $DIR/unboxed-closures-unsafe-extern-fn.rs:18:25 | LL | fn call_it_mutisize>(_: &mut F, _: isize) -> isize { 0 } - | -------------------------------------------------------------------- required by `call_it_mut` + | ----------- ----- required by this bound in `call_it_mut` ... LL | let y = call_it_mut(&mut square, 22); | ^^^^^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}` @@ -46,7 +46,7 @@ error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `for<'r> u --> $DIR/unboxed-closures-unsafe-extern-fn.rs:24:26 | LL | fn call_it_onceisize>(_: F, _: isize) -> isize { 0 } - | ----------------------------------------------------------------- required by `call_it_once` + | ------------ ----- required by this bound in `call_it_once` ... LL | let z = call_it_once(square, 22); | ^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> unsafe fn(&'r isize) -> isize {square}` diff --git a/src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.stderr b/src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.stderr index 7b393b35f29..17faf047c14 100644 --- a/src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.stderr +++ b/src/test/ui/unboxed-closures/unboxed-closures-wrong-abi.stderr @@ -2,7 +2,7 @@ error[E0277]: expected a `std::ops::Fn<(&isize,)>` closure, found `for<'r> exter --> $DIR/unboxed-closures-wrong-abi.rs:12:21 | LL | fn call_itisize>(_: &F, _: isize) -> isize { 0 } - | --------------------------------------------------------- required by `call_it` + | ------- ----------------- required by this bound in `call_it` ... LL | let x = call_it(&square, 22); | ^^^^^^^ expected an `Fn<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}` @@ -13,7 +13,7 @@ error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `for<'r> e --> $DIR/unboxed-closures-wrong-abi.rs:12:21 | LL | fn call_itisize>(_: &F, _: isize) -> isize { 0 } - | --------------------------------------------------------- required by `call_it` + | ------- ----- required by this bound in `call_it` ... LL | let x = call_it(&square, 22); | ^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}` @@ -24,7 +24,7 @@ error[E0277]: expected a `std::ops::FnMut<(&isize,)>` closure, found `for<'r> ex --> $DIR/unboxed-closures-wrong-abi.rs:18:25 | LL | fn call_it_mutisize>(_: &mut F, _: isize) -> isize { 0 } - | -------------------------------------------------------------------- required by `call_it_mut` + | ----------- -------------------- required by this bound in `call_it_mut` ... LL | let y = call_it_mut(&mut square, 22); | ^^^^^^^^^^^ expected an `FnMut<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}` @@ -35,7 +35,7 @@ error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `for<'r> e --> $DIR/unboxed-closures-wrong-abi.rs:18:25 | LL | fn call_it_mutisize>(_: &mut F, _: isize) -> isize { 0 } - | -------------------------------------------------------------------- required by `call_it_mut` + | ----------- ----- required by this bound in `call_it_mut` ... LL | let y = call_it_mut(&mut square, 22); | ^^^^^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}` @@ -46,7 +46,7 @@ error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `for<'r> e --> $DIR/unboxed-closures-wrong-abi.rs:24:26 | LL | fn call_it_onceisize>(_: F, _: isize) -> isize { 0 } - | ----------------------------------------------------------------- required by `call_it_once` + | ------------ ----- required by this bound in `call_it_once` ... LL | let z = call_it_once(square, 22); | ^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `for<'r> extern "C" fn(&'r isize) -> isize {square}` diff --git a/src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.stderr b/src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.stderr index 68fc0d45b9a..5b1d6eb5b68 100644 --- a/src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.stderr +++ b/src/test/ui/unboxed-closures/unboxed-closures-wrong-arg-type-extern-fn.stderr @@ -2,7 +2,7 @@ error[E0277]: expected a `std::ops::Fn<(&isize,)>` closure, found `unsafe fn(isi --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:13:21 | LL | fn call_itisize>(_: &F, _: isize) -> isize { 0 } - | --------------------------------------------------------- required by `call_it` + | ------- ----------------- required by this bound in `call_it` ... LL | let x = call_it(&square, 22); | ^^^^^^^ expected an `Fn<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}` @@ -13,7 +13,7 @@ error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `unsafe fn --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:13:21 | LL | fn call_itisize>(_: &F, _: isize) -> isize { 0 } - | --------------------------------------------------------- required by `call_it` + | ------- ----- required by this bound in `call_it` ... LL | let x = call_it(&square, 22); | ^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}` @@ -24,7 +24,7 @@ error[E0277]: expected a `std::ops::FnMut<(&isize,)>` closure, found `unsafe fn( --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:19:25 | LL | fn call_it_mutisize>(_: &mut F, _: isize) -> isize { 0 } - | -------------------------------------------------------------------- required by `call_it_mut` + | ----------- -------------------- required by this bound in `call_it_mut` ... LL | let y = call_it_mut(&mut square, 22); | ^^^^^^^^^^^ expected an `FnMut<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}` @@ -35,7 +35,7 @@ error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `unsafe fn --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:19:25 | LL | fn call_it_mutisize>(_: &mut F, _: isize) -> isize { 0 } - | -------------------------------------------------------------------- required by `call_it_mut` + | ----------- ----- required by this bound in `call_it_mut` ... LL | let y = call_it_mut(&mut square, 22); | ^^^^^^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}` @@ -46,7 +46,7 @@ error[E0277]: expected a `std::ops::FnOnce<(&isize,)>` closure, found `unsafe fn --> $DIR/unboxed-closures-wrong-arg-type-extern-fn.rs:25:26 | LL | fn call_it_onceisize>(_: F, _: isize) -> isize { 0 } - | ----------------------------------------------------------------- required by `call_it_once` + | ------------ ----- required by this bound in `call_it_once` ... LL | let z = call_it_once(square, 22); | ^^^^^^ expected an `FnOnce<(&isize,)>` closure, found `unsafe fn(isize) -> isize {square}` diff --git a/src/test/ui/unsized/unsized-bare-typaram.stderr b/src/test/ui/unsized/unsized-bare-typaram.stderr index c39c648f661..565d5610337 100644 --- a/src/test/ui/unsized/unsized-bare-typaram.stderr +++ b/src/test/ui/unsized/unsized-bare-typaram.stderr @@ -2,7 +2,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim --> $DIR/unsized-bare-typaram.rs:2:23 | LL | fn bar() { } - | ------------------ required by `bar` + | --- - required by this bound in `bar` LL | fn foo() { bar::() } | ^^^^^^^^ doesn't have a size known at compile-time | diff --git a/src/test/ui/unsized/unsized-struct.stderr b/src/test/ui/unsized/unsized-struct.stderr index 795115154e7..0d4776ff6c2 100644 --- a/src/test/ui/unsized/unsized-struct.stderr +++ b/src/test/ui/unsized/unsized-struct.stderr @@ -15,7 +15,7 @@ error[E0277]: the size for values of type `T` cannot be known at compilation tim --> $DIR/unsized-struct.rs:13:24 | LL | fn is_sized() { } - | ---------------------- required by `is_sized` + | -------- - required by this bound in `is_sized` ... LL | fn bar2() { is_sized::>() } | ^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time diff --git a/src/test/ui/unsized3.stderr b/src/test/ui/unsized3.stderr index f381cacadf9..c821a08f6b5 100644 --- a/src/test/ui/unsized3.stderr +++ b/src/test/ui/unsized3.stderr @@ -5,7 +5,7 @@ LL | f2::(x); | ^ doesn't have a size known at compile-time ... LL | fn f2(x: &X) { - | --------------- required by `f2` + | -- - required by this bound in `f2` | = help: the trait `std::marker::Sized` is not implemented for `X` = note: to learn more, visit @@ -18,7 +18,7 @@ LL | f4::(x); | ^ doesn't have a size known at compile-time ... LL | fn f4(x: &X) { - | ------------------ required by `f4` + | -- - required by this bound in `f4` | = help: the trait `std::marker::Sized` is not implemented for `X` = note: to learn more, visit @@ -28,7 +28,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim --> $DIR/unsized3.rs:33:8 | LL | fn f5(x: &Y) {} - | --------------- required by `f5` + | -- - required by this bound in `f5` ... LL | f5(x1); | ^^ doesn't have a size known at compile-time @@ -67,7 +67,7 @@ error[E0277]: the size for values of type `X` cannot be known at compilation tim --> $DIR/unsized3.rs:45:8 | LL | fn f5(x: &Y) {} - | --------------- required by `f5` + | -- - required by this bound in `f5` ... LL | f5(&(32, *x1)); | ^^^^^^^^^^ doesn't have a size known at compile-time diff --git a/src/test/ui/where-clauses/where-clause-constraints-are-local-for-inherent-impl.stderr b/src/test/ui/where-clauses/where-clause-constraints-are-local-for-inherent-impl.stderr index 118caf8ccce..727c9b8e067 100644 --- a/src/test/ui/where-clauses/where-clause-constraints-are-local-for-inherent-impl.stderr +++ b/src/test/ui/where-clauses/where-clause-constraints-are-local-for-inherent-impl.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied --> $DIR/where-clause-constraints-are-local-for-inherent-impl.rs:13:22 | LL | fn require_copy(x: T) {} - | ------------------------------ required by `require_copy` + | ------------ ---- required by this bound in `require_copy` ... LL | require_copy(self.x); | ^^^^^^ the trait `std::marker::Copy` is not implemented for `T` diff --git a/src/test/ui/where-clauses/where-clause-constraints-are-local-for-trait-impl.stderr b/src/test/ui/where-clauses/where-clause-constraints-are-local-for-trait-impl.stderr index d1cb4e1cc7d..1c1937c3074 100644 --- a/src/test/ui/where-clauses/where-clause-constraints-are-local-for-trait-impl.stderr +++ b/src/test/ui/where-clauses/where-clause-constraints-are-local-for-trait-impl.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied --> $DIR/where-clause-constraints-are-local-for-trait-impl.rs:18:22 | LL | fn require_copy(x: T) {} - | ------------------------------ required by `require_copy` + | ------------ ---- required by this bound in `require_copy` ... LL | require_copy(self.x); | ^^^^^^ the trait `std::marker::Copy` is not implemented for `T` diff --git a/src/test/ui/where-clauses/where-clauses-unsatisfied.stderr b/src/test/ui/where-clauses/where-clauses-unsatisfied.stderr index e59d6089ea5..1c859ac648c 100644 --- a/src/test/ui/where-clauses/where-clauses-unsatisfied.stderr +++ b/src/test/ui/where-clauses/where-clauses-unsatisfied.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `Struct: std::cmp::Eq` is not satisfied --> $DIR/where-clauses-unsatisfied.rs:6:10 | LL | fn equal(a: &T, b: &T) -> bool where T : Eq { a == b } - | ---------------------------------------------- required by `equal` + | ----- -- required by this bound in `equal` ... LL | drop(equal(&Struct, &Struct)) | ^^^^^ the trait `std::cmp::Eq` is not implemented for `Struct` diff --git a/src/test/ui/where-clauses/where-for-self-2.stderr b/src/test/ui/where-clauses/where-for-self-2.stderr index 32dc0e7359c..b18b36d029d 100644 --- a/src/test/ui/where-clauses/where-for-self-2.stderr +++ b/src/test/ui/where-clauses/where-for-self-2.stderr @@ -1,13 +1,13 @@ error[E0277]: the trait bound `for<'a> &'a _: Bar` is not satisfied --> $DIR/where-for-self-2.rs:21:5 | -LL | / fn foo(x: &T) -LL | | where for<'a> &'a T: Bar -LL | | {} - | |__- required by `foo` +LL | fn foo(x: &T) + | --- +LL | where for<'a> &'a T: Bar + | --- required by this bound in `foo` ... -LL | foo(&X); - | ^^^ the trait `for<'a> Bar` is not implemented for `&'a _` +LL | foo(&X); + | ^^^ the trait `for<'a> Bar` is not implemented for `&'a _` | = help: the following implementations were found: <&'static u32 as Bar>