Closed
Description
Below code compiles on Rust 1.35.0 stable:
Code A:
fn foo(>) {
let s = "hello world".to_string();
bar(s.as_ref());
}
fn bar<T: AsRef<str> + Into<String>>(s: T) {
println!("{}", s.into());
}
and following doesn't work on Rust 1.35.0 stable:
Code B:
fn foo() {
let s = "hello world".to_string();
bar(&s);
}
fn bar<T: AsRef<str> + Into<String>>(s: T) {
println!("{}", s.into());
}
But on nightly (2019-06-17) rust, Code B compiles while Code A doesn't.
Metadata
Metadata
Assignees
Labels
No labels