1 error[E0308]: mismatched types
2 --> $DIR/abridged.rs:16:5
5 | --- expected `Foo` because of return type
6 LL | Some(Foo { bar: 1 })
7 | ^^^^^^^^^^^^^^^^^^^^ expected struct `Foo`, found enum `Option`
9 = note: expected struct `Foo`
10 found enum `Option<Foo>`
12 error[E0308]: mismatched types
13 --> $DIR/abridged.rs:20:5
16 | --- expected `Foo` because of return type
17 LL | Ok(Foo { bar: 1})
18 | ^^^^^^^^^^^^^^^^^ expected struct `Foo`, found enum `Result`
20 = note: expected struct `Foo`
21 found enum `Result<Foo, _>`
23 error[E0308]: mismatched types
24 --> $DIR/abridged.rs:24:5
26 LL | fn b() -> Option<Foo> {
27 | ----------- expected `Option<Foo>` because of return type
31 | expected enum `Option`, found struct `Foo`
32 | help: try using a variant of the expected enum: `Some(Foo { bar: 1 })`
34 = note: expected enum `Option<Foo>`
37 error[E0308]: mismatched types
38 --> $DIR/abridged.rs:28:5
40 LL | fn c() -> Result<Foo, Bar> {
41 | ---------------- expected `Result<Foo, Bar>` because of return type
45 | expected enum `Result`, found struct `Foo`
46 | help: try using a variant of the expected enum: `Ok(Foo { bar: 1 })`
48 = note: expected enum `Result<Foo, Bar>`
51 error[E0308]: mismatched types
52 --> $DIR/abridged.rs:39:5
54 LL | fn d() -> X<X<String, String>, String> {
55 | ---------------------------- expected `X<X<String, String>, String>` because of return type
58 | ^ expected struct `String`, found integer
60 = note: expected struct `X<X<_, String>, String>`
61 found struct `X<X<_, {integer}>, {integer}>`
63 error[E0308]: mismatched types
64 --> $DIR/abridged.rs:50:5
66 LL | fn e() -> X<X<String, String>, String> {
67 | ---------------------------- expected `X<X<String, String>, String>` because of return type
70 | ^ expected struct `String`, found integer
72 = note: expected struct `X<X<_, String>, _>`
73 found struct `X<X<_, {integer}>, _>`
75 error[E0308]: mismatched types
76 --> $DIR/abridged.rs:54:5
78 LL | fn f() -> String {
79 | ------ expected `String` because of return type
81 | ^^^ expected struct `String`, found integer
83 help: try using a conversion method
85 LL | (1+2).to_string()
88 error[E0308]: mismatched types
89 --> $DIR/abridged.rs:59:5
91 LL | fn g() -> String {
92 | ------ expected `String` because of return type
94 | ^^ expected struct `String`, found integer
96 help: try using a conversion method
101 error: aborting due to 8 previous errors
103 For more information about this error, try `rustc --explain E0308`.