mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-02 07:22:42 +00:00
parent
78d8416caf
commit
a5403d09f5
@ -14,6 +14,10 @@ fn plus_one(x: i32) -> i32 {
|
||||
x + 1;
|
||||
}
|
||||
|
||||
fn foo() -> Result<u8, u64> {
|
||||
Ok(1);
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let x = plus_one(5);
|
||||
println!("X = {}", x);
|
||||
|
@ -15,5 +15,22 @@ help: consider removing this semicolon:
|
||||
14 | x + 1;
|
||||
| ^
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/coercion-missing-tail-expected-type.rs:17:29
|
||||
|
|
||||
17 | fn foo() -> Result<u8, u64> {
|
||||
| _____________________________^
|
||||
18 | | Ok(1);
|
||||
19 | | }
|
||||
| |_^ expected enum `std::result::Result`, found ()
|
||||
|
|
||||
= note: expected type `std::result::Result<u8, u64>`
|
||||
found type `()`
|
||||
help: consider removing this semicolon:
|
||||
--> $DIR/coercion-missing-tail-expected-type.rs:18:10
|
||||
|
|
||||
18 | Ok(1);
|
||||
| ^
|
||||
|
||||
error: aborting due to previous error(s)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user