rust/compiler/rustc_borrowck/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
..
constraints Move rustc_mir::borrow_check to new crate rustc_borrowck. 2021-09-07 00:29:22 +02:00
diagnostics Improve cause information for NLL higher-ranked errors 2021-09-27 10:23:45 -05:00
region_infer Improve cause information for NLL higher-ranked errors 2021-09-27 10:23:45 -05:00
type_check Improve cause information for NLL higher-ranked errors 2021-09-27 10:23:45 -05:00
borrow_set.rs Move the dataflow framework to its own crate. 2021-09-07 19:57:07 +02:00
borrowck_errors.rs Move rustc_mir::borrow_check to new crate rustc_borrowck. 2021-09-07 00:29:22 +02:00
constraint_generation.rs Move rustc_mir::borrow_check to new crate rustc_borrowck. 2021-09-07 00:29:22 +02:00
consumers.rs Allow call to get_body_with_borrowck_facts without -Z polonius 2021-09-15 11:45:31 -07:00
dataflow.rs Move the dataflow framework to its own crate. 2021-09-07 19:57:07 +02:00
def_use.rs Move rustc_mir::borrow_check to new crate rustc_borrowck. 2021-09-07 00:29:22 +02:00
facts.rs Move the dataflow framework to its own crate. 2021-09-07 19:57:07 +02:00
invalidation.rs Introduce Rvalue::ShallowInitBox 2021-09-25 01:08:41 +01:00
lib.rs Introduce Rvalue::ShallowInitBox 2021-09-25 01:08:41 +01:00
location.rs Move rustc_mir::borrow_check to new crate rustc_borrowck. 2021-09-07 00:29:22 +02:00
member_constraints.rs Move rustc_mir::borrow_check to new crate rustc_borrowck. 2021-09-07 00:29:22 +02:00
nll.rs Allow call to get_body_with_borrowck_facts without -Z polonius 2021-09-15 11:45:31 -07:00
path_utils.rs Move rustc_mir::borrow_check to new crate rustc_borrowck. 2021-09-07 00:29:22 +02:00
place_ext.rs Move rustc_mir::borrow_check to new crate rustc_borrowck. 2021-09-07 00:29:22 +02:00
places_conflict.rs Move rustc_mir::borrow_check to new crate rustc_borrowck. 2021-09-07 00:29:22 +02:00
prefixes.rs Move rustc_mir::borrow_check to new crate rustc_borrowck. 2021-09-07 00:29:22 +02:00
renumber.rs Move rustc_mir::borrow_check to new crate rustc_borrowck. 2021-09-07 00:29:22 +02:00
universal_regions.rs Move rustc_mir::borrow_check to new crate rustc_borrowck. 2021-09-07 00:29:22 +02:00
used_muts.rs Move rustc_mir::borrow_check to new crate rustc_borrowck. 2021-09-07 00:29:22 +02:00