Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
fn foo(_x: u32, a: impl Into<String>, _y: u32, b: impl Into<String>) {
println!("fox: a={}, b={}", a.into(), b.into());
}

fn main() {
let bar: String = "bar".to_string();
let baz: &str = "baz";

for (a, b) in &[(&bar, baz)] {
let a: &String = a;
foo(42, a, 43, b); //~ ERROR: the trait bound `String: From<&&str>` is not satisfied [E0277]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
error[E0277]: the trait bound `String: From<&&str>` is not satisfied
--> $DIR/bad-error-message-impl-trait-double-ref-issue-85681.rs:11:24
|
LL | foo(42, a, 43, b);
| --- ^ the trait `From<&&str>` is not implemented for `String`
| |
| required by a bound introduced by this call
|
= help: consider casting the `&&str` value to `&str`
= note: required for `&&str` to implement `Into<String>`
note: required by a bound in `foo`
--> $DIR/bad-error-message-impl-trait-double-ref-issue-85681.rs:1:56
|
LL | fn foo(_x: u32, a: impl Into<String>, _y: u32, b: impl Into<String>) {
| ^^^^^^^^^^^^ required by this bound in `foo`
help: consider dereferencing here
|
LL | foo(42, a, 43, *b);
| +

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0277`.
Loading