Closed aldanor closed 7 years ago
Wow, that is a lot of commits, thanks!
So, I'll need to work through most of these, but they look good at first blush.
One comment on the PhantomData
commit - I wonder if it would be better to have a new(ignore)
attribute rather than special-casing PhantomData
? It would be more boilerplate, but it is a more general-purpose mechanism. And it means you don't need to deal with scoping, hygiene, etc.
FWIW serde recognizes PhantomData as a special case here the same way and nobody has complained.
Yea, the part with PhantomData
is a tad hacky but would work in like 99% common cases.
#[new(ignore)]
we could add separately too, I'm not sure there's much value in that though (since you still need to construct the initialiser value, I guess it has to be something like a unit struct, which is not the most common thing of all...)
(Updated the README / description, not ideal but something's better than nothing)
OK, seems fine to special case PhantomData
and perhaps support new(ignore)
later. The README changes look good. So, I think if you can restore the Cargo.lock, then I can merge. Thanks!
I've checked the updated Cargo.lock
back in.
I also have some compile-fail tests in my local branch (for attr stuff), wondering if I should push them here as well before this gets merged?
I also have some compile-fail tests in my local branch (for attr stuff), wondering if I should push them here as well before this gets merged?
Sure, the more tests the better :-)
@nrc Done :)
(btw it'd be nice to set up travis for all this of course, eventually...)
Thank you!
Hello and sorry for the massive PR, it was much easier in this case to do it all in one go rather than submit incremental patches.
Changes:
quote!
doesn't chokesyn
andquote
dependencies to the latest versionsPhantomData
, closes #16new(default)
andnew(value = "..")
, closes #2Basically, this now works :) (bikeshedding over attr syntax welcome)
TODO, in separate PRs:
#[allow(..)]
and#[cfg_attr(.., allow(..))]
attrs to impls@nrc @dtolnay @kirillkh