Tweak wording
This commit is contained in:
parent
6277fb0a3f
commit
25ad0478cb
6 changed files with 13 additions and 13 deletions
|
|
@ -361,10 +361,10 @@ pub fn suggest_constraining_type_params<'a>(
|
|||
trait_names.dedup();
|
||||
let n = trait_names.len();
|
||||
let stable = if all_stable { "" } else { "unstable " };
|
||||
let trait_ = if all_known { "trait" } else { "" };
|
||||
format!("{stable}{trait_}{} {}", pluralize!(n), match &trait_names[..] {
|
||||
[t] => t.to_string(),
|
||||
[ts @ .., last] => format!("{} and {last}", ts.join(", ")),
|
||||
let trait_ = if all_known { format!("trait{}", pluralize!(n)) } else { String::new() };
|
||||
format!("{stable}{trait_}{}", match &trait_names[..] {
|
||||
[t] => format!(" {t}"),
|
||||
[ts @ .., last] => format!(" {} and {last}", ts.join(", ")),
|
||||
[] => return false,
|
||||
},)
|
||||
} else {
|
||||
|
|
@ -531,7 +531,7 @@ pub fn suggest_constraining_type_params<'a>(
|
|||
let (span, post, suggestion, msg) = suggestions.pop().unwrap();
|
||||
let msg = match msg {
|
||||
SuggestChangingConstraintsMessage::RestrictBoundFurther => {
|
||||
format!("consider further restricting this bound with {post}")
|
||||
format!("consider further restricting this bound")
|
||||
}
|
||||
SuggestChangingConstraintsMessage::RestrictTypeFurther { ty }
|
||||
| SuggestChangingConstraintsMessage::RestrictType { ty }
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ LL | trait UnsafeCopy<'a, T: Copy>
|
|||
LL | where
|
||||
LL | for<'b> <Self as UnsafeCopy<'b, T>>::Item: std::ops::Deref<Target = T>,
|
||||
| ^^^^^^^^^^ required by this bound in `UnsafeCopy`
|
||||
help: consider further restricting this bound with `<Target = T>`
|
||||
help: consider further restricting this bound
|
||||
|
|
||||
LL | impl<T: Copy + std::ops::Deref<Target = T>> UnsafeCopy<'_, T> for T {
|
||||
| ++++++++++++
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ note: required by a bound in `UnsafeCopy::Item`
|
|||
|
|
||||
LL | type Item<'a>: std::ops::Deref<Target = T>;
|
||||
| ^^^^^^^^^^ required by this bound in `UnsafeCopy::Item`
|
||||
help: consider further restricting this bound with `<Target = T>`
|
||||
help: consider further restricting this bound
|
||||
|
|
||||
LL | impl<T: Copy + std::ops::Deref<Target = T>> UnsafeCopy<T> for T {
|
||||
| ++++++++++++
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ note: tuple struct defined here
|
|||
|
|
||||
LL | struct A<B>(B);
|
||||
| ^
|
||||
help: consider further restricting this bound with `<Output = B>`
|
||||
help: consider further restricting this bound
|
||||
|
|
||||
LL | impl<B> Add for A<B> where B: Add<Output = B> {
|
||||
| ++++++++++++
|
||||
|
|
@ -58,7 +58,7 @@ note: tuple struct defined here
|
|||
|
|
||||
LL | struct C<B>(B);
|
||||
| ^
|
||||
help: consider further restricting this bound with `<Output = B>`
|
||||
help: consider further restricting this bound
|
||||
|
|
||||
LL | impl<B: Add<Output = B>> Add for C<B> {
|
||||
| ++++++++++++
|
||||
|
|
@ -94,7 +94,7 @@ note: tuple struct defined here
|
|||
|
|
||||
LL | struct E<B>(B);
|
||||
| ^
|
||||
help: consider further restricting this bound with `<Output = B>`
|
||||
help: consider further restricting this bound
|
||||
|
|
||||
LL | impl<B: Add<Output = B>> Add for E<B> where <B as Add>::Output = B {
|
||||
| ++++++++++++
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ LL | Ok(self)
|
|||
| this argument influences the type of `Ok`
|
||||
note: tuple variant defined here
|
||||
--> $SRC_DIR/core/src/result.rs:LL:COL
|
||||
help: consider further restricting this bound with `<Output = T>`
|
||||
help: consider further restricting this bound
|
||||
|
|
||||
LL | impl<T: TryAdd<Output = T>> TryAdd for Option<T> {
|
||||
| ++++++++++++
|
||||
|
|
@ -47,7 +47,7 @@ LL | Ok(self)
|
|||
| this argument influences the type of `Ok`
|
||||
note: tuple variant defined here
|
||||
--> $SRC_DIR/core/src/result.rs:LL:COL
|
||||
help: consider further restricting this bound with `, Output = T`
|
||||
help: consider further restricting this bound
|
||||
|
|
||||
LL | impl<T: TryAdd<Error = X, Output = T>> TryAdd for Other<T> {
|
||||
| ++++++++++++
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ LL | return a.bar();
|
|||
= note: expected type parameter `B`
|
||||
found associated type `<A as MyTrait>::T`
|
||||
= note: the caller chooses a type for `B` which can be different from `<A as MyTrait>::T`
|
||||
help: consider further restricting this bound with `<T = B>`
|
||||
help: consider further restricting this bound
|
||||
|
|
||||
LL | pub fn foo<A: MyTrait<T = B>, B>(a: A) -> B {
|
||||
| +++++++
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue