diff options
| author | Esteban Küber <esteban@kuber.com.ar> | 2019-04-22 12:19:07 -0700 |
|---|---|---|
| committer | Esteban Küber <esteban@kuber.com.ar> | 2019-04-22 12:19:07 -0700 |
| commit | 2dc5d52a0414e6b65e060b98b767e95e55569a3b (patch) | |
| tree | 2f23964d8f19e7175978e22783f8138bb4b31e1a | |
| parent | 3a19df20daefa3ab62a356d9a2c603d0e396fdd4 (diff) | |
| download | rust-2dc5d52a0414e6b65e060b98b767e95e55569a3b.tar.gz rust-2dc5d52a0414e6b65e060b98b767e95e55569a3b.zip | |
Remove needless error in test
| -rw-r--r-- | src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.rs | 6 | ||||
| -rw-r--r-- | src/test/ui/rfc-1937-termination-trait/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<f32, ParseIntError> { //~ ERROR - "0".parse() //~ ERROR type mismatch resolving +fn can_parse_zero_as_f32() -> Result<f32, ParseFloatError> { //~ 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<f32, std::num::ParseIntError>` +error[E0277]: `main` has invalid return type `std::result::Result<f32, std::num::ParseFloatError>` --> $DIR/termination-trait-test-wrong-type.rs:6:1 | -LL | / fn can_parse_zero_as_f32() -> Result<f32, ParseIntError> { +LL | / fn can_parse_zero_as_f32() -> Result<f32, ParseFloatError> { 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<f32, std::num::ParseIntError>` + = help: the trait `std::process::Termination` is not implemented for `std::result::Result<f32, std::num::ParseFloatError>` = note: required by `test::assert_test_result` -error[E0271]: type mismatch resolving `<f32 as std::str::FromStr>::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`. |
