]> git.proxmox.com Git - rustc.git/blame - src/test/ui/inference/issue-71732.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / inference / issue-71732.rs
CommitLineData
29967ef6
XL
1// Regression test for #71732, it used to emit incorrect diagnostics, like:
2// error[E0283]: type annotations needed
3// --> src/main.rs:5:10
4// |
5// 5 | .get(&"key".into())
6// | ^^^ cannot infer type for struct `String`
7// |
8// = note: cannot satisfy `String: Borrow<_>`
9// help: consider specifying the type argument in the method call
10// |
11// 5 | .get::<Q>(&"key".into())
12// |
13
14use std::collections::hash_map::HashMap;
15
16fn foo(parameters: &HashMap<String, String>) -> bool {
17 parameters
487cf647
FG
18 .get(&"key".into())
19 //~^ ERROR type annotations needed
29967ef6
XL
20 .and_then(|found: &String| Some(false))
21 .unwrap_or(false)
22}
23
24fn main() {}