summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-09-05 11:47:01 +0000
committerbors <bors@rust-lang.org>2020-09-05 11:47:01 +0000
commit81a769f261047afd8e31cc488b173b0ab5ac4205 (patch)
tree3cebc2a8e902358abc77aa72c7ad2df2614b31d2 /compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
parent02fe30971ef397bcff3460a9aaf175e0810c2c90 (diff)
parent66b340f5003910bd8b46f6675cd9a491809aa9fe (diff)
downloadrust-81a769f261047afd8e31cc488b173b0ab5ac4205.tar.gz
rust-81a769f261047afd8e31cc488b173b0ab5ac4205.zip
Auto merge of #75584 - RalfJung:union-no-deref, r=matthewjasper
do not apply DerefMut on union field

This implements the part of [RFC 2514](https://github.com/rust-lang/rfcs/blob/master/text/2514-union-initialization-and-drop.md) about `DerefMut`. Unlike described in the RFC, we only apply this warning specifically when doing `DerefMut` of a `ManuallyDrop` field; that is really the case we are worried about here.

@matthewjasper suggested I patch `convert_place_derefs_to_mutable` and `convert_place_op_to_mutable` for this, but I could not find anything to do in `convert_place_op_to_mutable` and this is sufficient to make the test pass. However, maybe there are some other cases this misses? I have no familiarity with this code.

This is a breaking change *in theory*, if someone used `ManuallyDrop<T>` in a union field and relied on automatic `DerefMut`. But on stable this means `T: Copy`, so the `ManuallyDrop` is rather pointless.

Cc https://github.com/rust-lang/rust/issues/55149
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions