Skip to content

Commit a69c7cc

Browse files
committed
don't derive Copy for RegionElement
1 parent 19dfea5 commit a69c7cc

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
213213
placeholder,
214214
error_element,
215215
} => {
216-
let error_vid = 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(

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

+6-2
Original file line numberDiff line numberDiff line change
@@ -1923,8 +1923,12 @@ impl<'tcx> RegionInferenceContext<'tcx> {
19231923
}
19241924

19251925
/// Get the region outlived by `longer_fr` and live at `element`.
1926-
crate fn region_from_element(&self, longer_fr: RegionVid, element: RegionElement) -> RegionVid {
1927-
match element {
1926+
crate fn region_from_element(
1927+
&self,
1928+
longer_fr: RegionVid,
1929+
element: &RegionElement,
1930+
) -> RegionVid {
1931+
match *element {
19281932
RegionElement::Location(l) => self.find_sub_region_live_at(longer_fr, l),
19291933
RegionElement::RootUniversalRegion(r) => r,
19301934
RegionElement::PlaceholderRegion(error_placeholder) => self

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

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

0 commit comments

Comments
 (0)