Tweak wording
This commit is contained in:
parent
6d6d978baa
commit
acd6540a74
8 changed files with 12 additions and 11 deletions
|
@ -1164,9 +1164,10 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
|||
);
|
||||
} else {
|
||||
err.note(&format!(
|
||||
"`{}` is implemented for `{:?}`",
|
||||
"`{}` is implemented for `{:?}`, but not for `{:?}`",
|
||||
trait_ref,
|
||||
trait_type,
|
||||
trait_ref.skip_binder().self_ty(),
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -582,7 +582,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
hir::Mutability::MutImmutable => self.tcx.mk_mut_ref(region, t_type),
|
||||
};
|
||||
if needs_mut {
|
||||
err.note(&format!("you need `{}` instead", trait_type));
|
||||
err.note(&format!("you need `{}` instead of `{}`", trait_type, rcvr_ty));
|
||||
}
|
||||
}
|
||||
err.emit();
|
||||
|
|
|
@ -8,7 +8,7 @@ LL | assert::<&mut i32>();
|
|||
| ^^^^^^^^^^^^^^^^^^ `&mut i32` may not be safely transferred across an unwind boundary
|
||||
|
|
||||
= help: the trait `std::panic::UnwindSafe` is not implemented for `&mut i32`
|
||||
= note: `std::panic::UnwindSafe` is implemented for `&i32`
|
||||
= note: `std::panic::UnwindSafe` is implemented for `&i32`, but not for `&mut i32`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ LL | if x == y {}
|
|||
| ^^ no implementation for `&str == char`
|
||||
|
|
||||
= help: the trait `std::cmp::PartialEq<char>` is not implemented for `&str`
|
||||
= note: `std::cmp::PartialEq<char>` is implemented for `&mut str`
|
||||
= note: `std::cmp::PartialEq<char>` is implemented for `&mut str`, but not for `&str`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/lex-bad-char-literals-6.rs:15:20
|
||||
|
@ -53,7 +53,7 @@ LL | if x == z {}
|
|||
| ^^ no implementation for `&str == char`
|
||||
|
|
||||
= help: the trait `std::cmp::PartialEq<char>` is not implemented for `&str`
|
||||
= note: `std::cmp::PartialEq<char>` is implemented for `&mut str`
|
||||
= note: `std::cmp::PartialEq<char>` is implemented for `&mut str`, but not for `&str`
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ error: the `min` method cannot be invoked on a trait object
|
|||
LL | t.min().unwrap()
|
||||
| ^^^
|
||||
|
|
||||
= note: you need `&mut dyn std::iter::Iterator<Item = &u64>` instead
|
||||
= note: you need `&mut dyn std::iter::Iterator<Item = &u64>` instead of `&dyn std::iter::Iterator<Item = &u64>`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ LL | foo(String::new());
|
|||
| ^^^ the trait `std::convert::From<std::string::String>` is not implemented for `&str`
|
||||
|
|
||||
= note: to coerce a `std::string::String` into a `&str`, use `&*` as a prefix
|
||||
= note: `std::convert::From<std::string::String>` is implemented for `&mut str`
|
||||
= note: `std::convert::From<std::string::String>` is implemented for `&mut str`, but not for `&str`
|
||||
= note: required because of the requirements on the impl of `std::convert::Into<&str>` for `std::string::String`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
|
|
@ -4,7 +4,7 @@ error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satis
|
|||
LL | let fp = BufWriter::new(fp);
|
||||
| ^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write`
|
||||
|
|
||||
= note: `std::io::Write` is implemented for `&mut dyn std::io::Write`
|
||||
= note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write`
|
||||
= note: required by `std::io::BufWriter::<W>::new`
|
||||
|
||||
error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied
|
||||
|
@ -13,7 +13,7 @@ error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satis
|
|||
LL | let fp = BufWriter::new(fp);
|
||||
| ^^^^^^^^^^^^^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write`
|
||||
|
|
||||
= note: `std::io::Write` is implemented for `&mut dyn std::io::Write`
|
||||
= note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write`
|
||||
= note: required by `std::io::BufWriter`
|
||||
|
||||
error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satisfied
|
||||
|
@ -22,7 +22,7 @@ error[E0277]: the trait bound `&dyn std::io::Write: std::io::Write` is not satis
|
|||
LL | let fp = BufWriter::new(fp);
|
||||
| ^^^^^^^^^^^^^^^^^^ the trait `std::io::Write` is not implemented for `&dyn std::io::Write`
|
||||
|
|
||||
= note: `std::io::Write` is implemented for `&mut dyn std::io::Write`
|
||||
= note: `std::io::Write` is implemented for `&mut dyn std::io::Write`, but not for `&dyn std::io::Write`
|
||||
= note: required by `std::io::BufWriter`
|
||||
|
||||
error[E0599]: no method named `write_fmt` found for type `std::io::BufWriter<&dyn std::io::Write>` in the current scope
|
||||
|
|
|
@ -8,7 +8,7 @@ LL | for (i, n) in &v.iter().enumerate() {
|
|||
| help: consider removing 1 leading `&`-references
|
||||
|
|
||||
= help: the trait `std::iter::Iterator` is not implemented for `&std::iter::Enumerate<std::slice::Iter<'_, {integer}>>`
|
||||
= note: `std::iter::Iterator` is implemented for `&mut std::iter::Enumerate<std::slice::Iter<'_, {integer}>>`
|
||||
= note: `std::iter::Iterator` is implemented for `&mut std::iter::Enumerate<std::slice::Iter<'_, {integer}>>`, but not for `&std::iter::Enumerate<std::slice::Iter<'_, {integer}>>`
|
||||
= note: required by `std::iter::IntoIterator::into_iter`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
|
Loading…
Add table
Reference in a new issue