diff --git a/compiler/rustc_mir/src/borrow_check/diagnostics/region_errors.rs b/compiler/rustc_mir/src/borrow_check/diagnostics/region_errors.rs index 1460c2378d1c9bfd6b874edcfce93d92f12e2457..2d6194c48c39072067751defb0c9a7bd67f961d5 100644 --- a/compiler/rustc_mir/src/borrow_check/diagnostics/region_errors.rs +++ b/compiler/rustc_mir/src/borrow_check/diagnostics/region_errors.rs @@ -75,8 +75,8 @@ fn description(&self) -> &'static str { longer_fr: RegionVid, /// The region element that erroneously must be outlived by `longer_fr`. error_element: RegionElement, - /// The origin of the placeholder region. - fr_origin: NllRegionVariableOrigin, + /// The placeholder region. + placeholder: ty::PlaceholderRegion, }, /// Any other lifetime error. @@ -210,17 +210,17 @@ pub(in crate::borrow_check) fn report_region_errors(&mut self, nll_errors: Regio RegionErrorKind::BoundUniversalRegionError { longer_fr, - fr_origin, + placeholder, error_element, } => { - let error_region = self.regioncx.region_from_element(longer_fr, error_element); + let error_vid = self.regioncx.region_from_element(longer_fr, error_element); // Find the code to blame for the fact that `longer_fr` outlives `error_fr`. let (_, span) = self.regioncx.find_outlives_blame_span( &self.body, longer_fr, - fr_origin, - error_region, + NllRegionVariableOrigin::Placeholder(placeholder), + error_vid, ); // FIXME: improve this error message diff --git a/compiler/rustc_mir/src/borrow_check/region_infer/mod.rs b/compiler/rustc_mir/src/borrow_check/region_infer/mod.rs index c40e6bf1ec33b8f6b4cae993d9828ce6910a0cc1..3fe02ece06dca40077e80965021a4d62e853e942 100644 --- a/compiler/rustc_mir/src/borrow_check/region_infer/mod.rs +++ b/compiler/rustc_mir/src/borrow_check/region_infer/mod.rs @@ -1632,7 +1632,7 @@ fn check_bound_universal_region( errors_buffer.push(RegionErrorKind::BoundUniversalRegionError { longer_fr, error_element, - fr_origin: NllRegionVariableOrigin::Placeholder(placeholder), + placeholder, }); } diff --git a/compiler/rustc_mir/src/borrow_check/region_infer/values.rs b/compiler/rustc_mir/src/borrow_check/region_infer/values.rs index f247d07e1f05e66bad3fbd20bcc1c209751583af..940caf6eae8545bd717819a642bf413557cf1fa1 100644 --- a/compiler/rustc_mir/src/borrow_check/region_infer/values.rs +++ b/compiler/rustc_mir/src/borrow_check/region_infer/values.rs @@ -114,7 +114,7 @@ pub struct PlaceholderIndex { DEBUG_FORMAT = "PlaceholderIndex({})" } /// An individual element in a region value -- the value of a /// particular region variable consists of a set of these elements. -#[derive(Debug, Clone)] +#[derive(Debug, Copy, Clone)] crate enum RegionElement { /// A point in the control-flow graph. Location(Location),