about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2021-08-28 18:45:37 -0500
committerAaron Hill <aa1ronham@gmail.com>2021-09-27 10:23:45 -0500
commit93ab12eeaba2c0cb02d4c89d95ddbc5eb38e1448 (patch)
tree7dc4ebf6d9154cdc5f024f0cb4b2db899e934715 /compiler/rustc_codegen_llvm/src
parent3e8f32e1c52ca493c862facb7a69e7c3f1f97a18 (diff)
downloadrust-93ab12eeaba2c0cb02d4c89d95ddbc5eb38e1448.tar.gz
rust-93ab12eeaba2c0cb02d4c89d95ddbc5eb38e1448.zip
Improve cause information for NLL higher-ranked errors
This PR has several interconnected pieces:

1. In some of the NLL region error code, we now pass
   around an `ObligationCause`, instead of just a plain `Span`.
   This gets forwarded into `fulfill_cx.register_predicate_obligation`
   during error reporting.
2. The general InferCtxt error reporting code is extended to
   handle `ObligationCauseCode::BindingObligation`
3. A new enum variant `ConstraintCategory::Predicate` is added.
   We try to avoid using this as the 'best blame constraint' - instead,
   we use it to enhance the `ObligationCause` of the `BlameConstraint`
   that we do end up choosing.

As a result, several NLL error messages now contain the same
"the lifetime requirement is introduced here" message as non-NLL
errors.

Having an `ObligationCause` available will likely prove useful
for future improvements to NLL error messages.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions