Skip to content

Tracking issue for macros_in_extern feature #49476

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
abonander opened this issue Mar 29, 2018 · 3 comments · Fixed by #63931
Closed

Tracking issue for macros_in_extern feature #49476

abonander opened this issue Mar 29, 2018 · 3 comments · Fixed by #63931
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC

Comments

@abonander
Copy link
Contributor

abonander commented Mar 29, 2018

This is a tracking issue for the macros_in_extern. This feature flag enables the usage of macro invocations in extern {} blocks:

macro_rules! emit_foreign_item(
    () => (fn read(fd: int, buf: *mut u8, size: usize) -> int;)
);

extern {
    emit_foreign_item!();
}

Declarative maco, proc-macro and proc-macro-attribute invocations are allowed as well. Macro defintions, however, are not.

This feature is unstable because it was recently implemented in #49350 without an RFC. It is considered a discrepancy in macro support and not a new feature. It should be completely backwards-compatible.

@abonander
Copy link
Contributor Author

cc @petrochenkov, @nrc, @jseyfried

@abonander
Copy link
Contributor Author

@petrochenkov I should get started on an Unstable Book entry for this feature, shouldn't I

alexcrichton added a commit to alexcrichton/rust that referenced this issue Apr 5, 2018
…chenkov

Expand macros in `extern {}` blocks

This permits macro and proc-macro and attribute invocations (the latter only with the `proc_macro` feature of course) in `extern {}` blocks, gated behind a new `macros_in_extern` feature.

A tracking issue is now open at rust-lang#49476

closes rust-lang#48747
@pietroalbini pietroalbini added the C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC label Apr 6, 2018
@dtolnay
Copy link
Member

dtolnay commented Oct 1, 2018

This leak / infinite alloc on invalid syntax needs to be fixed before stabilization: #54441.

Centril added a commit to Centril/rust that referenced this issue Oct 1, 2019
Stabilize macros in some more positions

- Fn-like macros and attribute macros in `extern` blocks
- Fn-like procedural macros in type positions
- ~Attribute macros on inline modules~ (moved to rust-lang#64273)

Stabilization report: rust-lang#63931 (comment).

Closes rust-lang#49476
cc rust-lang#54727
@bors bors closed this as completed in 3bd34e0 Oct 1, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants