]> git.lizzy.rs Git - rust.git/commitdiff
Remove needless error in test
authorEsteban Küber <esteban@kuber.com.ar>
Mon, 22 Apr 2019 19:19:07 +0000 (12:19 -0700)
committerEsteban Küber <esteban@kuber.com.ar>
Mon, 22 Apr 2019 19:19:07 +0000 (12:19 -0700)
src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.rs
src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.stderr

index f49111c3fc7bf27c8261ebed93f5925f5b6fbd2d..193a523aed24bab627a78589bed704b887c53025 100644 (file)
@@ -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()
 }
index ce79c0c80894d1528074ccb82c60b4d93022568a..f253b67a0191480c5b8492c3bfbcad56594127b2 100644 (file)
@@ -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`.