diff options
| author | Mark Simulacrum <mark.simulacrum@gmail.com> | 2017-06-18 10:34:13 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-06-18 10:34:13 -0600 |
| commit | db9c12c2ef6798600846c0919cb3ae20caa317b3 (patch) | |
| tree | be45393c4eabd3ea0fc9fd05d1c096c5dfeb8138 | |
| parent | 27a3f7340a9e7b40bcb6df349a2377c2a160718b (diff) | |
| parent | a5403d09f5fedd4cdc263e8108e7b455931f74da (diff) | |
| download | rust-db9c12c2ef6798600846c0919cb3ae20caa317b3.tar.gz rust-db9c12c2ef6798600846c0919cb3ae20caa317b3.zip | |
Rollup merge of #42731 - MaloJaffre:issue-24889, r=Mark-Simulacrum
Add test for #24889 Fixes #24889. r? @Mark-Simulacrum (Thanks for the instructions).
| -rw-r--r-- | src/test/ui/coercion-missing-tail-expected-type.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/coercion-missing-tail-expected-type.stderr | 17 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/test/ui/coercion-missing-tail-expected-type.rs b/src/test/ui/coercion-missing-tail-expected-type.rs index 489ad817ea8..15ce79a054f 100644 --- a/src/test/ui/coercion-missing-tail-expected-type.rs +++ b/src/test/ui/coercion-missing-tail-expected-type.rs @@ -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); diff --git a/src/test/ui/coercion-missing-tail-expected-type.stderr b/src/test/ui/coercion-missing-tail-expected-type.stderr index 28a99e58eca..e96bc425e0b 100644 --- a/src/test/ui/coercion-missing-tail-expected-type.stderr +++ b/src/test/ui/coercion-missing-tail-expected-type.stderr @@ -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) |
