mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-13 19:31:02 +00:00
Produce errors on attr that fails to parse as Meta
This commit is contained in:
@@ -38,6 +38,11 @@ impl Ctxt {
|
||||
.push(syn::Error::new_spanned(obj.into_token_stream(), msg));
|
||||
}
|
||||
|
||||
/// Add one of Syn's parse errors.
|
||||
pub fn syn_error(&self, err: syn::Error) {
|
||||
self.errors.borrow_mut().as_mut().unwrap().push(err);
|
||||
}
|
||||
|
||||
/// Consume this object, producing a formatted error string if there are errors.
|
||||
pub fn check(self) -> Result<(), Vec<syn::Error>> {
|
||||
let errors = self.errors.borrow_mut().take().unwrap();
|
||||
|
||||
Reference in New Issue
Block a user