about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-08-21 21:52:56 +0000
committerbors <bors@rust-lang.org>2022-08-21 21:52:56 +0000
commit0b71ffca18a9f4a9515773b2c23d13f501d1e08f (patch)
tree1b04e5bc2d1e574b07701c7e503a9f214dd4e0e2 /compiler/rustc_const_eval/src
parentc0941dfb5a7d07ef2d70cc54d319669d9d6f6c01 (diff)
parentd577eb09e5ad90fc380091439bda74fae837f001 (diff)
downloadrust-0b71ffca18a9f4a9515773b2c23d13f501d1e08f.tar.gz
rust-0b71ffca18a9f4a9515773b2c23d13f501d1e08f.zip
Auto merge of #100654 - compiler-errors:rework-point-at-arg, r=estebank
Rework "point at arg" suggestions to be more accurate

Fixes #100560

Introduce a new set of `ObligationCauseCode`s which have additional bookeeping for what expression caused the obligation, and which predicate caused the obligation. This allows us to look at the _unsubstituted_ signature to find out which parameter or generic type argument caused an obligaton to fail.

This means that (in most cases) we significantly improve the likelihood of pointing out the right argument that causes a fulfillment error. Also, since this logic isn't happening in just the `select_where_possible_and_mutate_fulfillment()` calls in the argument checking code, but instead during all trait selection in `FnCtxt`, we are also able to point out the correct argument even if inference means that we don't know whether an obligation has failed until well after a call expression has been checked.

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