From 2dc5d52a0414e6b65e060b98b767e95e55569a3b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Esteban=20K=C3=BCber?= Date: Mon, 22 Apr 2019 12:19:07 -0700 Subject: [PATCH] Remove needless error in test --- .../termination-trait-test-wrong-type.rs | 6 +++--- .../termination-trait-test-wrong-type.stderr | 20 +++++-------------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.rs b/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.rs index f49111c3fc7..193a523aed2 100644 --- a/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.rs +++ b/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.rs @@ -1,8 +1,8 @@ // compile-flags: --test -use std::num::ParseIntError; +use std::num::ParseFloatError; #[test] -fn can_parse_zero_as_f32() -> Result { //~ ERROR - "0".parse() //~ ERROR type mismatch resolving +fn can_parse_zero_as_f32() -> Result { //~ ERROR + "0".parse() } diff --git a/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr b/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr index ce79c0c8089..f253b67a019 100644 --- a/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr +++ b/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr @@ -1,24 +1,14 @@ -error[E0277]: `main` has invalid return type `std::result::Result` +error[E0277]: `main` has invalid return type `std::result::Result` --> $DIR/termination-trait-test-wrong-type.rs:6:1 | -LL | / fn can_parse_zero_as_f32() -> Result { +LL | / fn can_parse_zero_as_f32() -> Result { LL | | "0".parse() LL | | } | |_^ `main` can only return types that implement `std::process::Termination` | - = help: the trait `std::process::Termination` is not implemented for `std::result::Result` + = help: the trait `std::process::Termination` is not implemented for `std::result::Result` = note: required by `test::assert_test_result` -error[E0271]: type mismatch resolving `::Err == std::num::ParseIntError` - --> $DIR/termination-trait-test-wrong-type.rs:7:9 - | -LL | "0".parse() - | ^^^^^ expected struct `std::num::ParseFloatError`, found struct `std::num::ParseIntError` - | - = note: expected type `std::num::ParseFloatError` - found type `std::num::ParseIntError` - -error: aborting due to 2 previous errors +error: aborting due to previous error -Some errors have detailed explanations: E0271, E0277. -For more information about an error, try `rustc --explain E0271`. +For more information about this error, try `rustc --explain E0277`. -- 2.44.0