提交 e271383c 编写于 作者: M Matthew Jasper 提交者: Rémy Rakic

Simplify BoundUniversalRegionError

上级 4421dd17
...@@ -75,8 +75,8 @@ fn description(&self) -> &'static str { ...@@ -75,8 +75,8 @@ fn description(&self) -> &'static str {
longer_fr: RegionVid, longer_fr: RegionVid,
/// The region element that erroneously must be outlived by `longer_fr`. /// The region element that erroneously must be outlived by `longer_fr`.
error_element: RegionElement, error_element: RegionElement,
/// The origin of the placeholder region. /// The placeholder region.
fr_origin: NllRegionVariableOrigin, placeholder: ty::PlaceholderRegion,
}, },
/// Any other lifetime error. /// Any other lifetime error.
...@@ -210,17 +210,17 @@ pub(in crate::borrow_check) fn report_region_errors(&mut self, nll_errors: Regio ...@@ -210,17 +210,17 @@ pub(in crate::borrow_check) fn report_region_errors(&mut self, nll_errors: Regio
RegionErrorKind::BoundUniversalRegionError { RegionErrorKind::BoundUniversalRegionError {
longer_fr, longer_fr,
fr_origin, placeholder,
error_element, 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`. // Find the code to blame for the fact that `longer_fr` outlives `error_fr`.
let (_, span) = self.regioncx.find_outlives_blame_span( let (_, span) = self.regioncx.find_outlives_blame_span(
&self.body, &self.body,
longer_fr, longer_fr,
fr_origin, NllRegionVariableOrigin::Placeholder(placeholder),
error_region, error_vid,
); );
// FIXME: improve this error message // FIXME: improve this error message
......
...@@ -1632,7 +1632,7 @@ fn check_bound_universal_region( ...@@ -1632,7 +1632,7 @@ fn check_bound_universal_region(
errors_buffer.push(RegionErrorKind::BoundUniversalRegionError { errors_buffer.push(RegionErrorKind::BoundUniversalRegionError {
longer_fr, longer_fr,
error_element, error_element,
fr_origin: NllRegionVariableOrigin::Placeholder(placeholder), placeholder,
}); });
} }
......
...@@ -114,7 +114,7 @@ pub struct PlaceholderIndex { DEBUG_FORMAT = "PlaceholderIndex({})" } ...@@ -114,7 +114,7 @@ pub struct PlaceholderIndex { DEBUG_FORMAT = "PlaceholderIndex({})" }
/// An individual element in a region value -- the value of a /// An individual element in a region value -- the value of a
/// particular region variable consists of a set of these elements. /// particular region variable consists of a set of these elements.
#[derive(Debug, Clone)] #[derive(Debug, Copy, Clone)]
crate enum RegionElement { crate enum RegionElement {
/// A point in the control-flow graph. /// A point in the control-flow graph.
Location(Location), Location(Location),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册