Skip to content

Commit

Permalink
Simplify BoundUniversalRegionError
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewjasper authored and lqd committed Aug 15, 2021
1 parent 4421dd1 commit e271383
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions compiler/rustc_mir/src/borrow_check/diagnostics/region_errors.rs
Expand Up @@ -75,8 +75,8 @@ crate enum RegionErrorKind<'tcx> {
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.
Expand Down Expand Up @@ -210,17 +210,17 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {

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
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir/src/borrow_check/region_infer/mod.rs
Expand Up @@ -1632,7 +1632,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
errors_buffer.push(RegionErrorKind::BoundUniversalRegionError {
longer_fr,
error_element,
fr_origin: NllRegionVariableOrigin::Placeholder(placeholder),
placeholder,
});
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir/src/borrow_check/region_infer/values.rs
Expand Up @@ -114,7 +114,7 @@ rustc_index::newtype_index! {

/// 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),
Expand Down

0 comments on commit e271383

Please sign in to comment.