1 // ignore-wasm32 FIXME: ignoring wasm as it suggests slightly different impls
3 // Regression test for #72616, it used to emit incorrect diagnostics, like:
4 // error[E0283]: type annotations needed for `String`
5 // --> src/main.rs:8:30
7 // 5 | let _: String = "".to_owned().try_into().unwrap();
8 // | - consider giving this pattern a type
10 // 8 | if String::from("a") == "a".try_into().unwrap() {}
11 // | ^^ cannot infer type for struct `String`
13 // = note: cannot satisfy `String: PartialEq<_>`
15 use std::convert::TryInto;
19 let _: String = "".to_owned().try_into().unwrap();
22 if String::from("a") == "a".try_into().unwrap() {}
23 //~^ ERROR type annotations needed
24 //~| ERROR type annotations needed
27 let _: String = match "_".try_into() {