]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_mir_dataflow/src/value_analysis.rs
Auto merge of #106180 - RalfJung:dereferenceable-generators, r=nbdd0121
[rust.git] / compiler / rustc_mir_dataflow / src / value_analysis.rs
index 0522c657939f5e100c7827dd319862ce3eedaf09..8bf6493be4b0168ba6e78d8be9d0cbb7c038382c 100644 (file)
@@ -84,7 +84,8 @@ fn super_statement(&self, statement: &Statement<'tcx>, state: &mut State<Self::V
             StatementKind::Retag(..) => {
                 // We don't track references.
             }
-            StatementKind::Nop
+            StatementKind::ConstEvalCounter
+            | StatementKind::Nop
             | StatementKind::FakeRead(..)
             | StatementKind::Coverage(..)
             | StatementKind::AscribeUserType(..) => (),
@@ -789,7 +790,7 @@ fn try_from(value: ProjectionElem<V, T>) -> Result<Self, Self::Error> {
 }
 
 /// Invokes `f` on all direct fields of `ty`.
-fn iter_fields<'tcx>(
+pub fn iter_fields<'tcx>(
     ty: Ty<'tcx>,
     tcx: TyCtxt<'tcx>,
     mut f: impl FnMut(Option<VariantIdx>, Field, Ty<'tcx>),
@@ -823,7 +824,7 @@ fn iter_fields<'tcx>(
 }
 
 /// Returns all locals with projections that have their reference or address taken.
-fn excluded_locals(body: &Body<'_>) -> IndexVec<Local, bool> {
+pub fn excluded_locals(body: &Body<'_>) -> IndexVec<Local, bool> {
     struct Collector {
         result: IndexVec<Local, bool>,
     }