Closed Bug 1535377 Opened 9 months ago Closed 9 months ago

xpcom_method macro cannot be imported without also importing ensure_param

Categories

(Core :: XPCOM, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: bytesized, Assigned: bytesized)

Details

Attachments

(1 file)

The new rust standard allows macros such as xpcom_method to be imported like this:

use xpcom::xpcom_method;

Currently, however, it must actually be imported like this:

use xpcom::{ensure_param, xpcom_method};

This could potentially be fixed by incorporating ensure_param's functionality into the xpcom_method macro. Since there are currently no other consumers of ensure_param, I see no reason not to do this.

This is done by incorporating the ensure_param macro into the implementation of the xpcom_method macro

Just for reference, I got this technique and the "@rule" naming convention from: https://danielkeep.github.io/tlborm/book/pat-internal-rules.html

Pushed by ksteuber@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d7fdd6fbd9cd
Allow the xpcom_method Rust macro to be used without importing ensure_param r=myk,froydnj
Status: NEW → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.