From b2977bd3ed3c7ebbdadca3a9dfaf522675ae608b Mon Sep 17 00:00:00 2001 From: Trangar Date: Tue, 4 Oct 2022 11:42:26 +0200 Subject: [PATCH] Added `[serde(tag)]` to the list of tags that are known to give issues (#584) * Added `[serde(tag)]` to the list of tags that are known to give issues * Removed the old warning about serde and no-std. Added references to the documentation in the serde::DecodeError enum --- src/features/serde/mod.rs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/features/serde/mod.rs b/src/features/serde/mod.rs index 0f2ba09..04a5069 100644 --- a/src/features/serde/mod.rs +++ b/src/features/serde/mod.rs @@ -41,14 +41,13 @@ //! //! # Known issues //! -//! Currently the `serde` feature will automatically enable the `alloc` and `std` feature. If you're running in a `#[no_std]` environment consider using bincode's own derive macros. -//! //! Because bincode is a format without meta data, there are several known issues with serde's attributes. Please do not use any of the following attributes if you plan on using bincode, or use bincode's own `derive` macros. -//! - `#[serde(skip)]` -//! - `#[serde(skip_serializing)]` -//! - `#[serde(skip_deserializing)]` -//! - `#[serde(skip_serializing_if = "path")]` //! - `#[serde(flatten)]` +//! - `#[serde(skip)]` +//! - `#[serde(skip_deserializing)]` +//! - `#[serde(skip_serializing)]` +//! - `#[serde(skip_serializing_if = "path")]` +//! - `#[serde(tag = "...")]` //! - `#[serde(untagged)]` //! //! **Using any of the above attributes can and will cause issues with bincode and will result in lost data**. Consider using bincode's own derive macro instead. @@ -68,13 +67,17 @@ pub use self::ser::*; #[derive(Debug)] #[non_exhaustive] pub enum DecodeError { - /// Bincode does not support serde's `any` decoding feature + /// Bincode does not support serde's `any` decoding feature. + /// + /// See the "known issues" list in the serde module for more information on this. AnyNotSupported, /// Bincode does not support serde identifiers IdentifierNotSupported, - /// Bincode does not support serde's `ignored_any` + /// Bincode does not support serde's `ignored_any`. + /// + /// See the "known issues" list in the serde module for more information on this. IgnoredAnyNotSupported, /// Serde tried decoding a borrowed value from an owned reader. Use `serde_decode_borrowed_from_*` instead