-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
E-mediumCall for participation: Medium difficulty level problem and requires some initial experience.Call for participation: Medium difficulty level problem and requires some initial experience.L-correctnessLint: Belongs in the correctness lint groupLint: Belongs in the correctness lint groupT-middleType: Probably requires verifiying typesType: Probably requires verifiying types
Description
A few times now, I've come across tests where a result wasn't verified. Most often, this happens when the result is printed for debugging purposes. See sample code below or have a look at this this real-word example.
While I haven't seen it, I guess this could also be an issue outside of tests or with error!(), warn!(), etc.
I believe it would make since to emit a warning in such cases.
Sample:
some_fn() -> Result<…, …> {
unimplemented!()
}
#[test]
fn a_test() {
…
let result = some_fn();
println!("result: {:?}", result); // This compiles with no warning because the `Result` is used by println!()
}
Metadata
Metadata
Assignees
Labels
E-mediumCall for participation: Medium difficulty level problem and requires some initial experience.Call for participation: Medium difficulty level problem and requires some initial experience.L-correctnessLint: Belongs in the correctness lint groupLint: Belongs in the correctness lint groupT-middleType: Probably requires verifiying typesType: Probably requires verifiying types