]> git.lizzy.rs Git - rust.git/commit
Add `Place::is_indirect`
authorDylan MacKenzie <ecstaticmorse@gmail.com>
Thu, 29 Aug 2019 20:22:16 +0000 (13:22 -0700)
committerDylan MacKenzie <ecstaticmorse@gmail.com>
Thu, 29 Aug 2019 20:40:28 +0000 (13:40 -0700)
commit86487329bb385f74bed67718f2358436ddca1aa4
tree7c12cc5ecf7a9865e35fa65a7bf7a89be2264edf
parent555d7a2fd6165b614cfc01136d8e3f5c465a1582
Add `Place::is_indirect`

This returns whether a `Place` references the same region of memory
as its base, or equivalently whether it contains a `Deref` projection.

This is helpful for analyses that must track state for locals, since an
assignment to `x` or `x.field` is fundamentally different than one to
`*x`, which may mutate any memory region.
src/librustc/mir/mod.rs