Skip to content

Commit e271383

Browse files
matthewjasperlqd
authored andcommitted
Simplify BoundUniversalRegionError
1 parent 4421dd1 commit e271383

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

compiler/rustc_mir/src/borrow_check/diagnostics/region_errors.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ crate enum RegionErrorKind<'tcx> {
7575
longer_fr: RegionVid,
7676
/// The region element that erroneously must be outlived by `longer_fr`.
7777
error_element: RegionElement,
78-
/// The origin of the placeholder region.
79-
fr_origin: NllRegionVariableOrigin,
78+
/// The placeholder region.
79+
placeholder: ty::PlaceholderRegion,
8080
},
8181

8282
/// Any other lifetime error.
@@ -210,17 +210,17 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
210210

211211
RegionErrorKind::BoundUniversalRegionError {
212212
longer_fr,
213-
fr_origin,
213+
placeholder,
214214
error_element,
215215
} => {
216-
let error_region = self.regioncx.region_from_element(longer_fr, error_element);
216+
let error_vid = self.regioncx.region_from_element(longer_fr, error_element);
217217

218218
// Find the code to blame for the fact that `longer_fr` outlives `error_fr`.
219219
let (_, span) = self.regioncx.find_outlives_blame_span(
220220
&self.body,
221221
longer_fr,
222-
fr_origin,
223-
error_region,
222+
NllRegionVariableOrigin::Placeholder(placeholder),
223+
error_vid,
224224
);
225225

226226
// FIXME: improve this error message

compiler/rustc_mir/src/borrow_check/region_infer/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1632,7 +1632,7 @@ impl<'tcx> RegionInferenceContext<'tcx> {
16321632
errors_buffer.push(RegionErrorKind::BoundUniversalRegionError {
16331633
longer_fr,
16341634
error_element,
1635-
fr_origin: NllRegionVariableOrigin::Placeholder(placeholder),
1635+
placeholder,
16361636
});
16371637
}
16381638

compiler/rustc_mir/src/borrow_check/region_infer/values.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ rustc_index::newtype_index! {
114114

115115
/// An individual element in a region value -- the value of a
116116
/// particular region variable consists of a set of these elements.
117-
#[derive(Debug, Clone)]
117+
#[derive(Debug, Copy, Clone)]
118118
crate enum RegionElement {
119119
/// A point in the control-flow graph.
120120
Location(Location),

0 commit comments

Comments
 (0)