don't derive Copy for RegionElement

This commit is contained in:
Rémy Rakic 2021-07-12 21:11:02 +02:00
parent 19dfea552a
commit a69c7cc0d5
3 changed files with 8 additions and 4 deletions

View File

@ -213,7 +213,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
placeholder,
error_element,
} => {
let error_vid = 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(

View File

@ -1923,8 +1923,12 @@ impl<'tcx> RegionInferenceContext<'tcx> {
}
/// Get the region outlived by `longer_fr` and live at `element`.
crate fn region_from_element(&self, longer_fr: RegionVid, element: RegionElement) -> RegionVid {
match element {
crate fn region_from_element(
&self,
longer_fr: RegionVid,
element: &RegionElement,
) -> RegionVid {
match *element {
RegionElement::Location(l) => self.find_sub_region_live_at(longer_fr, l),
RegionElement::RootUniversalRegion(r) => r,
RegionElement::PlaceholderRegion(error_placeholder) => self

View File

@ -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, Copy, Clone)]
#[derive(Debug, Clone)]
crate enum RegionElement {
/// A point in the control-flow graph.
Location(Location),