This repository contains a proof-of-concept implementation for the parse-generics-and-where
RFC. It requires the rustc
nightly from 2016-04-06.
parse-generics-poc
contains the implementation of the parse_generics!
and parse_where!
macros.
parse-macros
implements stable macro_rules!
macros for destructuring the various Rust items by making use of the parse_generics!
and parse_where!
macros. Note that these macros have not been updated for the specialisation RFC, or the restricted pub
RFC.
tests/derive_clone_copy.rs
: derives an implementation ofClone
that usesCopy
.tests/derive_iterator.rs
: derivesIterator
for newtypestruct
s.tests/simple.rs
: asserts the output of the macros.tests/wrap_fn.rs
: defines a macro to wrap a function with prologue/epilogue code.
examples/derive_clone.rs
: stablemacro_rules!
re-implementation of the existingClone
derive attribute.examples/derive_partial_ord.rs
: stablemacro_rules!
re-implementation of the existingPartialOrd
derive attribute.examples/reflect.rs
: stable macro to derive (partial and inefficient) runtime reflection structures.examples/sandbox.rs
: dumps the parsed form of some random bits of code.tests/derive_serialize.rs
: stable macro that derives serde'sSerialize
trait.