Skip to content

Commit

Permalink
Added [serde(tag)] to the list of tags that are known to give issues (
Browse files Browse the repository at this point in the history
#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
  • Loading branch information
VictorKoenders committed Oct 4, 2022
1 parent bdbc051 commit 2f05552
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/features/serde/mod.rs
Expand Up @@ -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(flatten)]`
//! - `#[serde(skip)]`
//! - `#[serde(skip_serializing)]`
//! - `#[serde(skip_deserializing)]`
//! - `#[serde(skip_serializing)]`
//! - `#[serde(skip_serializing_if = "path")]`
//! - `#[serde(flatten)]`
//! - `#[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.
Expand All @@ -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
Expand Down

0 comments on commit 2f05552

Please sign in to comment.