about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-02-05 04:32:06 +0000
committerbors <bors@rust-lang.org>2018-02-05 04:32:06 +0000
commit07ea2604075d6f896addce0e6949c7cf25dd3715 (patch)
tree8c2df11582867b9a627b3c73ed47ba3739a2a32c /src/rustllvm/RustWrapper.cpp
parentdd29d3dd76c3aed18d7708c636b8d1e259a4c294 (diff)
parentb5f8cd5c20977119eb600b05edf699a1bde92a2c (diff)
downloadrust-07ea2604075d6f896addce0e6949c7cf25dd3715.tar.gz
rust-07ea2604075d6f896addce0e6949c7cf25dd3715.zip
Auto merge of #47873 - Aaron1011:final-ref-coerce, r=nikomatsakis
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