about summary refs log tree commit diff
path: root/compiler/rustc_errors/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-05-14 09:55:30 -0400
committerGitHub <noreply@github.com>2024-05-14 09:55:30 -0400
commitd59f430eec01b9f94330eb287406eb522268b20e (patch)
tree27a7d072cc7599fe1fa03f71b14af80648554390 /compiler/rustc_errors/src
parent712e7c37f7994b358eb5b14fc0792a4a45af3e60 (diff)
parent8f97a2588caa808b4d46dc3224de5d40bbbcd94b (diff)
downloadrust-d59f430eec01b9f94330eb287406eb522268b20e.tar.gz
rust-d59f430eec01b9f94330eb287406eb522268b20e.zip
Rollup merge of #125100 - compiler-errors:faster, r=nnethercote
Don't do post-method-probe error reporting steps if we're in a suggestion

Currently in method probing, if we fail to pick a method, then we reset and try to collect relevant candidates for method errors:

https://github.com/rust-lang/rust/blob/34582118afaf00b0eb2d209a90b181c7156b501c/compiler/rustc_hir_typeck/src/method/probe.rs#L953-L993

However, we do method lookups via `lookup_method_for_diagnostic` and only care about the result if the method probe was a *success*.

Namely, we don't need to do a bunch of other lookups on failure, since we throw away these results anyways, such as an expensive call to:

https://github.com/rust-lang/rust/blob/34582118afaf00b0eb2d209a90b181c7156b501c/compiler/rustc_hir_typeck/src/method/probe.rs#L959

And:
https://github.com/rust-lang/rust/blob/34582118afaf00b0eb2d209a90b181c7156b501c/compiler/rustc_hir_typeck/src/method/probe.rs#L985

---

This PR also renames some methods so it's clear that they're for diagnostics.

r? `@nnethercote`
Diffstat (limited to 'compiler/rustc_errors/src')
0 files changed, 0 insertions, 0 deletions