about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRémy Rakic <remy.rakic+github@gmail.com>2021-07-12 21:11:02 +0200
committerRémy Rakic <remy.rakic+github@gmail.com>2021-08-15 09:11:03 +0200
commita69c7cc0d57ee8c906689c3c9c0e48e2548eb500 (patch)
tree5ace83936d194834e72a07df8e263b18f0c39d5f
parent19dfea552aeba5049b5a51aec206fcaf08d6d7c0 (diff)
downloadrust-a69c7cc0d57ee8c906689c3c9c0e48e2548eb500.tar.gz
rust-a69c7cc0d57ee8c906689c3c9c0e48e2548eb500.zip
don't derive `Copy` for `RegionElement`
-rw-r--r--compiler/rustc_mir/src/borrow_check/diagnostics/region_errors.rs2
-rw-r--r--compiler/rustc_mir/src/borrow_check/region_infer/mod.rs8
-rw-r--r--compiler/rustc_mir/src/borrow_check/region_infer/values.rs2
3 files changed, 8 insertions, 4 deletions
diff --git a/compiler/rustc_mir/src/borrow_check/diagnostics/region_errors.rs b/compiler/rustc_mir/src/borrow_check/diagnostics/region_errors.rs
index 7e39f985fb9..fe9df41db45 100644
--- a/compiler/rustc_mir/src/borrow_check/diagnostics/region_errors.rs
+++ b/compiler/rustc_mir/src/borrow_check/diagnostics/region_errors.rs
@@ -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(
diff --git a/compiler/rustc_mir/src/borrow_check/region_infer/mod.rs b/compiler/rustc_mir/src/borrow_check/region_infer/mod.rs
index 17272e744be..a96cdbc13f3 100644
--- a/compiler/rustc_mir/src/borrow_check/region_infer/mod.rs
+++ b/compiler/rustc_mir/src/borrow_check/region_infer/mod.rs
@@ -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
diff --git a/compiler/rustc_mir/src/borrow_check/region_infer/values.rs b/compiler/rustc_mir/src/borrow_check/region_infer/values.rs
index 940caf6eae8..f247d07e1f0 100644
--- a/compiler/rustc_mir/src/borrow_check/region_infer/values.rs
+++ b/compiler/rustc_mir/src/borrow_check/region_infer/values.rs
@@ -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),