]> git.lizzy.rs Git - rust.git/blob - tests/ui/typeck/quiet-type-err-let-binding.rs
Auto merge of #106092 - asquared31415:start_lang_item_checks, r=davidtwco
[rust.git] / tests / ui / typeck / quiet-type-err-let-binding.rs
1 // fn foo() -> String {
2 //    String::new()
3 // }
4
5 fn test(s: &str) {
6     println!("{}", s);
7 }
8
9 fn test2(s: String) {
10     println!("{}", s);
11 }
12
13 fn main() {
14     let x = foo(); //~ERROR cannot find function `foo` in this scope
15     test(&x);
16     test2(x); // Does not complain about `x` being a `&str`.
17 }