Skip to content

Commit 402714f

Browse files
committed
Remove an unhelpful and sometimes misleading label
1 parent d43836f commit 402714f

File tree

65 files changed

+8
-536
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+8
-536
lines changed

compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs

-11
Original file line numberDiff line numberDiff line change
@@ -2438,17 +2438,6 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
24382438
| ObligationCauseCode::ExprBindingObligation(item_def_id, span, ..) => {
24392439
let item_name = tcx.def_path_str(item_def_id);
24402440
let mut multispan = MultiSpan::from(span);
2441-
if let Some(ident) = tcx.opt_item_ident(item_def_id) {
2442-
let sm = tcx.sess.source_map();
2443-
let same_line =
2444-
match (sm.lookup_line(ident.span.hi()), sm.lookup_line(span.lo())) {
2445-
(Ok(l), Ok(r)) => l.line == r.line,
2446-
_ => true,
2447-
};
2448-
if !ident.span.overlaps(span) && !same_line {
2449-
multispan.push_span_label(ident.span, "required by a bound in this");
2450-
}
2451-
}
24522441
let descr = format!("required by a bound in `{}`", item_name);
24532442
if span != DUMMY_SP {
24542443
let msg = format!("required by this bound in `{}`", item_name);

src/test/ui/associated-types/associated-types-eq-hr.stderr

-6
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ LL | type A = &'a usize;
1414
note: required by a bound in `foo`
1515
--> $DIR/associated-types-eq-hr.rs:45:36
1616
|
17-
LL | fn foo<T>()
18-
| --- required by a bound in this
19-
LL | where
2017
LL | T: for<'x> TheTrait<&'x isize, A = &'x isize>,
2118
| ^^^^^^^^^^^^^ required by this bound in `foo`
2219

@@ -36,9 +33,6 @@ LL | type A = &'a isize;
3633
note: required by a bound in `bar`
3734
--> $DIR/associated-types-eq-hr.rs:52:36
3835
|
39-
LL | fn bar<T>()
40-
| --- required by a bound in this
41-
LL | where
4236
LL | T: for<'x> TheTrait<&'x isize, A = &'x usize>,
4337
| ^^^^^^^^^^^^^ required by this bound in `bar`
4438

src/test/ui/associated-types/defaults-suitability.stderr

-9
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ note: required by a bound in `Tr2::Ty`
2525
|
2626
LL | Self::Ty: Clone,
2727
| ^^^^^ required by this bound in `Tr2::Ty`
28-
LL | {
29-
LL | type Ty = NotClone;
30-
| -- required by a bound in this
3128
help: consider annotating `NotClone` with `#[derive(Clone)]`
3229
|
3330
LL | #[derive(Clone)]
@@ -73,9 +70,6 @@ note: required by a bound in `D::Assoc`
7370
|
7471
LL | Self::Assoc: IsU8<Self::Assoc>,
7572
| ^^^^^^^^^^^^^^^^^ required by this bound in `D::Assoc`
76-
...
77-
LL | type Assoc = NotClone;
78-
| ----- required by a bound in this
7973

8074
error[E0277]: the trait bound `<Self as Foo2<T>>::Baz: Clone` is not satisfied
8175
--> $DIR/defaults-suitability.rs:65:23
@@ -122,9 +116,6 @@ note: required by a bound in `Foo3::Baz`
122116
|
123117
LL | Self::Baz: Clone,
124118
| ^^^^^ required by this bound in `Foo3::Baz`
125-
...
126-
LL | type Baz = T;
127-
| --- required by a bound in this
128119
help: consider further restricting type parameter `T`
129120
|
130121
LL | Self::Baz: Clone, T: std::clone::Clone

src/test/ui/associated-types/hr-associated-type-bound-1.stderr

-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ LL | type U = str;
88
note: required by a bound in `X`
99
--> $DIR/hr-associated-type-bound-1.rs:3:33
1010
|
11-
LL | trait X<'a>
12-
| - required by a bound in this
13-
LL | where
1411
LL | for<'b> <Self as X<'b>>::U: Clone,
1512
| ^^^^^ required by this bound in `X`
1613

src/test/ui/associated-types/hr-associated-type-bound-object.stderr

-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ LL | fn f<'a, T: X<'a> + ?Sized>(x: &<T as X<'a>>::U) {
77
note: required by a bound in `X`
88
--> $DIR/hr-associated-type-bound-object.rs:3:33
99
|
10-
LL | trait X<'a>
11-
| - required by a bound in this
12-
LL | where
1310
LL | for<'b> <Self as X<'b>>::U: Clone,
1411
| ^^^^^ required by this bound in `X`
1512

src/test/ui/associated-types/hr-associated-type-bound-param-1.stderr

-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ LL | type V = str;
88
note: required by a bound in `Y`
99
--> $DIR/hr-associated-type-bound-param-1.rs:4:36
1010
|
11-
LL | trait Y<'a, T: ?Sized>
12-
| - required by a bound in this
13-
...
1411
LL | for<'b> <Self as Y<'b, T>>::V: Clone,
1512
| ^^^^^ required by this bound in `Y`
1613

src/test/ui/associated-types/hr-associated-type-bound-param-2.stderr

-9
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ LL | T: Z<'a, u16>,
88
note: required by a bound in `Z`
99
--> $DIR/hr-associated-type-bound-param-2.rs:6:35
1010
|
11-
LL | trait Z<'a, T: ?Sized>
12-
| - required by a bound in this
13-
...
1411
LL | for<'b> <T as Z<'b, u16>>::W: Clone,
1512
| ^^^^^ required by this bound in `Z`
1613

@@ -24,9 +21,6 @@ LL | type W = str;
2421
note: required by a bound in `Z`
2522
--> $DIR/hr-associated-type-bound-param-2.rs:6:35
2623
|
27-
LL | trait Z<'a, T: ?Sized>
28-
| - required by a bound in this
29-
...
3024
LL | for<'b> <T as Z<'b, u16>>::W: Clone,
3125
| ^^^^^ required by this bound in `Z`
3226

@@ -40,9 +34,6 @@ LL | T: Z<'a, u16>,
4034
note: required by a bound in `Z`
4135
--> $DIR/hr-associated-type-bound-param-2.rs:6:35
4236
|
43-
LL | trait Z<'a, T: ?Sized>
44-
| - required by a bound in this
45-
...
4637
LL | for<'b> <T as Z<'b, u16>>::W: Clone,
4738
| ^^^^^ required by this bound in `Z`
4839

src/test/ui/associated-types/hr-associated-type-bound-param-3.stderr

-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ LL | type U = str;
88
note: required by a bound in `X`
99
--> $DIR/hr-associated-type-bound-param-3.rs:4:33
1010
|
11-
LL | trait X<'a, T>
12-
| - required by a bound in this
13-
...
1411
LL | for<'b> <T as X<'b, T>>::U: Clone,
1512
| ^^^^^ required by this bound in `X`
1613

src/test/ui/associated-types/hr-associated-type-bound-param-4.stderr

-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ LL | type U = str;
88
note: required by a bound in `X`
99
--> $DIR/hr-associated-type-bound-param-4.rs:4:36
1010
|
11-
LL | trait X<'a, T>
12-
| - required by a bound in this
13-
...
1411
LL | for<'b> <(T,) as X<'b, T>>::U: Clone,
1512
| ^^^^^ required by this bound in `X`
1613

src/test/ui/associated-types/hr-associated-type-bound-param-5.stderr

-6
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ LL | type U = str;
88
note: required by a bound in `X`
99
--> $DIR/hr-associated-type-bound-param-5.rs:17:45
1010
|
11-
LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
12-
| - required by a bound in this
13-
...
1411
LL | for<'b> <T::Next as X<'b, T::Next>>::U: Clone,
1512
| ^^^^^ required by this bound in `X`
1613

@@ -24,9 +21,6 @@ LL | type U = str;
2421
note: required by a bound in `X`
2522
--> $DIR/hr-associated-type-bound-param-5.rs:17:45
2623
|
27-
LL | trait X<'a, T: Cycle + for<'b> X<'b, T>>
28-
| - required by a bound in this
29-
...
3024
LL | for<'b> <T::Next as X<'b, T::Next>>::U: Clone,
3125
| ^^^^^ required by this bound in `X`
3226

src/test/ui/associated-types/hr-associated-type-projection-1.stderr

-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ LL | impl<T: Copy + std::ops::Deref> UnsafeCopy<'_, T> for T {
99
note: required by a bound in `UnsafeCopy`
1010
--> $DIR/hr-associated-type-projection-1.rs:3:64
1111
|
12-
LL | trait UnsafeCopy<'a, T: Copy>
13-
| ---------- required by a bound in this
14-
LL | where
1512
LL | for<'b> <Self as UnsafeCopy<'b, T>>::Item: std::ops::Deref<Target = T>,
1613
| ^^^^^^^^^^ required by this bound in `UnsafeCopy`
1714
help: consider further restricting this bound

src/test/ui/associated-types/point-at-type-on-obligation-failure-2.stderr

-6
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ note: required by a bound in `Baz::Assoc`
2121
|
2222
LL | Self::Assoc: Bar,
2323
| ^^^ required by this bound in `Baz::Assoc`
24-
LL | {
25-
LL | type Assoc;
26-
| ----- required by a bound in this
2724

2825
error[E0277]: the trait bound `bool: Bar` is not satisfied
2926
--> $DIR/point-at-type-on-obligation-failure-2.rs:30:18
@@ -36,9 +33,6 @@ note: required by a bound in `Bat::Assoc`
3633
|
3734
LL | <Self as Bat>::Assoc: Bar,
3835
| ^^^ required by this bound in `Bat::Assoc`
39-
LL | {
40-
LL | type Assoc;
41-
| ----- required by a bound in this
4236

4337
error: aborting due to 3 previous errors
4438

src/test/ui/closure-expected-type/expect-infer-var-appearing-twice.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ LL | with_closure(|x: u32, y: i32| {
1111
note: required by a bound in `with_closure`
1212
--> $DIR/expect-infer-var-appearing-twice.rs:2:14
1313
|
14-
LL | fn with_closure<F, A>(_: F)
15-
| ------------ required by a bound in this
1614
LL | where F: FnOnce(A, A)
1715
| ^^^^^^^^^^^^ required by this bound in `with_closure`
1816

src/test/ui/const-generics/defaults/wfness.stderr

-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ LL | fn foo() -> DependentDefaultWfness {
2222
note: required by a bound in `WhereClause`
2323
--> $DIR/wfness.rs:8:9
2424
|
25-
LL | struct WhereClause<const N: u8 = 2>
26-
| ----------- required by a bound in this
27-
LL | where
2825
LL | (): Trait<N>;
2926
| ^^^^^^^^ required by this bound in `WhereClause`
3027

src/test/ui/const-generics/generic_const_exprs/issue-72819-generic-in-const-eval.full.stderr

-4
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ LL | let x: Arr<{usize::MAX}> = Arr {};
99
note: required by a bound in `Arr`
1010
--> $DIR/issue-72819-generic-in-const-eval.rs:8:39
1111
|
12-
LL | struct Arr<const N: usize>
13-
| --- required by a bound in this
1412
LL | where Assert::<{N < usize::MAX / 2}>: IsTrue,
1513
| ^^^^^^ required by this bound in `Arr`
1614

@@ -25,8 +23,6 @@ LL | let x: Arr<{usize::MAX}> = Arr {};
2523
note: required by a bound in `Arr`
2624
--> $DIR/issue-72819-generic-in-const-eval.rs:8:39
2725
|
28-
LL | struct Arr<const N: usize>
29-
| --- required by a bound in this
3026
LL | where Assert::<{N < usize::MAX / 2}>: IsTrue,
3127
| ^^^^^^ required by this bound in `Arr`
3228

src/test/ui/const-generics/generic_const_exprs/obligation-cause.rs

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ struct Is<const V: bool>;
88
impl True for Is<true> {}
99

1010
fn g<T>()
11-
//~^ NOTE required by a bound in this
1211
where
1312
Is<{ std::mem::size_of::<T>() == 0 }>: True,
1413
//~^ NOTE required by a bound in `g`

src/test/ui/const-generics/generic_const_exprs/obligation-cause.stderr

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
error[E0308]: mismatched types
2-
--> $DIR/obligation-cause.rs:20:5
2+
--> $DIR/obligation-cause.rs:19:5
33
|
44
LL | g::<usize>();
55
| ^^^^^^^^^^ expected `false`, found `true`
66
|
77
= note: expected constant `false`
88
found constant `true`
99
note: required by a bound in `g`
10-
--> $DIR/obligation-cause.rs:13:44
10+
--> $DIR/obligation-cause.rs:12:44
1111
|
12-
LL | fn g<T>()
13-
| - required by a bound in this
14-
...
1512
LL | Is<{ std::mem::size_of::<T>() == 0 }>: True,
1613
| ^^^^ required by this bound in `g`
1714

src/test/ui/const-generics/issues/issue-67185-2.stderr

-12
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ LL | impl Foo for FooImpl {}
3434
note: required by a bound in `Foo`
3535
--> $DIR/issue-67185-2.rs:15:25
3636
|
37-
LL | trait Foo
38-
| --- required by a bound in this
39-
...
4037
LL | <u8 as Baz>::Quaks: Bar,
4138
| ^^^ required by this bound in `Foo`
4239

@@ -52,9 +49,6 @@ LL | impl Foo for FooImpl {}
5249
note: required by a bound in `Foo`
5350
--> $DIR/issue-67185-2.rs:14:30
5451
|
55-
LL | trait Foo
56-
| --- required by a bound in this
57-
LL | where
5852
LL | [<u8 as Baz>::Quaks; 2]: Bar,
5953
| ^^^ required by this bound in `Foo`
6054

@@ -70,9 +64,6 @@ LL | fn f(_: impl Foo) {}
7064
note: required by a bound in `Foo`
7165
--> $DIR/issue-67185-2.rs:14:30
7266
|
73-
LL | trait Foo
74-
| --- required by a bound in this
75-
LL | where
7667
LL | [<u8 as Baz>::Quaks; 2]: Bar,
7768
| ^^^ required by this bound in `Foo`
7869

@@ -88,9 +79,6 @@ LL | fn f(_: impl Foo) {}
8879
note: required by a bound in `Foo`
8980
--> $DIR/issue-67185-2.rs:15:25
9081
|
91-
LL | trait Foo
92-
| --- required by a bound in this
93-
...
9482
LL | <u8 as Baz>::Quaks: Bar,
9583
| ^^^ required by this bound in `Foo`
9684

src/test/ui/const-generics/issues/issue-73260.stderr

-6
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ LL | let x: Arr<{usize::MAX}> = Arr {};
99
note: required by a bound in `Arr`
1010
--> $DIR/issue-73260.rs:6:37
1111
|
12-
LL | struct Arr<const N: usize>
13-
| --- required by a bound in this
14-
LL | where
1512
LL | Assert::<{N < usize::MAX / 2}>: IsTrue,
1613
| ^^^^^^ required by this bound in `Arr`
1714

@@ -26,9 +23,6 @@ LL | let x: Arr<{usize::MAX}> = Arr {};
2623
note: required by a bound in `Arr`
2724
--> $DIR/issue-73260.rs:6:37
2825
|
29-
LL | struct Arr<const N: usize>
30-
| --- required by a bound in this
31-
LL | where
3226
LL | Assert::<{N < usize::MAX / 2}>: IsTrue,
3327
| ^^^^^^ required by this bound in `Arr`
3428

src/test/ui/const-generics/issues/issue-79674.stderr

-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ LL | requires_distinct("str", 12);
99
note: required by a bound in `requires_distinct`
1010
--> $DIR/issue-79674.rs:23:37
1111
|
12-
LL | fn requires_distinct<A, B>(_a: A, _b: B) where
13-
| ----------------- required by a bound in this
14-
LL | A: MiniTypeId, B: MiniTypeId,
1512
LL | Lift<{is_same_type::<A, B>()}>: IsFalse {}
1613
| ^^^^^^^ required by this bound in `requires_distinct`
1714

src/test/ui/const-generics/issues/issue-86530.stderr

-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ LL | z(" ");
99
note: required by a bound in `z`
1010
--> $DIR/issue-86530.rs:10:8
1111
|
12-
LL | fn z<T>(t: T)
13-
| - required by a bound in this
14-
LL | where
1512
LL | T: X,
1613
| ^ required by this bound in `z`
1714

src/test/ui/const-generics/occurs-check/unused-substs-1.stderr

-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ LL | let _ = A;
88
note: required by a bound in `A`
99
--> $DIR/unused-substs-1.rs:9:11
1010
|
11-
LL | struct A<const N: usize>
12-
| - required by a bound in this
13-
LL | where
1411
LL | A<N>: Bar<N>;
1512
| ^^^^^^ required by this bound in `A`
1613

src/test/ui/generator/generator-yielding-or-returning-itself.stderr

-4
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ LL | | })
1818
note: required by a bound in `want_cyclic_generator_return`
1919
--> $DIR/generator-yielding-or-returning-itself.rs:10:36
2020
|
21-
LL | pub fn want_cyclic_generator_return<T>(_: T)
22-
| ---------------------------- required by a bound in this
2321
LL | where T: Generator<Yield = (), Return = T>
2422
| ^^^^^^^^^^ required by this bound in `want_cyclic_generator_return`
2523

@@ -43,8 +41,6 @@ LL | | })
4341
note: required by a bound in `want_cyclic_generator_yield`
4442
--> $DIR/generator-yielding-or-returning-itself.rs:23:24
4543
|
46-
LL | pub fn want_cyclic_generator_yield<T>(_: T)
47-
| --------------------------- required by a bound in this
4844
LL | where T: Generator<Yield = T, Return = ()>
4945
| ^^^^^^^^^ required by this bound in `want_cyclic_generator_yield`
5046

src/test/ui/generic-associated-types/bugs/issue-88460.stderr

-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ LL | test(Foo);
1010
note: required by a bound in `test`
1111
--> $DIR/issue-88460.rs:15:27
1212
|
13-
LL | fn test<T>(value: T)
14-
| ---- required by a bound in this
15-
...
1613
LL | for<'a> T::Assoc<'a>: Marker,
1714
| ^^^^^^ required by this bound in `test`
1815

src/test/ui/generic-associated-types/issue-101020.stderr

-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ LL | impl<'a, T, F: 'a> FuncInput<'a, F> for T where F: Foo<T> {}
1414
note: required by a bound in `LendingIterator::consume`
1515
--> $DIR/issue-101020.rs:9:33
1616
|
17-
LL | fn consume<F>(self, _f: F)
18-
| ------- required by a bound in this
19-
...
2017
LL | for<'a> Self::Item<'a>: FuncInput<'a, Self::Item<'a>>,
2118
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `LendingIterator::consume`
2219

src/test/ui/higher-rank-trait-bounds/hrtb-higher-ranker-supertraits-transitive.stderr

-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ LL | want_bar_for_any_ccx(b);
99
note: required by a bound in `want_bar_for_any_ccx`
1010
--> $DIR/hrtb-higher-ranker-supertraits-transitive.rs:32:15
1111
|
12-
LL | fn want_bar_for_any_ccx<B>(b: &B)
13-
| -------------------- required by a bound in this
1412
LL | where B : for<'ccx> Bar<'ccx>
1513
| ^^^^^^^^^^^^^^^^^^^ required by this bound in `want_bar_for_any_ccx`
1614
help: consider further restricting this bound

0 commit comments

Comments
 (0)