diff options
| author | bors <bors@rust-lang.org> | 2015-05-09 09:20:43 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-05-09 09:20:43 +0000 |
| commit | 3906edf41e8faa0610daea954ffbda39841fbc0d (patch) | |
| tree | 2bca2356418aa51281315baa1fff9b7cf5a3c453 /src/rustllvm/RustWrapper.cpp | |
| parent | 95400c51c31877ea4699adc051477edccb5cfbca (diff) | |
| parent | 8654dfbc2f4c1a6da7c9b8f9cce3cfa9f4bc46bb (diff) | |
| download | rust-3906edf41e8faa0610daea954ffbda39841fbc0d.tar.gz rust-3906edf41e8faa0610daea954ffbda39841fbc0d.zip | |
Auto merge of #25212 - pnkfelix:dropck-box-trait, r=nikomatsakis
dropck: must assume `Box<Trait + 'a>` has a destructor of interest. Fix #25199. This detail was documented in [RFC 769]; the implementation was just missing. [breaking-change] The breakage here falls into both obvious and non-obvious cases. The obvious case: if you were relying on the unsoundness this exposes (namely being able to reference dead storage from a destructor, by doing it via a boxed trait object bounded by the lifetime of the dead storage), then this change disallows that. The non-obvious cases: The way dropck works, it causes lifetimes to be extended to longer extents than they covered before. I.e. lifetimes that are attached as trait-bounds may become longer than they were previously. * This includes lifetimes that are only *implicitly* attached as trait-bounds (due to [RFC 599]). So you may have code that was e.g. taking a parameter of type `&'a Box<Trait>` (which expands to `&'a Box<Trait+'a>`), that now may need to be assigned type `&'a Box<Trait+'static>` to ensure that `'a` is not inadvertantly inferred to a region that is actually too long. (See commit ee06263 for an example of this.) [RFC 769]: https://github.com/rust-lang/rfcs/blob/master/text/0769-sound-generic-drop.md#the-drop-check-rule [RFC 599]: https://github.com/rust-lang/rfcs/blob/master/text/0599-default-object-bound.md
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
