Skip to content

Commit 84a1993

Browse files
committed
Reword "Required because of the requirements on the impl of ..."
1 parent 8064a49 commit 84a1993

File tree

159 files changed

+279
-279
lines changed

Some content is hidden

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

159 files changed

+279
-279
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2537,9 +2537,9 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
25372537
parent_trait_pred.remap_constness_diag(param_env);
25382538
let parent_def_id = parent_trait_pred.def_id();
25392539
let msg = format!(
2540-
"required because of the requirements on the impl of `{}` for `{}`",
2541-
parent_trait_pred.print_modifiers_and_trait_path(),
2542-
parent_trait_pred.skip_binder().self_ty()
2540+
"required for `{}` to implement `{}`",
2541+
parent_trait_pred.skip_binder().self_ty(),
2542+
parent_trait_pred.print_modifiers_and_trait_path()
25432543
);
25442544
let mut is_auto_trait = false;
25452545
match self.tcx.hir().get_if_local(data.impl_def_id) {
@@ -2608,9 +2608,9 @@ impl<'a, 'tcx> InferCtxtExt<'tcx> for InferCtxt<'a, 'tcx> {
26082608
pluralize!(count)
26092609
));
26102610
err.note(&format!(
2611-
"required because of the requirements on the impl of `{}` for `{}`",
2612-
parent_trait_pred.print_modifiers_and_trait_path(),
2613-
parent_trait_pred.skip_binder().self_ty()
2611+
"required for `{}` to implement `{}`",
2612+
parent_trait_pred.skip_binder().self_ty(),
2613+
parent_trait_pred.print_modifiers_and_trait_path()
26142614
));
26152615
}
26162616
// #74711: avoid a stack overflow

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ error[E0277]: the trait bound `T: Clone` is not satisfied
3939
LL | type Bar: Clone = Vec<T>;
4040
| ^^^^^^ the trait `Clone` is not implemented for `T`
4141
|
42-
= note: required because of the requirements on the impl of `Clone` for `Vec<T>`
42+
= note: required for `Vec<T>` to implement `Clone`
4343
note: required by a bound in `Foo::Bar`
4444
--> $DIR/defaults-suitability.rs:28:15
4545
|
@@ -83,7 +83,7 @@ error[E0277]: the trait bound `<Self as Foo2<T>>::Baz: Clone` is not satisfied
8383
LL | type Bar: Clone = Vec<Self::Baz>;
8484
| ^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `<Self as Foo2<T>>::Baz`
8585
|
86-
= note: required because of the requirements on the impl of `Clone` for `Vec<<Self as Foo2<T>>::Baz>`
86+
= note: required for `Vec<<Self as Foo2<T>>::Baz>` to implement `Clone`
8787
note: required by a bound in `Foo2::Bar`
8888
--> $DIR/defaults-suitability.rs:65:15
8989
|
@@ -100,7 +100,7 @@ error[E0277]: the trait bound `<Self as Foo25<T>>::Baz: Clone` is not satisfied
100100
LL | type Bar: Clone = Vec<Self::Baz>;
101101
| ^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `<Self as Foo25<T>>::Baz`
102102
|
103-
= note: required because of the requirements on the impl of `Clone` for `Vec<<Self as Foo25<T>>::Baz>`
103+
= note: required for `Vec<<Self as Foo25<T>>::Baz>` to implement `Clone`
104104
note: required by a bound in `Foo25::Bar`
105105
--> $DIR/defaults-suitability.rs:74:15
106106
|

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ LL | impl X<'_> for u32
55
| ^^^^^^^^^^^^^^^^^^
66
|
77
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`hr_associated_type_bound_2`)
8-
note: required because of the requirements on the impl of `for<'b> X<'b>` for `u32`
8+
note: required for `u32` to implement `for<'b> X<'b>`
99
--> $DIR/hr-associated-type-bound-2.rs:11:6
1010
|
1111
LL | impl X<'_> for u32
1212
| ^^^^^ ^^^
1313
= note: 128 redundant requirements hidden
14-
= note: required because of the requirements on the impl of `for<'b> X<'b>` for `u32`
14+
= note: required for `u32` to implement `for<'b> X<'b>`
1515

1616
error: aborting due to previous error
1717

src/test/ui/associated-types/impl-wf-cycle-1.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ error[E0275]: overflow evaluating the requirement `<(T,) as Grault>::A == _`
44
LL | impl<T: Grault> Grault for (T,)
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
note: required because of the requirements on the impl of `Grault` for `(T,)`
7+
note: required for `(T,)` to implement `Grault`
88
--> $DIR/impl-wf-cycle-1.rs:15:17
99
|
1010
LL | impl<T: Grault> Grault for (T,)
1111
| ^^^^^^ ^^^^
1212
= note: 1 redundant requirement hidden
13-
= note: required because of the requirements on the impl of `Grault` for `(T,)`
13+
= note: required for `(T,)` to implement `Grault`
1414

1515
error: aborting due to previous error
1616

src/test/ui/associated-types/impl-wf-cycle-2.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error[E0275]: overflow evaluating the requirement `<(T,) as Grault>::A == _`
44
LL | impl<T: Grault> Grault for (T,)
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
7-
note: required because of the requirements on the impl of `Grault` for `(T,)`
7+
note: required for `(T,)` to implement `Grault`
88
--> $DIR/impl-wf-cycle-2.rs:7:17
99
|
1010
LL | impl<T: Grault> Grault for (T,)

src/test/ui/associated-types/issue-44153.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ note: expected this to be `&()`
99
|
1010
LL | type Element = ();
1111
| ^^
12-
note: required because of the requirements on the impl of `Visit` for `()`
12+
note: required for `()` to implement `Visit`
1313
--> $DIR/issue-44153.rs:13:10
1414
|
1515
LL | impl<'a> Visit for () where

src/test/ui/associated-types/issue-65774-1.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ LL | let closure = |config: &mut <S as MPU>::MpuConfig| writer.my_write(
1818
| ^^^^^^^ the trait `MyDisplay` is not implemented for `T`
1919
|
2020
= help: the trait `MyDisplay` is implemented for `&'a mut T`
21-
note: required because of the requirements on the impl of `MyDisplay` for `&mut T`
21+
note: required for `&mut T` to implement `MyDisplay`
2222
--> $DIR/issue-65774-1.rs:5:24
2323
|
2424
LL | impl<'a, T: MyDisplay> MyDisplay for &'a mut T { }

src/test/ui/associated-types/substs-ppaux.normal.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ LL | <str as Foo<u8>>::bar;
7777
| ^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
7878
|
7979
= help: the trait `Sized` is not implemented for `str`
80-
note: required because of the requirements on the impl of `Foo<'_, '_, u8>` for `str`
80+
note: required for `str` to implement `Foo<'_, '_, u8>`
8181
--> $DIR/substs-ppaux.rs:11:17
8282
|
8383
LL | impl<'a,'b,T,S> Foo<'a, 'b, S> for T {}

src/test/ui/associated-types/substs-ppaux.verbose.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ LL | <str as Foo<u8>>::bar;
7777
| ^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
7878
|
7979
= help: the trait `Sized` is not implemented for `str`
80-
note: required because of the requirements on the impl of `Foo<'_#0r, '_#1r, u8>` for `str`
80+
note: required for `str` to implement `Foo<'_#0r, '_#1r, u8>`
8181
--> $DIR/substs-ppaux.rs:11:17
8282
|
8383
LL | impl<'a,'b,T,S> Foo<'a, 'b, S> for T {}

src/test/ui/async-await/issue-68112.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ LL | require_send(send_fut);
4141
| ^^^^^^^^^^^^ `RefCell<i32>` cannot be shared between threads safely
4242
|
4343
= help: the trait `Sync` is not implemented for `RefCell<i32>`
44-
= note: required because of the requirements on the impl of `Send` for `Arc<RefCell<i32>>`
44+
= note: required for `Arc<RefCell<i32>>` to implement `Send`
4545
note: required because it's used within this `async fn` body
4646
--> $DIR/issue-68112.rs:47:31
4747
|

0 commit comments

Comments
 (0)