mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
don't derive Copy
for RegionElement
This commit is contained in:
parent
19dfea552a
commit
a69c7cc0d5
@ -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(
|
||||
|
@ -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
|
||||
|
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user