Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Tracking issue for `macros_in_extern` feature #49476

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

Comments

@abonander
Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor Author

commented Mar 29, 2018

bors added a commit that referenced this issue Apr 2, 2018
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 #49476

closes #48747
r? @petrochenkov
@abonander

This comment has been minimized.

Copy link
Contributor Author

commented Apr 5, 2018

@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
@dtolnay dtolnay referenced this issue Sep 2, 2018
@dtolnay

This comment has been minimized.

Copy link
Member

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 in 3bd34e0 Oct 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.