about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2015-01-21 23:43:29 +0100
committerFelix S. Klock II <pnkfelix@pnkfx.org>2015-02-11 13:51:21 +0100
commitf51176df0182f37b71a0f6397ecde590efe4a757 (patch)
tree59286efdd8162afce4632b5b7929306726fa1d7f /src/rustllvm/RustWrapper.cpp
parentf90c3864b66ba28c5cda46a32a564d77b0c0f848 (diff)
downloadrust-f51176df0182f37b71a0f6397ecde590efe4a757.tar.gz
rust-f51176df0182f37b71a0f6397ecde590efe4a757.zip
dropck: treat parametric types as safe for dropping.
Handles e.g. `impl<T> Drop for Vec<T>` as parametric: If `T` does not
have any drop code that could read from borrowed data of lifetime `'a`,
then we infer that the drop code for `Vec<T>` also cannot read from
borrowed data of lifetime `'a`, and therefore we do not need to inject
the SafeDestructor constraint for it.

Notably, this enables us to continue storing cyclic structure, without
any `unsafe` code, in `Vec`, without allowing (unsound) destructors on
such cyclic data. (Later commits have tests illustrating these two
cases in run-pass and compile-fail, respectively.)

(This is "Condition (B.)" in Drop-Check rule described in RFC 769.)
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions