-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Cannot use ty followed by >>
on macro
#25274
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
Comments
Triage: no change |
This might be fixed now |
This is still a bug -- I believe the issue is that the follow set checker does not allow |
@jseyfried: I guess you meant I'm not sure what the procedure is for adding tokens to FOLLOW sets. Should we go through the RFC process or just assume that it's a bug in the current design and just make a PR for it? |
Yeah, edited.
I think we should assume it is a bug and make a PR to fix. Adding a comment on the RFC PR or tracking issue would probably be a good idea, but I don't think we need to go through the RFC process. |
Accept `Option<Box<$t:ty>>` in macro argument Given the following code, compile successfuly: ``` macro_rules! test { ( fn fun() -> Option<Box<$t:ty>>; ) => { fn fun(x: $t) -> Option<Box<$t>> { Some(Box::new(x)) } } } test! { fn fun() -> Option<Box<i32>>; } ``` Fix #25274.
Accept `Option<Box<$t:ty>>` in macro argument Given the following code, compile successfuly: ``` macro_rules! test { ( fn fun() -> Option<Box<$t:ty>>; ) => { fn fun(x: $t) -> Option<Box<$t>> { Some(Box::new(x)) } } } test! { fn fun() -> Option<Box<i32>>; } ``` Fix rust-lang#25274.
Accept `Option<Box<$t:ty>>` in macro argument Given the following code, compile successfuly: ``` macro_rules! test { ( fn fun() -> Option<Box<$t:ty>>; ) => { fn fun(x: $t) -> Option<Box<$t>> { Some(Box::new(x)) } } } test! { fn fun() -> Option<Box<i32>>; } ``` Fix rust-lang#25274.
Using
ty
followed by>>
doesn't work in a macro but it does works when followed by> >
instead. This seems very like one of the old C++03 template issues.Using
>>
: http://is.gd/KTICULGives
Using
> >
instead of>>
fixes it: http://is.gd/gSD3MRMeta
All the tests were conducted on the playpen using the nightly and beta option (no difference) so I'm not sure about the version but the issue also happens on my local installation
rustc 1.0.0-beta.3 (5241bf9c3 2015-04-25) (built 2015-04-25)
(yep a bit outdated but cba to update eh).The text was updated successfully, but these errors were encountered: