summary refs log tree commit diff
path: root/compiler/rustc_mir_dataflow
diff options
context:
space:
mode:
authorJannis Christopher Köhl <mail@koehl.dev>2022-10-05 21:42:16 +0200
committerJannis Christopher Köhl <mail@koehl.dev>2022-11-07 10:35:20 +0100
commit1765587846ac9bee95f4f293862b0aae9b8ff4ff (patch)
tree79c3f18d3367325ee45c65669834279e841475a8 /compiler/rustc_mir_dataflow
parentb5063ab0e543174e416e34fc130c8b8daba34b41 (diff)
downloadrust-1765587846ac9bee95f4f293862b0aae9b8ff4ff.tar.gz
rust-1765587846ac9bee95f4f293862b0aae9b8ff4ff.zip
Only track (trivially) freeze types
Diffstat (limited to 'compiler/rustc_mir_dataflow')
-rw-r--r--compiler/rustc_mir_dataflow/src/value_analysis.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_mir_dataflow/src/value_analysis.rs b/compiler/rustc_mir_dataflow/src/value_analysis.rs
index 510856da92f..766a659adca 100644
--- a/compiler/rustc_mir_dataflow/src/value_analysis.rs
+++ b/compiler/rustc_mir_dataflow/src/value_analysis.rs
@@ -674,7 +674,11 @@ impl Map {
             return Err(());
         }
 
-        // FIXME: Check that the place is `Freeze`.
+        if !ty.is_trivially_freeze() {
+            // Due to the way we deal with shared references, only `Freeze` types may be tracked.
+            // We are a little bit to restrictive here by only allowing trivially `Freeze` types.
+            return Err(());
+        }
 
         let place = self.make_place(local, projection)?;