Factor attr parsing into serde_item crate
Fixes#396. @KodrAus [let me know whether this fits the bill.](5c6a0e12e9/serde_item/src)
a few other changes to make the API a little more presentable:
- Rename attr::{ContainerAttrs,VariantAttrs,FieldAttrs} to remove the "Attrs" (I see you worked on the corresponding [clippy lint](https://github.com/Manishearth/rust-clippy/issues/904)).
- Rename attr::Container* to attr::Item to correspond with item::Item and ast::Item. The others already had a correspondence (attr::Variant/item::Variant/ast::Variant, attr::Field/item::Field/ast::Field). Also a unit struct isn't much of a "container."
- Change item::Item::from_ast to return a meaningful error enum instead of printing a message that was hard to generalize to other uses.
- Add item::Variant.span for consistency because Item and Field already had span.
- Remove the "ident" field from attr::Name because we can just fold it into the other two fields.
- Remove attr::Name::(de)serialize_name_expr because it wasn't using the right AstBuilder in the first place.
- Rename the attr:: constructors from_item/from_variant/from_field to from_ast to line up with the item:: constructors; the signatures match.
- Remove attr's dependency on aster because we were only using it for two very simple things.
Better error when deriving Deserialize for struct containing &str
Fixes#360. The error looks like this:
```rust
#[derive(Serialize, Deserialize)]
struct Test<'a> {
s: &'a str,
}
```
```
src/main.rs:6:5: 6:15 error: Serde does not support deserializing fields of type &str; consider using String instead
src/main.rs:6 s: &'a str,
^~~~~~~~~~
```
Add serde_codegen::expand to avoid public Syntex dependency
Required for #358. We can remove `serde_codegen::register` in the next breaking release.
This allows Syntex users to avoid being broken by Serde bumping its Syntex dependency.