rust/tests/ui/typeck/quiet-type-err-let-binding.rs

18 lines
301 B
Rust

// fn foo() -> String {
// String::new()
// }
fn test(s: &str) {
println!("{}", s);
}
fn test2(s: String) {
println!("{}", s);
}
fn main() {
let x = foo(); //~ERROR cannot find function `foo` in this scope
test(&x);
test2(x); // Does not complain about `x` being a `&str`.
}