]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mismatched_types/abridged.stderr
Add note to src/ci/docker/README.md about multiple docker images
[rust.git] / src / test / ui / mismatched_types / abridged.stderr
1 error[E0308]: mismatched types
2   --> $DIR/abridged.rs:16:5
3    |
4 LL | fn a() -> Foo {
5    |           --- expected `Foo` because of return type
6 LL |     Some(Foo { bar: 1 })
7    |     ^^^^^^^^^^^^^^^^^^^^ expected struct `Foo`, found enum `std::option::Option`
8    |
9    = note: expected struct `Foo`
10                 found enum `std::option::Option<Foo>`
11
12 error[E0308]: mismatched types
13   --> $DIR/abridged.rs:20:5
14    |
15 LL | fn a2() -> Foo {
16    |            --- expected `Foo` because of return type
17 LL |     Ok(Foo { bar: 1})
18    |     ^^^^^^^^^^^^^^^^^ expected struct `Foo`, found enum `std::result::Result`
19    |
20    = note: expected struct `Foo`
21                 found enum `std::result::Result<Foo, _>`
22
23 error[E0308]: mismatched types
24   --> $DIR/abridged.rs:24:5
25    |
26 LL | fn b() -> Option<Foo> {
27    |           ----------- expected `std::option::Option<Foo>` because of return type
28 LL |     Foo { bar: 1 }
29    |     ^^^^^^^^^^^^^^ expected enum `std::option::Option`, found struct `Foo`
30    |
31    = note: expected enum `std::option::Option<Foo>`
32             found struct `Foo`
33
34 error[E0308]: mismatched types
35   --> $DIR/abridged.rs:28:5
36    |
37 LL | fn c() -> Result<Foo, Bar> {
38    |           ---------------- expected `std::result::Result<Foo, Bar>` because of return type
39 LL |     Foo { bar: 1 }
40    |     ^^^^^^^^^^^^^^ expected enum `std::result::Result`, found struct `Foo`
41    |
42    = note: expected enum `std::result::Result<Foo, Bar>`
43             found struct `Foo`
44
45 error[E0308]: mismatched types
46   --> $DIR/abridged.rs:39:5
47    |
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
50 ...
51 LL |     x
52    |     ^ expected struct `std::string::String`, found integer
53    |
54    = note: expected struct `X<X<_, std::string::String>, std::string::String>`
55               found struct `X<X<_, {integer}>, {integer}>`
56
57 error[E0308]: mismatched types
58   --> $DIR/abridged.rs:50:5
59    |
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
62 ...
63 LL |     x
64    |     ^ expected struct `std::string::String`, found integer
65    |
66    = note: expected struct `X<X<_, std::string::String>, _>`
67               found struct `X<X<_, {integer}>, _>`
68
69 error[E0308]: mismatched types
70   --> $DIR/abridged.rs:54:5
71    |
72 LL | fn f() -> String {
73    |           ------ expected `std::string::String` because of return type
74 LL |     1+2
75    |     ^^^
76    |     |
77    |     expected struct `std::string::String`, found integer
78    |     help: try using a conversion method: `(1+2).to_string()`
79
80 error[E0308]: mismatched types
81   --> $DIR/abridged.rs:59:5
82    |
83 LL | fn g() -> String {
84    |           ------ expected `std::string::String` because of return type
85 LL |     -2
86    |     ^^
87    |     |
88    |     expected struct `std::string::String`, found integer
89    |     help: try using a conversion method: `(-2).to_string()`
90
91 error: aborting due to 8 previous errors
92
93 For more information about this error, try `rustc --explain E0308`.