Skip to content

Commit

Permalink
review comment: change wording
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Jan 30, 2024
1 parent 97ec2be commit 43fdb12
Show file tree
Hide file tree
Showing 30 changed files with 55 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3012,7 +3012,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
}
}
let mut a = "a";
let mut this = "this";
let mut this = "this bound";
let mut note = None;
let mut help = None;
if let ty::PredicateKind::Clause(clause) = predicate.kind().skip_binder()
Expand All @@ -3038,7 +3038,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
.any(|param| tcx.def_span(param.def_id) == span)
{
a = "an implicit `Sized`";
this = "the implicit `Sized` requirement on this";
this = "the implicit `Sized` requirement on this type parameter";
}
if let Some(hir::Node::TraitItem(hir::TraitItem {
ident,
Expand Down Expand Up @@ -3108,7 +3108,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
};
let descr = format!("required by {a} bound in `{item_name}`");
if span.is_visible(sm) {
let msg = format!("required by {this} bound in `{short_item_name}`");
let msg = format!("required by {this} in `{short_item_name}`");
multispan.push_span_label(span, msg);
err.span_note(multispan, descr);
} else {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/associated-types/issue-20005.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ note: required by an implicit `Sized` bound in `From`
--> $DIR/issue-20005.rs:1:12
|
LL | trait From<Src> {
| ^^^ required by the implicit `Sized` requirement on this bound in `From`
| ^^^ required by the implicit `Sized` requirement on this type parameter in `From`
help: consider further restricting `Self`
|
LL | ) -> <Dst as From<Self>>::Result where Dst: From<Self>, Self: Sized {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/dst/dst-sized-trait-param.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ note: required by an implicit `Sized` bound in `Foo`
--> $DIR/dst-sized-trait-param.rs:5:11
|
LL | trait Foo<T> : Sized { fn take(self, x: &T) { } } // Note: T is sized
| ^ required by the implicit `Sized` requirement on this bound in `Foo`
| ^ required by the implicit `Sized` requirement on this type parameter in `Foo`
help: consider relaxing the implicit `Sized` restriction
|
LL | trait Foo<T: ?Sized> : Sized { fn take(self, x: &T) { } } // Note: T is sized
Expand Down
8 changes: 4 additions & 4 deletions tests/ui/extern/extern-types-unsized.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ note: required by an implicit `Sized` bound in `assert_sized`
--> $DIR/extern-types-unsized.rs:19:17
|
LL | fn assert_sized<T>() {}
| ^ required by the implicit `Sized` requirement on this bound in `assert_sized`
| ^ required by the implicit `Sized` requirement on this type parameter in `assert_sized`
help: consider relaxing the implicit `Sized` restriction
|
LL | fn assert_sized<T: ?Sized>() {}
Expand All @@ -31,7 +31,7 @@ note: required by an implicit `Sized` bound in `assert_sized`
--> $DIR/extern-types-unsized.rs:19:17
|
LL | fn assert_sized<T>() {}
| ^ required by the implicit `Sized` requirement on this bound in `assert_sized`
| ^ required by the implicit `Sized` requirement on this type parameter in `assert_sized`
help: consider relaxing the implicit `Sized` restriction
|
LL | fn assert_sized<T: ?Sized>() {}
Expand All @@ -53,7 +53,7 @@ note: required by an implicit `Sized` bound in `assert_sized`
--> $DIR/extern-types-unsized.rs:19:17
|
LL | fn assert_sized<T>() {}
| ^ required by the implicit `Sized` requirement on this bound in `assert_sized`
| ^ required by the implicit `Sized` requirement on this type parameter in `assert_sized`
help: consider relaxing the implicit `Sized` restriction
|
LL | fn assert_sized<T: ?Sized>() {}
Expand All @@ -75,7 +75,7 @@ note: required by an implicit `Sized` bound in `assert_sized`
--> $DIR/extern-types-unsized.rs:19:17
|
LL | fn assert_sized<T>() {}
| ^ required by the implicit `Sized` requirement on this bound in `assert_sized`
| ^ required by the implicit `Sized` requirement on this type parameter in `assert_sized`
help: consider relaxing the implicit `Sized` restriction
|
LL | fn assert_sized<T: ?Sized>() {}
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/generic-associated-types/issue-88287.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ note: required by an implicit `Sized` bound in `<T as SearchableResourceExt<Crit
--> $DIR/issue-88287.rs:24:6
|
LL | impl<T, Criteria> SearchableResourceExt<Criteria> for T
| ^ required by the implicit `Sized` requirement on this bound in `<T as SearchableResourceExt<Criteria>>`
| ^ required by the implicit `Sized` requirement on this type parameter in `<T as SearchableResourceExt<Criteria>>`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
LL - A: SearchableResource<B> + ?Sized + 'f,
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/impl-trait/in-trait/wf-bounds.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ note: required by an implicit `Sized` bound in `Wf`
--> $DIR/wf-bounds.rs:7:10
|
LL | trait Wf<T> {
| ^ required by the implicit `Sized` requirement on this bound in `Wf`
| ^ required by the implicit `Sized` requirement on this type parameter in `Wf`
help: consider relaxing the implicit `Sized` restriction
|
LL | trait Wf<T: ?Sized> {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/issues/issue-10412.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ note: required by an implicit `Sized` bound in `Serializable`
--> $DIR/issue-10412.rs:1:27
|
LL | trait Serializable<'self, T> {
| ^ required by the implicit `Sized` requirement on this bound in `Serializable`
| ^ required by the implicit `Sized` requirement on this type parameter in `Serializable`
help: consider relaxing the implicit `Sized` restriction
|
LL | trait Serializable<'self, T: ?Sized> {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/issues/issue-18919.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ note: required by an implicit `Sized` bound in `Option`
--> $DIR/issue-18919.rs:7:13
|
LL | enum Option<T> {
| ^ required by the implicit `Sized` requirement on this bound in `Option`
| ^ required by the implicit `Sized` requirement on this type parameter in `Option`
help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
--> $DIR/issue-18919.rs:7:13
|
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/issues/issue-23281.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ note: required by an implicit `Sized` bound in `Vec`
--> $DIR/issue-23281.rs:8:12
|
LL | struct Vec<T> {
| ^ required by the implicit `Sized` requirement on this bound in `Vec`
| ^ required by the implicit `Sized` requirement on this type parameter in `Vec`
help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
--> $DIR/issue-23281.rs:8:12
|
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/issues/issue-87199.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ note: required by an implicit `Sized` bound in `ref_arg`
--> $DIR/issue-87199.rs:10:12
|
LL | fn ref_arg<T: ?Send>(_: &T) {}
| ^ required by the implicit `Sized` requirement on this bound in `ref_arg`
| ^ required by the implicit `Sized` requirement on this type parameter in `ref_arg`
help: consider relaxing the implicit `Sized` restriction
|
LL | fn ref_arg<T: ?Send + ?Sized>(_: &T) {}
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/malformed/do-not-ice-on-note_and_explain.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ note: required by an implicit `Sized` bound in `A`
--> $DIR/do-not-ice-on-note_and_explain.rs:1:10
|
LL | struct A<B>(B);
| ^ required by the implicit `Sized` requirement on this bound in `A`
| ^ required by the implicit `Sized` requirement on this type parameter in `A`
help: you could relax the implicit `Sized` bound on `B` if it were used through indirection like `&B` or `Box<B>`
--> $DIR/do-not-ice-on-note_and_explain.rs:1:10
|
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/methods/issues/issue-61525.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ note: required by an implicit `Sized` bound in `Example::query`
--> $DIR/issue-61525.rs:2:14
|
LL | fn query<Q>(self, q: Q);
| ^ required by the implicit `Sized` requirement on this bound in `Example::query`
| ^ required by the implicit `Sized` requirement on this type parameter in `Example::query`
help: consider relaxing the implicit `Sized` restriction
|
LL | fn query<Q: ?Sized>(self, q: Q);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ note: required by an implicit `Sized` bound in `Bar`
--> $DIR/object-safety-supertrait-mentions-Self.rs:4:11
|
LL | trait Bar<T> {
| ^ required by the implicit `Sized` requirement on this bound in `Bar`
| ^ required by the implicit `Sized` requirement on this type parameter in `Bar`
help: consider further restricting `Self`
|
LL | trait Baz : Bar<Self> + Sized {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/str/str-mut-idx.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ note: required by an implicit `Sized` bound in `bot`
--> $DIR/str-mut-idx.rs:1:8
|
LL | fn bot<T>() -> T { loop {} }
| ^ required by the implicit `Sized` requirement on this bound in `bot`
| ^ required by the implicit `Sized` requirement on this type parameter in `bot`
help: consider relaxing the implicit `Sized` restriction
|
LL | fn bot<T: ?Sized>() -> T { loop {} }
Expand Down
10 changes: 5 additions & 5 deletions tests/ui/suggestions/adt-param-with-implicit-sized-bound.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ note: required by an implicit `Sized` bound in `X`
--> $DIR/adt-param-with-implicit-sized-bound.rs:18:10
|
LL | struct X<T>(T);
| ^ required by the implicit `Sized` requirement on this bound in `X`
| ^ required by the implicit `Sized` requirement on this type parameter in `X`
help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
--> $DIR/adt-param-with-implicit-sized-bound.rs:18:10
|
Expand All @@ -34,7 +34,7 @@ note: required by an implicit `Sized` bound in `Struct1`
--> $DIR/adt-param-with-implicit-sized-bound.rs:8:16
|
LL | struct Struct1<T>{
| ^ required by the implicit `Sized` requirement on this bound in `Struct1`
| ^ required by the implicit `Sized` requirement on this type parameter in `Struct1`
help: consider further restricting `Self`
|
LL | fn func1() -> Struct1<Self> where Self: Sized;
Expand All @@ -54,7 +54,7 @@ note: required by an implicit `Sized` bound in `Struct2`
--> $DIR/adt-param-with-implicit-sized-bound.rs:11:20
|
LL | struct Struct2<'a, T>{
| ^ required by the implicit `Sized` requirement on this bound in `Struct2`
| ^ required by the implicit `Sized` requirement on this type parameter in `Struct2`
help: consider further restricting `Self`
|
LL | fn func2<'a>() -> Struct2<'a, Self> where Self: Sized;
Expand All @@ -74,7 +74,7 @@ note: required by an implicit `Sized` bound in `Struct3`
--> $DIR/adt-param-with-implicit-sized-bound.rs:14:16
|
LL | struct Struct3<T>{
| ^ required by the implicit `Sized` requirement on this bound in `Struct3`
| ^ required by the implicit `Sized` requirement on this type parameter in `Struct3`
help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
--> $DIR/adt-param-with-implicit-sized-bound.rs:14:16
|
Expand All @@ -97,7 +97,7 @@ note: required by an implicit `Sized` bound in `Struct4`
--> $DIR/adt-param-with-implicit-sized-bound.rs:20:16
|
LL | struct Struct4<T>{
| ^ required by the implicit `Sized` requirement on this bound in `Struct4`
| ^ required by the implicit `Sized` requirement on this type parameter in `Struct4`
help: consider further restricting `Self`
|
LL | fn func4() -> Struct4<Self> where Self: Sized;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ note: required by an implicit `Sized` bound in `A`
--> $DIR/issue-85943-no-suggest-unsized-indirection-in-where-clause.rs:4:10
|
LL | struct A<T>(T) where T: Send;
| ^ required by the implicit `Sized` requirement on this bound in `A`
| ^ required by the implicit `Sized` requirement on this type parameter in `A`
help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
--> $DIR/issue-85943-no-suggest-unsized-indirection-in-where-clause.rs:4:10
|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ note: required by an implicit `Sized` bound in `Wrapper`
--> $DIR/removal-of-multiline-trait-bound-in-where-clause.rs:1:16
|
LL | struct Wrapper<T>(T);
| ^ required by the implicit `Sized` requirement on this bound in `Wrapper`
| ^ required by the implicit `Sized` requirement on this type parameter in `Wrapper`
help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
--> $DIR/removal-of-multiline-trait-bound-in-where-clause.rs:1:16
|
Expand Down Expand Up @@ -39,7 +39,7 @@ note: required by an implicit `Sized` bound in `Wrapper`
--> $DIR/removal-of-multiline-trait-bound-in-where-clause.rs:1:16
|
LL | struct Wrapper<T>(T);
| ^ required by the implicit `Sized` requirement on this bound in `Wrapper`
| ^ required by the implicit `Sized` requirement on this type parameter in `Wrapper`
help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
--> $DIR/removal-of-multiline-trait-bound-in-where-clause.rs:1:16
|
Expand All @@ -64,7 +64,7 @@ note: required by an implicit `Sized` bound in `Wrapper`
--> $DIR/removal-of-multiline-trait-bound-in-where-clause.rs:1:16
|
LL | struct Wrapper<T>(T);
| ^ required by the implicit `Sized` requirement on this bound in `Wrapper`
| ^ required by the implicit `Sized` requirement on this type parameter in `Wrapper`
help: you could relax the implicit `Sized` bound on `T` if it were used through indirection like `&T` or `Box<T>`
--> $DIR/removal-of-multiline-trait-bound-in-where-clause.rs:1:16
|
Expand Down
18 changes: 9 additions & 9 deletions tests/ui/trait-bounds/unsized-bound.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ note: required by an implicit `Sized` bound in `Trait`
--> $DIR/unsized-bound.rs:1:13
|
LL | trait Trait<A> {}
| ^ required by the implicit `Sized` requirement on this bound in `Trait`
| ^ required by the implicit `Sized` requirement on this type parameter in `Trait`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
LL - impl<A, B> Trait<(A, B)> for (A, B) where A: ?Sized, B: ?Sized, {}
Expand Down Expand Up @@ -50,7 +50,7 @@ note: required by an implicit `Sized` bound in `Trait`
--> $DIR/unsized-bound.rs:1:13
|
LL | trait Trait<A> {}
| ^ required by the implicit `Sized` requirement on this bound in `Trait`
| ^ required by the implicit `Sized` requirement on this type parameter in `Trait`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
LL - impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
Expand Down Expand Up @@ -100,7 +100,7 @@ note: required by an implicit `Sized` bound in `Trait2`
--> $DIR/unsized-bound.rs:9:14
|
LL | trait Trait2<A> {}
| ^ required by the implicit `Sized` requirement on this bound in `Trait2`
| ^ required by the implicit `Sized` requirement on this type parameter in `Trait2`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
LL - impl<A: ?Sized, B: ?Sized> Trait2<(A, B)> for (A, B) {}
Expand Down Expand Up @@ -138,7 +138,7 @@ note: required by an implicit `Sized` bound in `Trait3`
--> $DIR/unsized-bound.rs:13:14
|
LL | trait Trait3<A> {}
| ^ required by the implicit `Sized` requirement on this bound in `Trait3`
| ^ required by the implicit `Sized` requirement on this type parameter in `Trait3`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
LL - impl<A> Trait3<A> for A where A: ?Sized {}
Expand All @@ -161,7 +161,7 @@ note: required by an implicit `Sized` bound in `Trait4`
--> $DIR/unsized-bound.rs:16:14
|
LL | trait Trait4<A> {}
| ^ required by the implicit `Sized` requirement on this bound in `Trait4`
| ^ required by the implicit `Sized` requirement on this type parameter in `Trait4`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
LL - impl<A: ?Sized> Trait4<A> for A {}
Expand All @@ -184,7 +184,7 @@ note: required by an implicit `Sized` bound in `Trait5`
--> $DIR/unsized-bound.rs:19:14
|
LL | trait Trait5<A, B> {}
| ^ required by the implicit `Sized` requirement on this bound in `Trait5`
| ^ required by the implicit `Sized` requirement on this type parameter in `Trait5`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
LL - impl<X, Y> Trait5<X, Y> for X where X: ?Sized {}
Expand All @@ -207,7 +207,7 @@ note: required by an implicit `Sized` bound in `Trait6`
--> $DIR/unsized-bound.rs:22:14
|
LL | trait Trait6<A, B> {}
| ^ required by the implicit `Sized` requirement on this bound in `Trait6`
| ^ required by the implicit `Sized` requirement on this type parameter in `Trait6`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
LL - impl<X: ?Sized, Y> Trait6<X, Y> for X {}
Expand All @@ -230,7 +230,7 @@ note: required by an implicit `Sized` bound in `Trait7`
--> $DIR/unsized-bound.rs:25:17
|
LL | trait Trait7<A, B> {}
| ^ required by the implicit `Sized` requirement on this bound in `Trait7`
| ^ required by the implicit `Sized` requirement on this type parameter in `Trait7`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
LL - impl<X, Y> Trait7<X, Y> for X where Y: ?Sized {}
Expand All @@ -253,7 +253,7 @@ note: required by an implicit `Sized` bound in `Trait8`
--> $DIR/unsized-bound.rs:28:17
|
LL | trait Trait8<A, B> {}
| ^ required by the implicit `Sized` requirement on this bound in `Trait8`
| ^ required by the implicit `Sized` requirement on this type parameter in `Trait8`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
LL - impl<X, Y: ?Sized> Trait8<X, Y> for X {}
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/traits/issue-28576.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ note: required by an implicit `Sized` bound in `Foo`
--> $DIR/issue-28576.rs:1:15
|
LL | pub trait Foo<RHS=Self> {
| ^^^^^^^^ required by the implicit `Sized` requirement on this bound in `Foo`
| ^^^^^^^^ required by the implicit `Sized` requirement on this type parameter in `Foo`
help: consider further restricting `Self`
|
LL | pub trait Bar: Foo<Assoc=()> + Sized {
Expand All @@ -49,7 +49,7 @@ note: required by an implicit `Sized` bound in `Foo`
--> $DIR/issue-28576.rs:1:15
|
LL | pub trait Foo<RHS=Self> {
| ^^^^^^^^ required by the implicit `Sized` requirement on this bound in `Foo`
| ^^^^^^^^ required by the implicit `Sized` requirement on this type parameter in `Foo`
help: consider further restricting `Self`
|
LL | ) where Self: Sized;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ LL | needs_bar::<T::Assoc1>();
| ^^^^^^^^^
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`recursive_self_normalization_2`)
note: required by a bound in `needs_bar`
note: required by an implicit `Sized` bound in `needs_bar`
--> $DIR/recursive-self-normalization-2.rs:12:14
|
LL | fn needs_bar<S: Bar>() {}
| ^ required by this bound in `needs_bar`
| ^ required by the implicit `Sized` requirement on this type parameter in `needs_bar`
help: consider relaxing the implicit `Sized` restriction
|
LL | fn needs_bar<S: Bar + ?Sized>() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ LL | needs_bar::<T::Assoc>();
| ^^^^^^^^
|
= help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`recursive_self_normalization`)
note: required by a bound in `needs_bar`
note: required by an implicit `Sized` bound in `needs_bar`
--> $DIR/recursive-self-normalization.rs:8:14
|
LL | fn needs_bar<S: Bar>() {}
| ^ required by this bound in `needs_bar`
| ^ required by the implicit `Sized` requirement on this type parameter in `needs_bar`
help: consider relaxing the implicit `Sized` restriction
|
LL | fn needs_bar<S: Bar + ?Sized>() {}
Expand Down
Loading

0 comments on commit 43fdb12

Please sign in to comment.