about summary refs log tree commit diff
path: root/src/test/incremental/thinlto
diff options
context:
space:
mode:
authorPietro Albini <pietro@pietroalbini.org>2018-11-18 23:24:57 +0100
committerkennytm <kennytm@gmail.com>2018-11-19 22:06:37 +0800
commit2a68c0075a1cf769ebc6f28667cd29fd11b852c1 (patch)
tree5382ed6816b837c335dd00318809ad28725ca15d /src/test/incremental/thinlto
parent05ae505a4c438b80268680747713c84ebad662f3 (diff)
parent25d46f309130be1671d7e44d48e67b23f510bcdc (diff)
downloadrust-2a68c0075a1cf769ebc6f28667cd29fd11b852c1.tar.gz
rust-2a68c0075a1cf769ebc6f28667cd29fd11b852c1.zip
Rollup merge of #56012 - RalfJung:unsafe-cell, r=nikomatsakis
avoid shared ref in UnsafeCell::get

Avoid taking a shared reference in `UnsafeCell::get`. This *should* be taking a raw reference (see https://github.com/rust-lang/rfcs/pull/2582), but that operation is not currently available, so I propose we exploit `repr(transparent)` instead and cast the pointer around.

This is required to make `UnsafeCell::get` pass the [stacked borrows implementation](https://www.ralfj.de/blog/2018/11/16/stacked-borrows-implementation.html) in miri (currently, `UnsafeCell::get` is on a whitelist, but that is of course not very satisfying). It shouldn't affect normal execution/codegen. Would be great if we could get this landed and shrink miri's whitelist!

Cc @nikomatsakis
Diffstat (limited to 'src/test/incremental/thinlto')
0 files changed, 0 insertions, 0 deletions