Closed Bug 1748718 Opened 4 years ago Closed 4 years ago

[rust] Use the specified type for xpidl constants

Categories

(Core :: XPCOM, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
97 Branch
Tracking Status
firefox97 --- fixed

People

(Reporter: nika, Assigned: nika)

Details

Attachments

(3 files)

This will reduce the need for unnecessary casts from i64 to the actual desired type in rust code which are implicit in c++ and JS.

The constants must fit within an int32_t or uint32_t as that is required by the
JS backend with xpt types holding a uint32_t and signed bit.

Previously all xpidl constants were specified as i64 which means they require
casts before being passed to any xpcom methods. The lack of typing was not an
issue in c++ due to implicit casts from enums to integer types, but using the
correct type is much more valuable in Rust.

Depends on D135164

Pushed by nlayzell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/61f998fe727e Part 1: Allow 64-bit integer constant types in xpidl, r=mccr8 https://hg.mozilla.org/integration/autoland/rev/9d8cfa10fa95 Part 2: Use the specified type for rust xpidl constants, r=emilio https://hg.mozilla.org/integration/autoland/rev/32873022d2ed Part 3: Remove now-unnecessary xpidl constant casts, r=emilio
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: