-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Macro import/export #3114
Comments
This would provide a nice solution for #2247 as well. |
Wishfully putting this on the 0.4 milestone. |
non-critical for 0.6, de-milestoning |
Nominating this for a milestone. |
Does |
@pnkfelix - I can't recall why, but I had to wrap the |
@isaacaggrey but in that case the scope of the macro will be limited to that function, yes? (At least, that matches my intuition about the usual intentions for lexically-scoped macros.) So that seems like a problem. |
@pnkfelix IIUC you would think so, but it seems to not limit the macro's scope to the function. If you are trying to import macros from a separate file (in my case, I would link to a gist, but my Rust build is currently not working. |
Hmm, I see that this pattern certainly used to work in the code base, but we do not seem to use that pattern any more; @jbclements changed it in SHA: ca147a0 He replaced it with some (Let me see if I can use that information to get include to work on macro definitions.) |
Or rather, the whole point is to avoid using |
Thanks for the update, @pnkfelix . I hadn't followed the last couple months of macro changes and didn't even realize that hack didn't work anymore! I suppose I have the same question/issue as you then now. :) |
I do not believe this is backwards incompatible. |
accepted for feature-complete milestone |
visiting for triage, email 2013-08-05. I've looked at this in the past. Its something I'd like to see happen, especially coming from my experience working with Racket. (I'm not sure how many of the lessons/caveats from the Scheme community carry over here, though ... it depends in part on whether Rust has an analogue to |
As pointed out in #10723, it may be possible to place |
Accepted for P-low. |
This was done in #11151. |
Hurray! nice work @sfackler! |
fix a few typos found via codespell.
ensure RET assignments do not get propagated on unwinding Mostly this adds a test for rust-lang/unsafe-code-guidelines#468, and then also some other related tests I thought of while writing that test.
Let's close the loop and use `intrinsic_name`, the StableMIR API we added in rust-lang#122203, to retrieve the intrinsic name and avoid post-processing it.
We need a way to export macros from modules and import them in other modules.
Currently we either prepend a string of macro definitions to every file, such as with
debug!
,error!
, etc., or we just copy and paste the macros we need. This second approach leads to code duplication and lots of subtly different implementations.As a temporary workaround, we could probably use
include!
.The text was updated successfully, but these errors were encountered: