Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upICE when passing a macro expression to a macro using it in an attribute in 1.18.0 and later #42164
Comments
This comment has been minimized.
This comment has been minimized.
|
I ran into this with declarative macros on pub macro m($inner_str:expr) {
#[doc = $inner_str]
struct S;
}
m!(stringify!(foo)); |
frewsxcv
added
the
I-ICE
label
Jun 4, 2017
This comment has been minimized.
This comment has been minimized.
bb010g
commented
Jun 12, 2017
|
Panics with the same error on 1.18.0 stable now: https://is.gd/svv043 |
ShadowNinja
changed the title
ICE when passing a macro expression to a macro using it in an attribute on nightly
ICE when passing a macro expression to a macro using it in an attribute in 1.18.0 and later
Jun 13, 2017
Mark-Simulacrum
added
the
C-bug
label
Jul 22, 2017
topecongiro
added a commit
to topecongiro/rust
that referenced
this issue
Dec 26, 2017
topecongiro
added a commit
to topecongiro/rust
that referenced
this issue
Dec 26, 2017
bors
added a commit
that referenced
this issue
Dec 27, 2017
bors
closed this
in
#47014
Dec 27, 2017
This comment has been minimized.
This comment has been minimized.
|
Now this works, but it breaks proc-macro derives on the same item (parsing fails). Should I report that bug to a different location? It sort of feels like it's rustc's fault, as it's passing the proc-macro invalid syntax. I think it's odd that a macro can legally expand to invalid syntax... |
This comment has been minimized.
This comment has been minimized.
|
@PlasmaPower That sounds a rust-lang/rust problem, yes. Have you filed an issue? I'd love to see a short example of the failure. |
PlasmaPower
referenced this issue
Jan 11, 2018
Open
Rust passes invalid syntax to procedural macros when expanding other macros #47358
This comment has been minimized.
This comment has been minimized.
|
I've opened another issue for it: #47358 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ShadowNinja commentedMay 23, 2017
I found out that
#[export_name = concat!("external_", "name")]doesn't work, so I got a bit creative and tried this (reduced example):Which lead to this:
It just prints an error on stable (1.17.0):
And of course: