You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
foo.rs:7:9: 7:19 error: type `Foo` does not implement any method in scope named `function`
foo.rs:7 Foo.function();
^~~~~~~~~~
foo.rs:7:19: 7:19 note: found defined static methods, maybe a `self` is missing?
foo.rs:3:5: 3:21 note: candidate #1 is `Foo::function`
foo.rs:3 fn function() {}
^~~~~~~~~~~~~~~~
error: aborting due to previous error
[`needless_return_with_question_mark`]: don't lint if never type is used for coercion
Fixesrust-lang#11616
When we have something like
```rs
let _x: String = {
return Err(())?;
};
```
we shouldn't suggest removing the `return` because the `!`-ness of `return` is used to coerce the enclosing block to some other type. That will lead to a typeck error without a diverging expression like `return`.
changelog: [`needless_return_with_question_mark`]: don't lint if `return`s never typed-ness is used for coercion
e.g.
The error, "Foo does not implement any method in scope named
function
", could have a note "maybe you meant to call the non-methodFoo::function(...)
".The text was updated successfully, but these errors were encountered: