unused_must_use: Add extra test for types that are still generic
This commit is contained in:
parent
339caa11c7
commit
2d95dfd5a9
2 changed files with 21 additions and 1 deletions
|
|
@ -91,3 +91,11 @@ fn main() {
|
|||
controlflow_infallible_unit();
|
||||
controlflow_never();
|
||||
}
|
||||
|
||||
trait AssocTypeBeforeMonomorphisation {
|
||||
type Error;
|
||||
fn generate(&self) -> Result<(), Self::Error>;
|
||||
fn process(&self) {
|
||||
self.generate(); //~ ERROR: unused `Result` that must be used
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,5 +62,17 @@ help: use `let _ = ...` to ignore the resulting value
|
|||
LL | let _ = controlflow_unit();
|
||||
| +++++++
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
error: unused `Result` that must be used
|
||||
--> $DIR/must_use-result-unit-uninhabited.rs:99:9
|
||||
|
|
||||
LL | self.generate();
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this `Result` may be an `Err` variant, which should be handled
|
||||
help: use `let _ = ...` to ignore the resulting value
|
||||
|
|
||||
LL | let _ = self.generate();
|
||||
| +++++++
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue