about summary refs log tree commit diff
path: root/src/libstd/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorKevin Butler <haqkrs@gmail.com>2014-11-14 15:14:52 -0800
committerFelix S. Klock II <pnkfelix@pnkfx.org>2015-02-12 13:55:08 +0100
commit32d0dbd49a372b9d2e000587497de6ffca9e1cca (patch)
tree4bcd232997be2f001ab5f26a9dda894c36936d2c /src/libstd/sys/unix/stack_overflow.rs
parent0fdca30fcb2303966ad2529b7a3b0599088c105d (diff)
downloadrust-32d0dbd49a372b9d2e000587497de6ffca9e1cca.tar.gz
rust-32d0dbd49a372b9d2e000587497de6ffca9e1cca.zip
librustc: Forbid partial reinitialization of uninitialized structures or
enumerations that implement the `Drop` trait.

This breaks code like:

    struct Struct {
        f: String,
        g: String,
    }

    impl Drop for Struct { ... }

    fn main() {
        let x = Struct { ... };
        drop(x);
        x.f = ...;
    }

Change this code to not create partially-initialized structures. For
example:

    struct Struct {
        f: String,
        g: String,
    }

    impl Drop for Struct { ... }

    fn main() {
        let x = Struct { ... };
        drop(x);
        x = Struct {
            f: ...,
            g: ...,
        }
    }

Closes #18571.

[breaking-change]

----

(Joint authorship by pcwalton and Ryman; thanks all!)
Diffstat (limited to 'src/libstd/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions