-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Allow concat_idents!
in type positions as well as in expression positions
#33735
Allow concat_idents!
in type positions as well as in expression positions
#33735
Conversation
@@ -9,7 +9,7 @@ | |||
// except according to those terms. | |||
|
|||
use syntax::ast::{self, TokenTree}; | |||
use syntax::codemap::Span; | |||
use syntax::codemap::{Span, Spanned}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like you didn't use the Spanned
type after all. (travis fails because it's unused)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, fixed.
e6e0d5e
to
e992794
Compare
Would this allow me to change this macro for example to only take macro_rules! DECLARE_HANDLE {
($name:ident, $inner:ident) => {
pub enum $inner { }
pub type $name = *mut $inner;
};
} |
@retep998 I think it would be a good idea to allow macro invocations in the However, that would require an RFC. Also, I believe it has been suggested that we instead implement "early-phase" macros invoked with In the meantime, we could write a third party syntax extension This would allow you to change the macro to only take macro_rules! DECLARE_HANDLE {
($name:ident) => {
with_concat_idents!($name, __, |inner| {
pub enum inner { }
pub type $name = *mut inner;
});
}
} |
@bors: r+ |
📌 Commit e992794 has been approved by |
⌛ Testing commit e992794 with merge 213c773... |
@bors: retry force clean |
⌛ Testing commit e992794 with merge 72db775... |
@bors: retry force clean |
Allow `concat_idents!` in type positions as well as in expression positions This allows the `concat_idents!` macro in type positions as well as in expression positions. r? @nrc
This allows the
concat_idents!
macro in type positions as well as in expression positions.r? @nrc