about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorAaron Hill <aa1ronham@gmail.com>2018-01-29 23:15:38 -0500
committerAaron Hill <aa1ronham@gmail.com>2018-01-29 23:25:54 -0500
commitb5f8cd5c20977119eb600b05edf699a1bde92a2c (patch)
tree601168b12623431d7a5b9f8258c8e459acb27774 /src/rustllvm/RustWrapper.cpp
parent90eb44a5897c39e3dff9c7e48e3973671dcd9496 (diff)
downloadrust-b5f8cd5c20977119eb600b05edf699a1bde92a2c.tar.gz
rust-b5f8cd5c20977119eb600b05edf699a1bde92a2c.zip
Fix ref-to-ptr coercions not working with NLL in certain cases
Implicit coercions from references to pointers were lowered to slightly
different Mir than explicit casts (e.g. 'foo as *mut T'). This resulted
in certain uses of self-referential structs compiling correctly when an
explicit cast was used, but not when the implicit coercion was used.

To fix this, this commit adds an outer 'Use' expr when applying a
raw-ptr-borrow adjustment. This makes the lowered Mir for coercions
identical to that of explicit coercions, allowing the original code to
compile regardless of how the raw ptr cast occurs.

Fixes #47722
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions