From d9a5419ef4f0af07cbf62a5a4a6b002b9d6bcabd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Sat, 18 Apr 2020 16:36:46 -0700 Subject: [PATCH] Add label to item source of bound obligation --- .../traits/error_reporting/suggestions.rs | 4 ++-- .../bad-bounds-on-assoc-in-trait.stderr | 8 ++++---- .../associated-types/associated-types-eq-hr.stderr | 14 +++++++------- .../defaults-unsound-62211-1.stderr | 8 ++++---- .../defaults-unsound-62211-2.stderr | 8 ++++---- .../higher-ranked-projection.bad.stderr | 2 +- src/test/ui/associated-types/issue-43924.stderr | 4 ++-- src/test/ui/associated-types/issue-65774-1.stderr | 2 +- src/test/ui/associated-types/issue-65774-2.stderr | 2 +- .../point-at-type-on-obligation-failure-2.stderr | 2 +- .../expect-fn-supply-fn.nll.stderr | 6 +++--- .../expect-fn-supply-fn.stderr | 6 +++--- .../expect-infer-var-appearing-twice.stderr | 2 +- .../generator-yielding-or-returning-itself.stderr | 4 ++-- .../issue-62326-parameter-out-of-range.stderr | 2 +- .../ui/generic-associated-types/iterable.stderr | 4 ++-- src/test/ui/hrtb/hrtb-conflate-regions.stderr | 2 +- .../hrtb-exists-forall-trait-contravariant.stderr | 2 +- .../hrtb/hrtb-exists-forall-trait-covariant.stderr | 2 +- .../hrtb/hrtb-exists-forall-trait-invariant.stderr | 2 +- ...rtb-higher-ranker-supertraits-transitive.stderr | 2 +- .../ui/hrtb/hrtb-higher-ranker-supertraits.stderr | 4 ++-- src/test/ui/hrtb/hrtb-just-for-static.stderr | 4 ++-- src/test/ui/issues/issue-24204.stderr | 2 +- src/test/ui/issues/issue-43623.stderr | 4 ++-- src/test/ui/issues/issue-47706.stderr | 2 +- src/test/ui/issues/issue-60218.stderr | 2 +- src/test/ui/issues/issue-60283.stderr | 4 ++-- src/test/ui/issues/issue-65673.stderr | 2 +- .../missing-assoc-type-bound-restriction.stderr | 6 +++--- src/test/ui/traits/cycle-cache-err-60010.stderr | 2 +- src/test/ui/where-clauses/where-for-self-2.stderr | 2 +- 32 files changed, 61 insertions(+), 61 deletions(-) diff --git a/src/librustc_trait_selection/traits/error_reporting/suggestions.rs b/src/librustc_trait_selection/traits/error_reporting/suggestions.rs index 9a6a6fefa7c71..aaa5174420fa0 100644 --- a/src/librustc_trait_selection/traits/error_reporting/suggestions.rs +++ b/src/librustc_trait_selection/traits/error_reporting/suggestions.rs @@ -1532,14 +1532,14 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> { 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) { - let sm = self.tcx.sess.source_map(); + let sm = tcx.sess.source_map(); let same_line = match (sm.lookup_line(ident.span.hi()), sm.lookup_line(span.lo())) { (Ok(l), Ok(r)) => l.line == r.line, _ => true, }; if !ident.span.overlaps(span) && !same_line { - err.span_label(ident.span, ""); + err.span_label(ident.span, "required by a bound in this"); } } if span != DUMMY_SP { diff --git a/src/test/ui/associated-type-bounds/bad-bounds-on-assoc-in-trait.stderr b/src/test/ui/associated-type-bounds/bad-bounds-on-assoc-in-trait.stderr index 96e690631894d..f65ae32c01c99 100644 --- a/src/test/ui/associated-type-bounds/bad-bounds-on-assoc-in-trait.stderr +++ b/src/test/ui/associated-type-bounds/bad-bounds-on-assoc-in-trait.stderr @@ -2,7 +2,7 @@ error[E0277]: `>::App` doesn't implement `std::fmt::Debug` --> $DIR/bad-bounds-on-assoc-in-trait.rs:31:6 | LL | trait Case1 { - | ----- + | ----- required by a bound in this ... LL | Debug | ----- required by this bound in `Case1` @@ -26,7 +26,7 @@ error[E0277]: `<::C as std::iter::Iterator>::Item` cannot be sent be --> $DIR/bad-bounds-on-assoc-in-trait.rs:36:20 | LL | trait Case1 { - | ----- + | ----- required by a bound in this LL | type C: Clone + Iterator::C as std::iter::Iterator>::Item` cannot be shared --> $DIR/bad-bounds-on-assoc-in-trait.rs:36:20 | LL | trait Case1 { - | ----- + | ----- required by a bound in this ... LL | > + Sync>; | ---- required by this bound in `Case1` @@ -58,7 +58,7 @@ error[E0277]: `<_ as Lam<&'a u8>>::App` doesn't implement `std::fmt::Debug` --> $DIR/bad-bounds-on-assoc-in-trait.rs:36:20 | LL | trait Case1 { - | ----- + | ----- required by a bound in this ... LL | Debug | ----- required by this bound in `Case1` 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 fd7d89d193381..58d72746e76aa 100644 --- a/src/test/ui/associated-types/associated-types-eq-hr.stderr +++ b/src/test/ui/associated-types/associated-types-eq-hr.stderr @@ -2,7 +2,7 @@ error[E0271]: type mismatch resolving `for<'x> $DIR/associated-types-eq-hr.rs:82:5 | LL | fn foo() - | --- + | --- required by a bound in this LL | where T : for<'x> TheTrait<&'x isize, A = &'x isize> | ------------- required by this bound in `foo` ... @@ -16,7 +16,7 @@ error[E0271]: type mismatch resolving `for<'x> --> $DIR/associated-types-eq-hr.rs:86:5 | LL | fn bar() - | --- + | --- required by a bound in this LL | where T : for<'x> TheTrait<&'x isize, A = &'x usize> | ------------- required by this bound in `bar` ... @@ -30,7 +30,7 @@ error[E0277]: the trait bound `for<'x, 'y> Tuple: TheTrait<(&'x isize, &'y isize --> $DIR/associated-types-eq-hr.rs:91:17 | LL | fn tuple_one() - | --------- + | --------- required by a bound in this LL | where T : for<'x,'y> TheTrait<(&'x isize, &'y isize), A = &'x isize> | ---------------------------------------------------------- required by this bound in `tuple_one` ... @@ -44,7 +44,7 @@ error[E0271]: type mismatch resolving `for<'x, 'y> $DIR/associated-types-eq-hr.rs:91:5 | LL | fn tuple_one() - | --------- + | --------- required by a bound in this LL | where T : for<'x,'y> TheTrait<(&'x isize, &'y isize), A = &'x isize> | ------------- required by this bound in `tuple_one` ... @@ -55,7 +55,7 @@ error[E0277]: the trait bound `for<'x, 'y> Tuple: TheTrait<(&'x isize, &'y isize --> $DIR/associated-types-eq-hr.rs:97:17 | LL | fn tuple_two() - | --------- + | --------- required by a bound in this LL | where T : for<'x,'y> TheTrait<(&'x isize, &'y isize), A = &'y isize> | ---------------------------------------------------------- required by this bound in `tuple_two` ... @@ -69,7 +69,7 @@ error[E0271]: type mismatch resolving `for<'x, 'y> $DIR/associated-types-eq-hr.rs:97:5 | LL | fn tuple_two() - | --------- + | --------- required by a bound in this LL | where T : for<'x,'y> TheTrait<(&'x isize, &'y isize), A = &'y isize> | ------------- required by this bound in `tuple_two` ... @@ -80,7 +80,7 @@ error[E0277]: the trait bound `for<'x, 'y> Tuple: TheTrait<(&'x isize, &'y isize --> $DIR/associated-types-eq-hr.rs:107:18 | LL | fn tuple_four() - | ---------- + | ---------- required by a bound in this LL | where T : for<'x,'y> TheTrait<(&'x isize, &'y isize)> | ------------------------------------------- required by this bound in `tuple_four` ... diff --git a/src/test/ui/associated-types/defaults-unsound-62211-1.stderr b/src/test/ui/associated-types/defaults-unsound-62211-1.stderr index 7bf75f3839c0e..856d513d60bd3 100644 --- a/src/test/ui/associated-types/defaults-unsound-62211-1.stderr +++ b/src/test/ui/associated-types/defaults-unsound-62211-1.stderr @@ -43,7 +43,7 @@ error[E0277]: `T` doesn't implement `std::fmt::Display` --> $DIR/defaults-unsound-62211-1.rs:41:9 | LL | trait UncheckedCopy: Sized { - | ------------- + | ------------- required by a bound in this ... LL | + Display = Self; | ------- required by this bound in `UncheckedCopy` @@ -62,7 +62,7 @@ error[E0277]: the trait bound `T: std::ops::Deref` is not satisfied --> $DIR/defaults-unsound-62211-1.rs:41:9 | LL | trait UncheckedCopy: Sized { - | ------------- + | ------------- required by a bound in this ... LL | + Deref | ------------------- required by this bound in `UncheckedCopy` @@ -79,7 +79,7 @@ error[E0277]: cannot add-assign `&'static str` to `T` --> $DIR/defaults-unsound-62211-1.rs:41:9 | LL | trait UncheckedCopy: Sized { - | ------------- + | ------------- required by a bound in this ... LL | + AddAssign<&'static str> | ----------------------- required by this bound in `UncheckedCopy` @@ -97,7 +97,7 @@ error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied --> $DIR/defaults-unsound-62211-1.rs:41:9 | LL | trait UncheckedCopy: Sized { - | ------------- + | ------------- required by a bound in this ... LL | type Output: Copy | ---- required by this bound in `UncheckedCopy` diff --git a/src/test/ui/associated-types/defaults-unsound-62211-2.stderr b/src/test/ui/associated-types/defaults-unsound-62211-2.stderr index b6d889515b6fb..1060c82fec22a 100644 --- a/src/test/ui/associated-types/defaults-unsound-62211-2.stderr +++ b/src/test/ui/associated-types/defaults-unsound-62211-2.stderr @@ -43,7 +43,7 @@ error[E0277]: `T` doesn't implement `std::fmt::Display` --> $DIR/defaults-unsound-62211-2.rs:41:9 | LL | trait UncheckedCopy: Sized { - | ------------- + | ------------- required by a bound in this ... LL | + Display = Self; | ------- required by this bound in `UncheckedCopy` @@ -62,7 +62,7 @@ error[E0277]: the trait bound `T: std::ops::Deref` is not satisfied --> $DIR/defaults-unsound-62211-2.rs:41:9 | LL | trait UncheckedCopy: Sized { - | ------------- + | ------------- required by a bound in this ... LL | + Deref | ------------------- required by this bound in `UncheckedCopy` @@ -79,7 +79,7 @@ error[E0277]: cannot add-assign `&'static str` to `T` --> $DIR/defaults-unsound-62211-2.rs:41:9 | LL | trait UncheckedCopy: Sized { - | ------------- + | ------------- required by a bound in this ... LL | + AddAssign<&'static str> | ----------------------- required by this bound in `UncheckedCopy` @@ -97,7 +97,7 @@ error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied --> $DIR/defaults-unsound-62211-2.rs:41:9 | LL | trait UncheckedCopy: Sized { - | ------------- + | ------------- required by a bound in this ... LL | type Output: Copy | ---- required by this bound in `UncheckedCopy` 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 74c9ad2c39e67..3b3e4c3ea117a 100644 --- a/src/test/ui/associated-types/higher-ranked-projection.bad.stderr +++ b/src/test/ui/associated-types/higher-ranked-projection.bad.stderr @@ -2,7 +2,7 @@ error[E0271]: type mismatch resolving `for<'a> <&'a _ as Mirror>::Image == _` --> $DIR/higher-ranked-projection.rs:25:5 | LL | fn foo(_t: T) - | --- + | --- required by a bound in this LL | where for<'a> &'a T: Mirror | ------- required by this bound in `foo` ... diff --git a/src/test/ui/associated-types/issue-43924.stderr b/src/test/ui/associated-types/issue-43924.stderr index 58f71b8b14ed2..f21846fd82c43 100644 --- a/src/test/ui/associated-types/issue-43924.stderr +++ b/src/test/ui/associated-types/issue-43924.stderr @@ -10,7 +10,7 @@ error[E0277]: the trait bound `(dyn std::string::ToString + 'static): std::defau --> $DIR/issue-43924.rs:10:6 | LL | trait Foo { - | --- + | --- required by a bound in this LL | type Out: Default + ToString + ?Sized = dyn ToString; | ------- required by this bound in `Foo` ... @@ -21,7 +21,7 @@ error[E0277]: the trait bound `(dyn std::string::ToString + 'static): std::defau --> $DIR/issue-43924.rs:11:6 | LL | trait Foo { - | --- + | --- required by a bound in this LL | type Out: Default + ToString + ?Sized = dyn ToString; | ------- required by this bound in `Foo` ... diff --git a/src/test/ui/associated-types/issue-65774-1.stderr b/src/test/ui/associated-types/issue-65774-1.stderr index 2e5a1ebf19afa..72f47df5d80e7 100644 --- a/src/test/ui/associated-types/issue-65774-1.stderr +++ b/src/test/ui/associated-types/issue-65774-1.stderr @@ -10,7 +10,7 @@ error[E0277]: the trait bound `T: MyDisplay` is not satisfied --> $DIR/issue-65774-1.rs:16:6 | LL | trait MPU { - | --- + | --- required by a bound in this LL | type MpuConfig: MyDisplay = T; | --------- required by this bound in `MPU` ... diff --git a/src/test/ui/associated-types/issue-65774-2.stderr b/src/test/ui/associated-types/issue-65774-2.stderr index 5b3986407bc4c..aef70885af369 100644 --- a/src/test/ui/associated-types/issue-65774-2.stderr +++ b/src/test/ui/associated-types/issue-65774-2.stderr @@ -10,7 +10,7 @@ error[E0277]: the trait bound `T: MyDisplay` is not satisfied --> $DIR/issue-65774-2.rs:16:6 | LL | trait MPU { - | --- + | --- required by a bound in this LL | type MpuConfig: MyDisplay = T; | --------- required by this bound in `MPU` ... diff --git a/src/test/ui/associated-types/point-at-type-on-obligation-failure-2.stderr b/src/test/ui/associated-types/point-at-type-on-obligation-failure-2.stderr index dac713567b5e2..3118a9c5352c3 100644 --- a/src/test/ui/associated-types/point-at-type-on-obligation-failure-2.stderr +++ b/src/test/ui/associated-types/point-at-type-on-obligation-failure-2.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `bool: Bar` is not satisfied --> $DIR/point-at-type-on-obligation-failure-2.rs:8:18 | LL | trait Foo { - | --- + | --- required by a bound in this LL | type Assoc: Bar; | --- required by this bound in `Foo` ... diff --git a/src/test/ui/closure-expected-type/expect-fn-supply-fn.nll.stderr b/src/test/ui/closure-expected-type/expect-fn-supply-fn.nll.stderr index 7141c047d7f53..97fdb76dd11c7 100644 --- a/src/test/ui/closure-expected-type/expect-fn-supply-fn.nll.stderr +++ b/src/test/ui/closure-expected-type/expect-fn-supply-fn.nll.stderr @@ -2,7 +2,7 @@ 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) - | ------------------------------------------ + | ------------------------------------------ required by a bound in this LL | where F: for<'a> FnOnce(fn(&'a u32), &i32) | ------------------------- required by this bound in `with_closure_expecting_fn_with_free_region` ... @@ -15,7 +15,7 @@ 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) - | ------------------------------------------- + | ------------------------------------------- required by a bound in this LL | where F: FnOnce(fn(&u32), &i32) | ---------------------- required by this bound in `with_closure_expecting_fn_with_bound_region` ... @@ -28,7 +28,7 @@ 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) - | ------------------------------------------- + | ------------------------------------------- required by a bound in this LL | where F: FnOnce(fn(&u32), &i32) | ---------------------- required by this bound in `with_closure_expecting_fn_with_bound_region` ... 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 0033395846815..fae41c4114abc 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 @@ -40,7 +40,7 @@ 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) - | ------------------------------------------ + | ------------------------------------------ required by a bound in this LL | where F: for<'a> FnOnce(fn(&'a u32), &i32) | ------------------------- required by this bound in `with_closure_expecting_fn_with_free_region` ... @@ -53,7 +53,7 @@ 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) - | ------------------------------------------- + | ------------------------------------------- required by a bound in this LL | where F: FnOnce(fn(&u32), &i32) | ---------------------- required by this bound in `with_closure_expecting_fn_with_bound_region` ... @@ -66,7 +66,7 @@ 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) - | ------------------------------------------- + | ------------------------------------------- required by a bound in this LL | where F: FnOnce(fn(&u32), &i32) | ---------------------- required by this bound in `with_closure_expecting_fn_with_bound_region` ... 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 1c6564ee426e5..93b42a5a305f2 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 @@ -2,7 +2,7 @@ error[E0631]: type mismatch in closure arguments --> $DIR/expect-infer-var-appearing-twice.rs:14:5 | LL | fn with_closure(_: F) - | ------------ + | ------------ required by a bound in this LL | where F: FnOnce(A, A) | ------------ required by this bound in `with_closure` ... diff --git a/src/test/ui/generator/generator-yielding-or-returning-itself.stderr b/src/test/ui/generator/generator-yielding-or-returning-itself.stderr index fc8064d8225bf..9699abd5661a2 100644 --- a/src/test/ui/generator/generator-yielding-or-returning-itself.stderr +++ b/src/test/ui/generator/generator-yielding-or-returning-itself.stderr @@ -2,7 +2,7 @@ error[E0271]: type mismatch resolving `<[generator@$DIR/generator-yielding-or-re --> $DIR/generator-yielding-or-returning-itself.rs:15:5 | LL | pub fn want_cyclic_generator_return(_: T) - | ---------------------------- + | ---------------------------- required by a bound in this LL | where T: Generator | ---------- required by this bound in `want_cyclic_generator_return` ... @@ -18,7 +18,7 @@ error[E0271]: type mismatch resolving `<[generator@$DIR/generator-yielding-or-re --> $DIR/generator-yielding-or-returning-itself.rs:28:5 | LL | pub fn want_cyclic_generator_yield(_: T) - | --------------------------- + | --------------------------- required by a bound in this LL | where T: Generator | --------- required by this bound in `want_cyclic_generator_yield` ... diff --git a/src/test/ui/generic-associated-types/issue-62326-parameter-out-of-range.stderr b/src/test/ui/generic-associated-types/issue-62326-parameter-out-of-range.stderr index 88b5c6a0a013c..4b06baa09ffbf 100644 --- a/src/test/ui/generic-associated-types/issue-62326-parameter-out-of-range.stderr +++ b/src/test/ui/generic-associated-types/issue-62326-parameter-out-of-range.stderr @@ -2,7 +2,7 @@ error[E0280]: the requirement `for<'a> ::Item<'a>: 'a` is not --> $DIR/issue-62326-parameter-out-of-range.rs:7:20 | LL | trait Iterator { - | -------- + | -------- required by a bound in this LL | type Item<'a>: 'a; | ^^ required by this bound in `Iterator` diff --git a/src/test/ui/generic-associated-types/iterable.stderr b/src/test/ui/generic-associated-types/iterable.stderr index 6bc5a2319a980..b1298163aabf0 100644 --- a/src/test/ui/generic-associated-types/iterable.stderr +++ b/src/test/ui/generic-associated-types/iterable.stderr @@ -24,7 +24,7 @@ error[E0271]: type mismatch resolving `for<'a> < as Iterable>:: --> $DIR/iterable.rs:19:30 | LL | trait Iterable { - | -------- + | -------- required by a bound in this LL | type Item<'a> where Self: 'a; LL | type Iter<'a>: Iterator> where Self: 'a; | --------------------- required by this bound in `Iterable` @@ -41,7 +41,7 @@ error[E0271]: type mismatch resolving `for<'a> <<[T] as Iterable>::Iter<'a> as s --> $DIR/iterable.rs:31:30 | LL | trait Iterable { - | -------- + | -------- required by a bound in this LL | type Item<'a> where Self: 'a; LL | type Iter<'a>: Iterator> where Self: 'a; | --------------------- required by this bound in `Iterable` diff --git a/src/test/ui/hrtb/hrtb-conflate-regions.stderr b/src/test/ui/hrtb/hrtb-conflate-regions.stderr index 9822b48f4f48f..7250935ea296b 100644 --- a/src/test/ui/hrtb/hrtb-conflate-regions.stderr +++ b/src/test/ui/hrtb/hrtb-conflate-regions.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `for<'a, 'b> SomeStruct: Foo<(&'a isize, &'b isize --> $DIR/hrtb-conflate-regions.rs:27:22 | LL | fn want_foo2() - | --------- + | --------- required by a bound in this LL | where T : for<'a,'b> Foo<(&'a isize, &'b isize)> | -------------------------------------- required by this bound in `want_foo2` ... 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 969d9eda73519..7a7285d3d76e0 100644 --- a/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.stderr +++ b/src/test/ui/hrtb/hrtb-exists-forall-trait-contravariant.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `(): Trait fn(&'b u32)>` is not satisfied --> $DIR/hrtb-exists-forall-trait-contravariant.rs:34:11 | LL | fn foo() - | --- + | --- required by a bound in this LL | where LL | T: Trait fn(&'b u32)>, | -------------------------- required by this bound in `foo` 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 dddc2bcce49e5..1e335f9ee9610 100644 --- a/src/test/ui/hrtb/hrtb-exists-forall-trait-covariant.stderr +++ b/src/test/ui/hrtb/hrtb-exists-forall-trait-covariant.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `(): Trait fn(fn(&'b u32))>` is not satisf --> $DIR/hrtb-exists-forall-trait-covariant.rs:36:11 | LL | fn foo() - | --- + | --- required by a bound in this LL | where LL | T: Trait fn(fn(&'b u32))>, | ------------------------------ required by this bound in `foo` 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 23ef75944d317..9174ea4d8419d 100644 --- a/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.stderr +++ b/src/test/ui/hrtb/hrtb-exists-forall-trait-invariant.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `(): Trait fn(std::cell::Cell<&'b u32>)>` --> $DIR/hrtb-exists-forall-trait-invariant.rs:28:11 | LL | fn foo() - | --- + | --- required by a bound in this LL | where LL | T: Trait fn(Cell<&'b u32>)>, | -------------------------------- required by this bound in `foo` 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 268ff057421fe..87a13889298df 100644 --- a/src/test/ui/hrtb/hrtb-higher-ranker-supertraits-transitive.stderr +++ b/src/test/ui/hrtb/hrtb-higher-ranker-supertraits-transitive.stderr @@ -2,7 +2,7 @@ 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) - | -------------------- + | -------------------- required by a bound in this LL | where B : for<'ccx> Bar<'ccx> | ------------------- required by this bound in `want_bar_for_any_ccx` ... diff --git a/src/test/ui/hrtb/hrtb-higher-ranker-supertraits.stderr b/src/test/ui/hrtb/hrtb-higher-ranker-supertraits.stderr index 2e20d2fe6dda3..0123faa36dbcd 100644 --- a/src/test/ui/hrtb/hrtb-higher-ranker-supertraits.stderr +++ b/src/test/ui/hrtb/hrtb-higher-ranker-supertraits.stderr @@ -5,7 +5,7 @@ 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) - | -------------------- + | -------------------- required by a bound in this LL | where F : for<'tcx> Foo<'tcx> | ------------------- required by this bound in `want_foo_for_any_tcx` | @@ -21,7 +21,7 @@ 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) - | -------------------- + | -------------------- required by a bound in this LL | where B : for<'ccx> Bar<'ccx> | ------------------- required by this bound in `want_bar_for_any_ccx` | diff --git a/src/test/ui/hrtb/hrtb-just-for-static.stderr b/src/test/ui/hrtb/hrtb-just-for-static.stderr index 6ec0beefd60e3..4fa404624775b 100644 --- a/src/test/ui/hrtb/hrtb-just-for-static.stderr +++ b/src/test/ui/hrtb/hrtb-just-for-static.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `for<'a> StaticInt: Foo<&'a isize>` is not satisfi --> $DIR/hrtb-just-for-static.rs:24:17 | LL | fn want_hrtb() - | --------- + | --------- required by a bound in this LL | where T : for<'a> Foo<&'a isize> | ---------------------- required by this bound in `want_hrtb` ... @@ -16,7 +16,7 @@ error[E0277]: the trait bound `for<'a> &'a u32: Foo<&'a isize>` is not satisfied --> $DIR/hrtb-just-for-static.rs:30:17 | LL | fn want_hrtb() - | --------- + | --------- required by a bound in this LL | where T : for<'a> Foo<&'a isize> | ---------------------- required by this bound in `want_hrtb` ... diff --git a/src/test/ui/issues/issue-24204.stderr b/src/test/ui/issues/issue-24204.stderr index 64d1b68cbed7f..d69efc860059b 100644 --- a/src/test/ui/issues/issue-24204.stderr +++ b/src/test/ui/issues/issue-24204.stderr @@ -2,7 +2,7 @@ error[E0271]: type mismatch resolving `<::A as MultiDispatch>:: --> $DIR/issue-24204.rs:14:12 | LL | trait Trait: Sized { - | ----- + | ----- required by a bound in this LL | type A: MultiDispatch; | -------- required by this bound in `Trait` ... diff --git a/src/test/ui/issues/issue-43623.stderr b/src/test/ui/issues/issue-43623.stderr index d90eb53f9006f..99fb2a1f5d030 100644 --- a/src/test/ui/issues/issue-43623.stderr +++ b/src/test/ui/issues/issue-43623.stderr @@ -2,7 +2,7 @@ error[E0631]: type mismatch in function arguments --> $DIR/issue-43623.rs:14:5 | LL | pub fn break_me(f: F) - | -------- + | -------- required by a bound in this LL | where T: for<'b> Trait<'b>, LL | F: for<'b> FnMut(>::Assoc) { | -------------------------------------- required by this bound in `break_me` @@ -16,7 +16,7 @@ error[E0271]: type mismatch resolving `for<'b> $DIR/issue-43623.rs:14:5 | LL | pub fn break_me(f: F) - | -------- + | -------- required by a bound in this LL | where T: for<'b> Trait<'b>, LL | F: for<'b> FnMut(>::Assoc) { | ------------------------------ required by this bound in `break_me` diff --git a/src/test/ui/issues/issue-47706.stderr b/src/test/ui/issues/issue-47706.stderr index 6cde93734667f..c84d8ecb4c9e6 100644 --- a/src/test/ui/issues/issue-47706.stderr +++ b/src/test/ui/issues/issue-47706.stderr @@ -14,7 +14,7 @@ LL | Bar(i32), | -------- takes 1 argument ... LL | fn foo(f: F) - | --- + | --- required by a bound in this LL | where LL | F: Fn(), | ---- required by this bound in `foo` diff --git a/src/test/ui/issues/issue-60218.stderr b/src/test/ui/issues/issue-60218.stderr index a9970cc109699..77b9d9c4aaa3a 100644 --- a/src/test/ui/issues/issue-60218.stderr +++ b/src/test/ui/issues/issue-60218.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `for<'t> $DIR/issue-60218.rs:18:5 | LL | pub fn trigger_error(iterable: I, functor: F) - | ------------- + | ------------- required by a bound in this ... LL | for<'t> ::IntoIter, F> as Iterator>::Item: Foo, | --- required by this bound in `trigger_error` diff --git a/src/test/ui/issues/issue-60283.stderr b/src/test/ui/issues/issue-60283.stderr index d13dcd54a479a..e74a34e247a67 100644 --- a/src/test/ui/issues/issue-60283.stderr +++ b/src/test/ui/issues/issue-60283.stderr @@ -2,7 +2,7 @@ error[E0631]: type mismatch in function arguments --> $DIR/issue-60283.rs:14:13 | LL | pub fn foo(_: T, _: F) - | --- + | --- required by a bound in this LL | where T: for<'a> Trait<'a>, LL | F: for<'a> FnMut(>::Item) {} | ------------------------------------- required by this bound in `foo` @@ -17,7 +17,7 @@ error[E0271]: type mismatch resolving `for<'a> } as s --> $DIR/issue-60283.rs:14:5 | LL | pub fn foo(_: T, _: F) - | --- + | --- required by a bound in this LL | where T: for<'a> Trait<'a>, LL | F: for<'a> FnMut(>::Item) {} | ----------------------------- required by this bound in `foo` diff --git a/src/test/ui/issues/issue-65673.stderr b/src/test/ui/issues/issue-65673.stderr index 6778ab8bfe4f2..114f2d62e561a 100644 --- a/src/test/ui/issues/issue-65673.stderr +++ b/src/test/ui/issues/issue-65673.stderr @@ -2,7 +2,7 @@ error[E0277]: the size for values of type `(dyn Trait + 'static)` cannot be know --> $DIR/issue-65673.rs:9:16 | LL | trait WithType { - | -------- + | -------- required by a bound in this LL | type Ctx; | --------- required by this bound in `WithType` ... diff --git a/src/test/ui/suggestions/missing-assoc-type-bound-restriction.stderr b/src/test/ui/suggestions/missing-assoc-type-bound-restriction.stderr index c5510bfa3f2fe..ef484e94729e8 100644 --- a/src/test/ui/suggestions/missing-assoc-type-bound-restriction.stderr +++ b/src/test/ui/suggestions/missing-assoc-type-bound-restriction.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `::Assoc: Child` is not satisfied --> $DIR/missing-assoc-type-bound-restriction.rs:17:19 | LL | trait Parent { - | ------ + | ------ required by a bound in this LL | type Ty; LL | type Assoc: Child; | --------------- required by this bound in `Parent` @@ -16,7 +16,7 @@ error[E0277]: the trait bound `::Assoc: Child` is not satisfied --> $DIR/missing-assoc-type-bound-restriction.rs:20:18 | LL | trait Parent { - | ------ + | ------ required by a bound in this LL | type Ty; LL | type Assoc: Child; | --------------- required by this bound in `Parent` @@ -33,7 +33,7 @@ error[E0277]: the trait bound `::Assoc: Child` is not satisfied --> $DIR/missing-assoc-type-bound-restriction.rs:20:5 | LL | trait Parent { - | ------ + | ------ required by a bound in this LL | type Ty; LL | type Assoc: Child; | --------------- required by this bound in `Parent` diff --git a/src/test/ui/traits/cycle-cache-err-60010.stderr b/src/test/ui/traits/cycle-cache-err-60010.stderr index 356b90d064623..3188ee83e7d39 100644 --- a/src/test/ui/traits/cycle-cache-err-60010.stderr +++ b/src/test/ui/traits/cycle-cache-err-60010.stderr @@ -10,7 +10,7 @@ error[E0275]: overflow evaluating the requirement `Runtime: std::p --> $DIR/cycle-cache-err-60010.rs:31:20 | LL | trait Database { - | -------- + | -------- required by a bound in this LL | type Storage; | ------------- required by this bound in `Database` ... 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 b18b36d029d70..9976243b200dc 100644 --- a/src/test/ui/where-clauses/where-for-self-2.stderr +++ b/src/test/ui/where-clauses/where-for-self-2.stderr @@ -2,7 +2,7 @@ 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) - | --- + | --- required by a bound in this LL | where for<'a> &'a T: Bar | --- required by this bound in `foo` ...