Closed Bug 1596035 Opened 5 years ago Closed 5 years ago

rust nightly: the type `nsString` does not permit zero-initialization

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1595212

People

(Reporter: Sylvestre, Unassigned)

Details

With rust version 1.40.0-nightly (bc0e288ad 2019-11-11)

error: the type `nsStringRepr` does not permit zero-initialization
    --> xpcom/rust/nsstring/src/lib.rs:1401:35
     |
1401 |                       let tmp: $T = mem::zeroed();
     |                                     ^^^^^^^^^^^^^
     |                                     |
     |                                     this code causes undefined behavior when executed
     |                                     help: use `MaybeUninit<T>` instead
...
1429 | /     member_check!(nsStringRepr, nsString, nsStr<'static>,
1430 | |                   data, Rust_Test_Member_nsString_mData);
     | |_________________________________________________________- in this macro invocation

Also occurs in
--> xpcom/rust/nsstring/src/lib.rs:1409:35
--> xpcom/rust/nsstring/src/lib.rs:1417:35

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.