Edit: outstanding work is to change the span from pointing at the function body to point at the return type.
#50272 adds a test for the case where a unit test returns a value that does not implement Termination. The message currently talks about main and has an ugly multi-line span:
error[E0277]: `main` has invalid return type `std::result::Result<f32, std::num::ParseIntError>`
--> $DIR/termination-trait-test-wrong-type.rs:18:1
|
LL | / fn can_parse_zero_as_f32() -> Result<f32, ParseIntError> { //~ ERROR
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>`
= note: required by `__test::test::assert_test_result`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0277`.
Edit: outstanding work is to change the span from pointing at the function body to point at the return type.
#50272 adds a test for the case where a unit test returns a value that does not implement
Termination. The message currently talks aboutmainand has an ugly multi-line span: