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 updifficulty: unstable helper macro used by stable macro_rules macro #24534
Comments
steveklabnik
added
the
A-macros
label
Apr 18, 2015
This comment has been minimized.
This comment has been minimized.
|
Doesn't seem actionable. |
brson
closed this
Dec 1, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
pnkfelix commentedApr 17, 2015
Spawned off of #24370
As a strategy for statically checking the input to the
panic!macro, I had its expansion include a helper procedural macro that did some inspection of the input.The helper macro (named
ensure_not_fmt_string_literal, though that really shouldn't matter) was supposed to be unstable. We don't have a direct way to mark such a macro as unstable though, since it ends up being exposed during the intermediate expansion of client code that invokespanic!(orassert!, etc).Furthermore, some very clever hacks that @huonw came up with (and some not so clever hacks from me) all failed to enforce the desired instability guarantee.
panic!.In either case, making this yield instability required that
ensure_not_fmt_string_literalnot carry the#[allow_internal_unstable]attribute. But then removing that attribute caused its expansion into uses of format internals to fail. (This should not have been an issue, according to @huonw .)So, at this point, I have decided to punt on solving this problem. Thus this ticket, which says: Let's fix this. Eventually. Maybe.