mystor / abomonation_derive Goto Github PK
View Code? Open in Web Editor NEWA macros 1.1 #[derive(Abomonation)] implementation for the abomonation crate
A macros 1.1 #[derive(Abomonation)] implementation for the abomonation crate
It seems like the derivation rules head out into crazy-land when we have type that may contain themselves, like
#[derive(Abomonation)]
struct TreeNode<D> {
data: D,
children: Vec<TreeNode<D>>,
}
When one attempts to use such a type with the T: Abomonation
constraint, Rust complains thusly:
error[E0275]: overflow evaluating the requirement `TreeNode<i32>: abomonation::Abomonation`
--> examples/types.rs:33:5
|
33 | test(&TreeNode::new(0));
| ^^^^
|
= note: required because of the requirements on the impl of `abomonation::Abomonation` for `std::vec::Vec<TreeNode<i32>>`
= note: required because of the requirements on the impl of `abomonation::Abomonation` for `TreeNode<i32>`
This doesn't seem to be a problem for serde
, whose Serialize
and Deserialize
traits derive correctly enough to allow Rust to make progress. The unsafe_abomonate!
macro produces implementations, but doesn't work with generic parameters.
Is this something that is expected to work, or perhaps annoying and non-trivial using syn
, or .. any input you have would be great!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.