The NOOP_METHOD_CALL
lint fails to run if a MIR error occurs
#91536
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
The following code:
produces the following error:
If we comment out
boards[0] = Board;
, then thenoop_method_call
lint will fire as expected. However, when that line is present, the lint never gets a chance to run, since the mutable borrow error occurs during MIR borrowchecking. Displaying the lint would help the user to resolve the problem, since the root cause is the fact that the.clone()
call produces a&Vec<Board>
, not aVec<Board>
.Originally identified in #91532
The text was updated successfully, but these errors were encountered: