[rust-dev] Deriving keyword

benjamin adamson adamson.benjamin at gmail.com
Thu Jan 23 20:32:29 PST 2014


Question, what constitutes whether a 'trait' is applicable for
implementation by the #deriving() attribute?

According to the language specification on master:
http://static.rust-lang.org/doc/master/rust.html#deriving

There exists a static list. I found myself interested in the idea of using
the deriving attribute to derive a simple drawable implementation:

https://github.com/JeremyLetang/rust-sfml/blob/master/src/rsfml/traits/drawable.rs

but then looked up the attribute in the rust manual, and noticed that there
is a static list of what I will call 'traits that support the deriving
attribute'. Why the restriction? Is there some prior reading on this? Is
there any plan on letting libraries define more types that can be
'derivable'?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140123/23f89748/attachment.html>


More information about the Rust-dev mailing list