rust-analyzer: Suppress follow-up errors in type checking

In this situation:

fn foo() {
    let x = something_broken;
    x.max(1);
}

we currently emit a mismatched-arg-count diagnostic because we resolve the max call to Iterator::max. We should avoid emitting diagnostics in such a situation, because x was already of an unknown type.

Doing this isn’t easy though and requires some refactoring, so this issue is unactionable for now.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16 (13 by maintainers)

Most upvoted comments

I think the general topic is still relevant.

That’s weird. Can you make a new issue, ideally with a small reproduction?

No, that is something rust-analyzer does. Chalk only handles trait solving, not method resolution.