power-assert-rs
                                
                                 power-assert-rs copied to clipboard
                                
                                    power-assert-rs copied to clipboard
                            
                            
                            
                        Rewrite using proc-macro-hack
Hey,
It's now possible to create functionlike!() proc macros on stable rust using proc-macro-hack.
I'm going to try rewriting power-assert-rs using it.
Actually, this is impossible because of https://github.com/dtolnay/proc-macro-hack/issues/15.
Proc Macros are going to be stabilized on 1.30, but they won't be able to expand to expressions. Furthermore, this proc macro would rely on spans, which are also unstable still. I'll rewrite it using those feature so they work on the latest nightly.
https://github.com/roblabla/power-assert-rs
here's a WIP port to Proc Macros 1.30. It has several problems:
- It hits https://github.com/alexcrichton/proc-macro2/issues/110
- It uses a doc hidden'd function from proc_macro2: Span::unstable(), in order to avoid thesemver_exemptcfg flag.
- It requires two nightly features: proc_macro_hygieneandproc_macro_span
I released proc-macro-hack 0.5.0 which preserves spans and supports expanding to expressions.
There’s a PR open to recover the raw string of a Span: https://github.com/rust-lang/rust/pull/55780. It will be feature gated behind proc_macro_span.
Once it lands, I’ll update my fork, and it’ll likely be usable (albeit nightly only)