rust/compiler/rustc_traits/src
Aaron Hill 93ab12eeab
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.
2021-09-27 10:23:45 -05:00
..
chalk make unevaluated const substs optional 2021-08-26 11:00:30 +02:00
dropck_outlives.rs
evaluate_obligation.rs
implied_outlives_bounds.rs introduce a Coerce predicate 2021-08-19 17:28:24 -04:00
lib.rs Improve cause information for NLL higher-ranked errors 2021-09-27 10:23:45 -05:00
normalize_erasing_regions.rs introduce a Coerce predicate 2021-08-19 17:28:24 -04:00
normalize_projection_ty.rs
type_op.rs Improve cause information for NLL higher-ranked errors 2021-09-27 10:23:45 -05:00