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-11-11 11:24:31 +0100
committerJannis Christopher Köhl <mail@koehl.dev>2022-11-11 11:24:31 +0100
commit3c6d1a723d2d6466d8ee34d4f442a60fdc8cfa1b (patch)
treee1898d300e093552f38f7249866a6668f8d82ee4 /compiler/rustc_mir_dataflow
parent8ecb276735f61ef3822b5ed6a48d1c8fd591b79b (diff)
downloadrust-3c6d1a723d2d6466d8ee34d4f442a60fdc8cfa1b.tar.gz
rust-3c6d1a723d2d6466d8ee34d4f442a60fdc8cfa1b.zip
Add test for repr(transparent) with scalar
Diffstat (limited to 'compiler/rustc_mir_dataflow')
-rw-r--r--compiler/rustc_mir_dataflow/src/value_analysis.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/rustc_mir_dataflow/src/value_analysis.rs b/compiler/rustc_mir_dataflow/src/value_analysis.rs
index 13072a30282..0f3b952ceec 100644
--- a/compiler/rustc_mir_dataflow/src/value_analysis.rs
+++ b/compiler/rustc_mir_dataflow/src/value_analysis.rs
@@ -614,7 +614,7 @@ impl Map {
         }
     }
 
-    /// Register fields of the given (local, projection) place.
+    /// Potentially register the (local, projection) place and its fields, recursively.
     ///
     /// Invariant: The projection must only contain fields.
     fn register_with_filter_rec<'tcx>(
@@ -626,13 +626,16 @@ impl Map {
         filter: &mut impl FnMut(Ty<'tcx>) -> bool,
         exclude: &FxHashSet<Place<'tcx>>,
     ) {
-        if exclude.contains(&Place { local, projection: tcx.intern_place_elems(projection) }) {
+        let place = Place { local, projection: tcx.intern_place_elems(projection) };
+        if exclude.contains(&place) {
             // This will also exclude all projections of the excluded place.
             return;
         }
 
         // Note: The framework supports only scalars for now.
         if filter(ty) && ty.is_scalar() {
+            trace!("registering place: {:?}", place);
+
             // We know that the projection only contains trackable elements.
             let place = self.make_place(local, projection).unwrap();