Open Bug 1563623 Opened 4 months ago Updated 7 days ago

use MaybeUninit instead of mem::uninitialized


(Core :: CSS Parsing and Computation, defect, P3)





(Reporter: heycam, Unassigned)


(Depends on 2 open bugs, Blocks 1 open bug)


Rust 1.36 has been released, and we should migrate from mem::uninitialized to MaybeUninit. mem::uninitialized will be deprecated in Rust 1.38.

Blocks: 1563876
Depends on: 1563378

FWIW, Servo is planning to do this so we'll get most of this when they get to it. I plan to do a sync tomorrow to allow this not to get too messy.

I had just started on doing this, but noticed that the current offset_of macro used in servo_arc relies on UB, and would continue to do so when converted to MaybeUninit. I have a patch to compute the offset differently which I'll upload to a separate bug.

Depends on: 1563988

Servo PR doing this in Stylo:

m-c has a few other uses of mem::uninitialized in WebRender and Cubeb.

Depends on: 1564873
Depends on: 1565193
You need to log in before you can comment on or make changes to this bug.