No "consider borrowing here" suggestion for method on complex trait bound #89679
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Using Bevy (see minimal repo here, the following code provides an unhelpful error message. The compiler does not notice that
&A
meets the trait bounds required and suggest a fix.The error message is
Something along the lines of "The trait
WorldQuery
is implemented for&A
, consider borrowing here." would go a long way to improve this.Basic attempts at minimally reproducing this give the correct error message: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=c762dafa29c2c0bc89425661f383917b. This also works with
needs_ref
as a standalone function.The text was updated successfully, but these errors were encountered: