]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #64005 - ecstatic-morse:is-indirect, r=oli-obk
authorMazdak Farrokhzad <twingoow@gmail.com>
Thu, 5 Sep 2019 01:59:37 +0000 (03:59 +0200)
committerGitHub <noreply@github.com>
Thu, 5 Sep 2019 01:59:37 +0000 (03:59 +0200)
Add a `Place::is_indirect` method to determine whether a `Place` contains a `Deref` projection

Working on #63860 requires tracking some property about each local. This requires differentiating `Place`s like `x` and `x.field[index]` from ones like `*x` and `*x.field`, since the first two will always access the same region of memory as `x` while the latter two may access any region of memory. This functionality is duplicated in various places across the compiler. This PR adds a helper method to `Place` which determines whether that `Place` has a `Deref` projection at any point and changes some existing code to use the new method.

I've not converted `qualify_consts.rs` to use the new method, since it's not a trivial conversion and it will get replaced anyway by #63860. There may be other potential uses besides the two I change in this PR.

r? @oli-obk

1  2 
src/librustc/mir/mod.rs

Simple merge