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

Move macro_rules! macros to libstd #11774

Merged
merged 2 commits into from
Jan 25, 2014
Merged

Conversation

sfackler
Copy link
Member

They all have to go into a single module at the moment unfortunately.
Ideally, the logging macros would live in std::logging, condition! would
live in std::condition, format! in std::fmt, etc. However, this
introduces cyclic dependencies between those modules and the macros they
use which the current expansion system can't deal with. We may be able
to get around this by changing the expansion phase to a two-pass system
but that's for a later PR.

Closes #2247
cc #11763

They all have to go into a single module at the moment unfortunately.
Ideally, the logging macros would live in std::logging, condition! would
live in std::condition, format! in std::fmt, etc. However, this
introduces cyclic dependencies between those modules and the macros they
use which the current expansion system can't deal with. We may be able
to get around this by changing the expansion phase to a two-pass system
but that's for a later PR.

Closes rust-lang#2247
cc rust-lang#11763
This was a holdover from when we didn't allow nested comment blocks
(think #if 0). It isn't used anywhere.
@alexcrichton
Copy link
Member

This is pretty awesome!

@brson
Copy link
Contributor

brson commented Jan 24, 2014

Pretty darn cool. Do these show up in the docs?

@sfackler
Copy link
Member Author

Nope, that's tracked in #9954. It should be pretty easy now, since exported macros stay in the AST after expansion so rustdoc should be able to pick them up without much trouble.

bors added a commit that referenced this pull request Jan 25, 2014
They all have to go into a single module at the moment unfortunately.
Ideally, the logging macros would live in std::logging, condition! would
live in std::condition, format! in std::fmt, etc. However, this
introduces cyclic dependencies between those modules and the macros they
use which the current expansion system can't deal with. We may be able
to get around this by changing the expansion phase to a two-pass system
but that's for a later PR.

Closes #2247
cc #11763
@bors bors closed this Jan 25, 2014
@bors bors merged commit 3ba916d into rust-lang:master Jan 25, 2014
@michaelwoerister
Copy link
Member

That should be great for debuginfo as there are finally actual source files corresponding to the std macros :) Thanks a lot!

@sfackler sfackler deleted the move-macros branch May 15, 2014 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Better way to inject core macros
6 participants