1 // Regression test for #72616, it used to emit incorrect diagnostics, like:
2 // error[E0283]: type annotations needed for `String`
3 // --> src/main.rs:8:30
5 // 5 | let _: String = "".to_owned().try_into().unwrap();
6 // | - consider giving this pattern a type
8 // 8 | if String::from("a") == "a".try_into().unwrap() {}
9 // | ^^ cannot infer type for struct `String`
11 // = note: cannot satisfy `String: PartialEq<_>`
13 use std::convert::TryInto;
17 let _: String = "".to_owned().try_into().unwrap();
20 if String::from("a") == "a".try_into().unwrap() {}
21 //~^ ERROR: type annotations needed
24 let _: String = match "_".try_into() {