review comments

This commit is contained in:
Esteban Küber 2019-03-22 20:38:09 -07:00
parent 2f7b32091e
commit e929d19edc
2 changed files with 2 additions and 2 deletions

View File

@ -355,7 +355,7 @@ pub trait Into<T>: Sized {
#[rustc_on_unimplemented(
on(
all(_Self="&str", T="std::string::String"),
note="you can coerce a `{T}` into a `{Self}` by writing `&*variable`"
note="to coerce a `{T}` into a `{Self}`, use `&*` as a prefix",
)
)]
pub trait From<T>: Sized {

View File

@ -4,7 +4,7 @@ error[E0277]: the trait bound `&str: std::convert::From<std::string::String>` is
LL | foo(String::new());
| ^^^ the trait `std::convert::From<std::string::String>` is not implemented for `&str`
|
= note: you can coerce a `std::string::String` into a `&str` by writing `&*variable`
= note: to coerce a `std::string::String` into a `&str`, use `&*` as a prefix
= note: required because of the requirements on the impl of `std::convert::Into<&str>` for `std::string::String`
note: required by `foo`
--> $DIR/into-str.rs:1:1