about summary refs log tree commit diff
path: root/compiler/rustc_mir_dataflow/src
diff options
context:
space:
mode:
authorJannis Christopher Köhl <mail@koehl.dev>2022-08-31 00:56:39 +0200
committerJannis Christopher Köhl <mail@koehl.dev>2022-11-07 10:35:10 +0100
commitbb1639769ec2ef5ff297986f63b2954091c9c95c (patch)
tree0b39db4d46831d056f126852ea1d5782a56c1727 /compiler/rustc_mir_dataflow/src
parentc83489c64bac7c99624d8a13a6fa503330f6b9b7 (diff)
downloadrust-bb1639769ec2ef5ff297986f63b2954091c9c95c.tar.gz
rust-bb1639769ec2ef5ff297986f63b2954091c9c95c.zip
Clarify registration and tracking of references
Diffstat (limited to 'compiler/rustc_mir_dataflow/src')
-rw-r--r--compiler/rustc_mir_dataflow/src/value_analysis.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/rustc_mir_dataflow/src/value_analysis.rs b/compiler/rustc_mir_dataflow/src/value_analysis.rs
index 15aa605021c..662ab0bdfa5 100644
--- a/compiler/rustc_mir_dataflow/src/value_analysis.rs
+++ b/compiler/rustc_mir_dataflow/src/value_analysis.rs
@@ -7,8 +7,14 @@
 //! override some of the `handle_` methods. For an example, see `ConstAnalysis`.
 //!
 //! An implementation must also provide a [`Map`]. Before the anaylsis begins, all places that
-//! should be tracked during the analysis must be registered. The set of tracked places cannot be
-//! changed during the analysis.
+//! should be tracked during the analysis must be registered. Currently, the projections of these
+//! places may only contain derefs, fields and downcasts (otherwise registration fails). During the
+//! analysis, no new places can be registered.
+//!
+//! Note that if you want to track values behind references, you have to register the dereferenced
+//! place. For example: Assume `let x = (0, 0)` and that we want to propagate values from `x.0` and
+//! `x.1` also through the assignment `let y = &x`. In this case, we should register `x.0`, `x.1`,
+//! `(*y).0` and `(*y).1`.
 
 use std::fmt::{Debug, Formatter};