diff options
| author | Jannis Christopher Köhl <mail@koehl.dev> | 2022-11-11 11:24:31 +0100 |
|---|---|---|
| committer | Jannis Christopher Köhl <mail@koehl.dev> | 2022-11-11 11:24:31 +0100 |
| commit | 3c6d1a723d2d6466d8ee34d4f442a60fdc8cfa1b (patch) | |
| tree | e1898d300e093552f38f7249866a6668f8d82ee4 /compiler/rustc_mir_dataflow | |
| parent | 8ecb276735f61ef3822b5ed6a48d1c8fd591b79b (diff) | |
| download | rust-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.rs | 7 |
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(); |
