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 `std::option::Option`
9 = note: expected struct `Foo`
10 found enum `std::option::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 `std::result::Result`
20 = note: expected struct `Foo`
21 found enum `std::result::Result<Foo, _>`
23 error[E0308]: mismatched types
24 --> $DIR/abridged.rs:24:5
26 LL | fn b() -> Option<Foo> {
27 | ----------- expected `std::option::Option<Foo>` because of return type
29 | ^^^^^^^^^^^^^^ expected enum `std::option::Option`, found struct `Foo`
31 = note: expected enum `std::option::Option<Foo>`
34 error[E0308]: mismatched types
35 --> $DIR/abridged.rs:28:5
37 LL | fn c() -> Result<Foo, Bar> {
38 | ---------------- expected `std::result::Result<Foo, Bar>` because of return type
40 | ^^^^^^^^^^^^^^ expected enum `std::result::Result`, found struct `Foo`
42 = note: expected enum `std::result::Result<Foo, Bar>`
45 error[E0308]: mismatched types
46 --> $DIR/abridged.rs:39:5
48 LL | fn d() -> X<X<String, String>, String> {
49 | ---------------------------- expected `X<X<std::string::String, std::string::String>, std::string::String>` because of return type
52 | ^ expected struct `std::string::String`, found integer
54 = note: expected struct `X<X<_, std::string::String>, std::string::String>`
55 found struct `X<X<_, {integer}>, {integer}>`
57 error[E0308]: mismatched types
58 --> $DIR/abridged.rs:50:5
60 LL | fn e() -> X<X<String, String>, String> {
61 | ---------------------------- expected `X<X<std::string::String, std::string::String>, std::string::String>` because of return type
64 | ^ expected struct `std::string::String`, found integer
66 = note: expected struct `X<X<_, std::string::String>, _>`
67 found struct `X<X<_, {integer}>, _>`
69 error[E0308]: mismatched types
70 --> $DIR/abridged.rs:54:5
72 LL | fn f() -> String {
73 | ------ expected `std::string::String` because of return type
77 | expected struct `std::string::String`, found integer
78 | help: try using a conversion method: `(1+2).to_string()`
80 error[E0308]: mismatched types
81 --> $DIR/abridged.rs:59:5
83 LL | fn g() -> String {
84 | ------ expected `std::string::String` because of return type
88 | expected struct `std::string::String`, found integer
89 | help: try using a conversion method: `(-2).to_string()`
91 error: aborting due to 8 previous errors
93 For more information about this error, try `rustc --explain E0308`.