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

Lines changed: 0 additions & 11 deletions
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

Lines changed: 0 additions & 6 deletions
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

Lines changed: 0 additions & 9 deletions
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

Lines changed: 0 additions & 3 deletions
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

Lines changed: 0 additions & 3 deletions
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

Lines changed: 0 additions & 3 deletions
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

Lines changed: 0 additions & 9 deletions
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

Lines changed: 0 additions & 3 deletions
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

Lines changed: 0 additions & 3 deletions
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

Lines changed: 0 additions & 6 deletions
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

0 commit comments

Comments
 (0)