mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Fix typo in hir lowering lint diag
This commit is contained in:
parent
ecade534c6
commit
5da1ba41b3
@ -411,7 +411,9 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
|
||||
Applicability::MachineApplicable,
|
||||
);
|
||||
if !is_dyn_compatible {
|
||||
diag.note(format!("`{trait_name}` it is dyn-incompatible, so it can't be `dyn`"));
|
||||
diag.note(format!(
|
||||
"`{trait_name}` is dyn-incompatible, otherwise a trait object could be used"
|
||||
));
|
||||
} else {
|
||||
// No ampersand in suggestion if it's borrowed already
|
||||
let (dyn_str, paren_dyn_str) =
|
||||
|
@ -4,7 +4,7 @@ error[E0782]: expected a type, found a trait
|
||||
LL | fn id<F>(f: Copy) -> usize {
|
||||
| ^^^^
|
||||
|
|
||||
= note: `Copy` it is dyn-incompatible, so it can't be `dyn`
|
||||
= note: `Copy` is dyn-incompatible, otherwise a trait object could be used
|
||||
help: use a new generic type parameter, constrained by `Copy`
|
||||
|
|
||||
LL - fn id<F>(f: Copy) -> usize {
|
||||
|
@ -4,7 +4,7 @@ error[E0782]: expected a type, found a trait
|
||||
LL | trait A { fn g(b: B) -> B; }
|
||||
| ^
|
||||
|
|
||||
= note: `B` it is dyn-incompatible, so it can't be `dyn`
|
||||
= note: `B` is dyn-incompatible, otherwise a trait object could be used
|
||||
help: use a new generic type parameter, constrained by `B`
|
||||
|
|
||||
LL - trait A { fn g(b: B) -> B; }
|
||||
@ -32,7 +32,7 @@ error[E0782]: expected a type, found a trait
|
||||
LL | trait B { fn f(a: A) -> A; }
|
||||
| ^
|
||||
|
|
||||
= note: `A` it is dyn-incompatible, so it can't be `dyn`
|
||||
= note: `A` is dyn-incompatible, otherwise a trait object could be used
|
||||
help: use a new generic type parameter, constrained by `A`
|
||||
|
|
||||
LL - trait B { fn f(a: A) -> A; }
|
||||
|
@ -4,7 +4,7 @@ error[E0782]: expected a type, found a trait
|
||||
LL | fn concrete(b: B) -> B;
|
||||
| ^
|
||||
|
|
||||
= note: `B` it is dyn-incompatible, so it can't be `dyn`
|
||||
= note: `B` is dyn-incompatible, otherwise a trait object could be used
|
||||
help: use a new generic type parameter, constrained by `B`
|
||||
|
|
||||
LL - fn concrete(b: B) -> B;
|
||||
@ -32,7 +32,7 @@ error[E0782]: expected a type, found a trait
|
||||
LL | fn f(a: A) -> A;
|
||||
| ^
|
||||
|
|
||||
= note: `A` it is dyn-incompatible, so it can't be `dyn`
|
||||
= note: `A` is dyn-incompatible, otherwise a trait object could be used
|
||||
help: use a new generic type parameter, constrained by `A`
|
||||
|
|
||||
LL - fn f(a: A) -> A;
|
||||
|
@ -4,7 +4,7 @@ error[E0782]: expected a type, found a trait
|
||||
LL | fn g(new: B) -> B;
|
||||
| ^
|
||||
|
|
||||
= note: `B` it is dyn-incompatible, so it can't be `dyn`
|
||||
= note: `B` is dyn-incompatible, otherwise a trait object could be used
|
||||
help: use a new generic type parameter, constrained by `B`
|
||||
|
|
||||
LL - fn g(new: B) -> B;
|
||||
|
@ -4,7 +4,7 @@ error[E0782]: expected a type, found a trait
|
||||
LL | fn guard(_s: Copy) -> bool {
|
||||
| ^^^^
|
||||
|
|
||||
= note: `Copy` it is dyn-incompatible, so it can't be `dyn`
|
||||
= note: `Copy` is dyn-incompatible, otherwise a trait object could be used
|
||||
help: use a new generic type parameter, constrained by `Copy`
|
||||
|
|
||||
LL - fn guard(_s: Copy) -> bool {
|
||||
|
@ -4,7 +4,7 @@ error[E0782]: expected a type, found a trait
|
||||
LL | fn g(b: B) -> B;
|
||||
| ^
|
||||
|
|
||||
= note: `B` it is dyn-incompatible, so it can't be `dyn`
|
||||
= note: `B` is dyn-incompatible, otherwise a trait object could be used
|
||||
help: use a new generic type parameter, constrained by `B`
|
||||
|
|
||||
LL - fn g(b: B) -> B;
|
||||
@ -32,7 +32,7 @@ error[E0782]: expected a type, found a trait
|
||||
LL | fn f(a: A) -> A;
|
||||
| ^
|
||||
|
|
||||
= note: `A` it is dyn-incompatible, so it can't be `dyn`
|
||||
= note: `A` is dyn-incompatible, otherwise a trait object could be used
|
||||
help: use a new generic type parameter, constrained by `A`
|
||||
|
|
||||
LL - fn f(a: A) -> A;
|
||||
|
@ -4,7 +4,7 @@ error[E0782]: expected a type, found a trait
|
||||
LL | fn f(a: A) -> A;
|
||||
| ^
|
||||
|
|
||||
= note: `A` it is dyn-incompatible, so it can't be `dyn`
|
||||
= note: `A` is dyn-incompatible, otherwise a trait object could be used
|
||||
help: use a new generic type parameter, constrained by `A`
|
||||
|
|
||||
LL - fn f(a: A) -> A;
|
||||
@ -32,7 +32,7 @@ error[E0782]: expected a type, found a trait
|
||||
LL | fn f(b: B) -> B;
|
||||
| ^
|
||||
|
|
||||
= note: `B` it is dyn-incompatible, so it can't be `dyn`
|
||||
= note: `B` is dyn-incompatible, otherwise a trait object could be used
|
||||
help: use a new generic type parameter, constrained by `B`
|
||||
|
|
||||
LL - fn f(b: B) -> B;
|
||||
@ -60,7 +60,7 @@ error[E0782]: expected a type, found a trait
|
||||
LL | fn f(&self, c: C) -> C;
|
||||
| ^
|
||||
|
|
||||
= note: `C` it is dyn-incompatible, so it can't be `dyn`
|
||||
= note: `C` is dyn-incompatible, otherwise a trait object could be used
|
||||
help: use a new generic type parameter, constrained by `C`
|
||||
|
|
||||
LL - fn f(&self, c: C) -> C;
|
||||
|
Loading…
Reference in New Issue
Block a user