1 fn foo() -> impl std::fmt::Display {
5 1u32 //~ ERROR mismatched types
8 fn bar() -> impl std::fmt::Display {
12 return 1u32; //~ ERROR mismatched types
16 fn baz() -> impl std::fmt::Display {
20 1u32 //~ ERROR mismatched types
24 fn qux() -> impl std::fmt::Display {
28 1u32 //~ ERROR `if` and `else` have incompatible types
32 fn bat() -> impl std::fmt::Display {
35 _ => 1u32, //~ ERROR mismatched types
39 fn can() -> impl std::fmt::Display {
40 match 13 { //~ ERROR mismatched types
47 fn cat() -> impl std::fmt::Display {
53 1u32 //~ ERROR mismatched types
58 fn dog() -> impl std::fmt::Display {
61 1 => 1u32, //~ ERROR `match` arms have incompatible types
66 fn hat() -> dyn std::fmt::Display { //~ ERROR return type cannot have an unboxed trait object
77 fn pug() -> dyn std::fmt::Display { //~ ERROR return type cannot have an unboxed trait object
80 1 => 1u32, //~ ERROR `match` arms have incompatible types
85 fn man() -> dyn std::fmt::Display { //~ ERROR return type cannot have an unboxed trait object
89 1u32 //~ ERROR `if` and `else` have incompatible types
93 fn apt() -> impl std::fmt::Display {
94 if let Some(42) = Some(42) {
97 1u32 //~ ERROR `if` and `else` have incompatible types