diff options
Diffstat (limited to '')
-rw-r--r-- | tests/ui/typeck/quiet-type-err-let-binding.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/typeck/quiet-type-err-let-binding.rs b/tests/ui/typeck/quiet-type-err-let-binding.rs new file mode 100644 index 000000000..a6eab536a --- /dev/null +++ b/tests/ui/typeck/quiet-type-err-let-binding.rs @@ -0,0 +1,17 @@ +// 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`. +} |