blob: c73130643db7b18c06d1a215878db53ed361ae80 [file] [log] [blame]
error[E0308]: mismatched types
--> $DIR/abridged.rs:16:5
|
LL | fn a() -> Foo {
| --- expected `Foo` because of return type
LL | Some(Foo { bar: 1 })
| ^^^^^^^^^^^^^^^^^^^^ expected struct `Foo`, found enum `std::option::Option`
|
= note: expected struct `Foo`
found enum `std::option::Option<Foo>`
error[E0308]: mismatched types
--> $DIR/abridged.rs:20:5
|
LL | fn a2() -> Foo {
| --- expected `Foo` because of return type
LL | Ok(Foo { bar: 1})
| ^^^^^^^^^^^^^^^^^ expected struct `Foo`, found enum `std::result::Result`
|
= note: expected struct `Foo`
found enum `std::result::Result<Foo, _>`
error[E0308]: mismatched types
--> $DIR/abridged.rs:24:5
|
LL | fn b() -> Option<Foo> {
| ----------- expected `std::option::Option<Foo>` because of return type
LL | Foo { bar: 1 }
| ^^^^^^^^^^^^^^
| |
| expected enum `std::option::Option`, found struct `Foo`
| help: try using a variant of the expected enum: `Some(Foo { bar: 1 })`
|
= note: expected enum `std::option::Option<Foo>`
found struct `Foo`
error[E0308]: mismatched types
--> $DIR/abridged.rs:28:5
|
LL | fn c() -> Result<Foo, Bar> {
| ---------------- expected `std::result::Result<Foo, Bar>` because of return type
LL | Foo { bar: 1 }
| ^^^^^^^^^^^^^^
| |
| expected enum `std::result::Result`, found struct `Foo`
| help: try using a variant of the expected enum: `Ok(Foo { bar: 1 })`
|
= note: expected enum `std::result::Result<Foo, Bar>`
found struct `Foo`
error[E0308]: mismatched types
--> $DIR/abridged.rs:39:5
|
LL | fn d() -> X<X<String, String>, String> {
| ---------------------------- expected `X<X<std::string::String, std::string::String>, std::string::String>` because of return type
...
LL | x
| ^ expected struct `std::string::String`, found integer
|
= note: expected struct `X<X<_, std::string::String>, std::string::String>`
found struct `X<X<_, {integer}>, {integer}>`
error[E0308]: mismatched types
--> $DIR/abridged.rs:50:5
|
LL | fn e() -> X<X<String, String>, String> {
| ---------------------------- expected `X<X<std::string::String, std::string::String>, std::string::String>` because of return type
...
LL | x
| ^ expected struct `std::string::String`, found integer
|
= note: expected struct `X<X<_, std::string::String>, _>`
found struct `X<X<_, {integer}>, _>`
error[E0308]: mismatched types
--> $DIR/abridged.rs:54:5
|
LL | fn f() -> String {
| ------ expected `std::string::String` because of return type
LL | 1+2
| ^^^
| |
| expected struct `std::string::String`, found integer
| help: try using a conversion method: `(1+2).to_string()`
error[E0308]: mismatched types
--> $DIR/abridged.rs:59:5
|
LL | fn g() -> String {
| ------ expected `std::string::String` because of return type
LL | -2
| ^^
| |
| expected struct `std::string::String`, found integer
| help: try using a conversion method: `(-2).to_string()`
error: aborting due to 8 previous errors
For more information about this error, try `rustc --explain E0308`.