]> git.lizzy.rs Git - rust.git/blob - tests/ui/suggestions/into-str.stderr
Rollup merge of #106648 - Nilstrieb:poly-cleanup, r=compiler-errors
[rust.git] / tests / ui / suggestions / into-str.stderr
1 error[E0277]: the trait bound `&str: From<String>` is not satisfied
2   --> $DIR/into-str.rs:4:9
3    |
4 LL |     foo(String::new());
5    |     --- ^^^^^^^^^^^^^ the trait `From<String>` is not implemented for `&str`
6    |     |
7    |     required by a bound introduced by this call
8    |
9    = note: to coerce a `String` into a `&str`, use `&*` as a prefix
10    = help: the following other types implement trait `From<T>`:
11              <String as From<&String>>
12              <String as From<&mut str>>
13              <String as From<&str>>
14              <String as From<Box<str>>>
15              <String as From<Cow<'a, str>>>
16              <String as From<char>>
17    = note: required for `String` to implement `Into<&str>`
18 note: required by a bound in `foo`
19   --> $DIR/into-str.rs:1:31
20    |
21 LL | fn foo<'a, T>(_t: T) where T: Into<&'a str> {}
22    |                               ^^^^^^^^^^^^^ required by this bound in `foo`
23
24 error: aborting due to previous error
25
26 For more information about this error, try `rustc --explain E0277`.