• F
    Switch drop-flag to `u8` to allow special tags to instrument state. · 3902190a
    Felix S. Klock II 提交于
    Refactored code so that the drop-flag values for initialized
    (`DTOR_NEEDED`) versus dropped (`DTOR_DONE`) are given explicit names.
    
    Add `mem::dropped()` (which with `DTOR_DONE == 0` is semantically the
    same as `mem::zeroed`, but the point is that it abstracts away from
    the particular choice of value for `DTOR_DONE`).
    
    Filling-drop needs to use something other than `ptr::read_and_zero`,
    so I added such a function: `ptr::read_and_drop`.  But, libraries
    should not use it if they can otherwise avoid it.
    
    Fixes to tests to accommodate filling-drop.
    3902190a
fold.rs 49.8 KB