From 5f84e601b6a4f6782a74706b3bc46c8ab255e547 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 16 Jun 2016 23:25:46 -0700 Subject: [PATCH] Add explanation of ignored errors in attr.rs --- serde_codegen/src/attr.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/serde_codegen/src/attr.rs b/serde_codegen/src/attr.rs index dee02975..9bcf7719 100644 --- a/serde_codegen/src/attr.rs +++ b/serde_codegen/src/attr.rs @@ -15,6 +15,14 @@ use aster::ident::ToIdent; use error::Error; +// This module handles parsing of `#[serde(...)]` attributes. The entrypoints +// are `ContainerAttrs::from_item`, `VariantAttrs::from_variant`, and +// `FieldAttrs::from_field`. Each returns an instance of the corresponding +// struct. Note that none of them return a Result. Unrecognized, malformed, or +// duplicated attributes result in a span_err but otherwise are ignored. The +// user will see errors simultaneously for all bad attributes in the crate +// rather than just the first. + struct Attr<'a, 'b: 'a, T> { cx: &'a ExtCtxt<'b>, name: &'static str,