1 // Regression test for #71732, it used to emit incorrect diagnostics, like:
2 // error[E0283]: type annotations needed
3 // --> src/main.rs:5:10
5 // 5 | .get(&"key".into())
6 // | ^^^ cannot infer type for struct `String`
8 // = note: cannot satisfy `String: Borrow<_>`
9 // help: consider specifying the type argument in the method call
11 // 5 | .get::<Q>(&"key".into())
14 use std::collections::hash_map::HashMap;
16 fn foo(parameters: &HashMap<String, String>) -> bool {
19 //~^ ERROR type annotations needed
20 .and_then(|found: &String| Some(false))