Require std for deserializing untagged enums

This commit is contained in:
David Tolnay 2017-02-02 19:06:28 -08:00
parent ff21d557c7
commit d298da0b4f
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
4 changed files with 11 additions and 3 deletions

View File

@ -1,5 +1,11 @@
use std::fmt;
use std::marker::PhantomData;
use core::fmt;
use core::marker::PhantomData;
#[cfg(all(not(feature = "std"), feature = "collections"))]
use collections::{String, Vec};
#[cfg(all(feature = "alloc", not(feature = "std")))]
use alloc::boxed::Box;
use de::{
self,

View File

@ -115,6 +115,7 @@ mod from_primitive;
// Helpers used by generated code. Not public API.
#[doc(hidden)]
pub mod private;
#[cfg(any(feature = "std", feature = "collections"))]
mod content;
///////////////////////////////////////////////////////////////////////////////

View File

@ -2,6 +2,7 @@ use core::marker::PhantomData;
use de::{Deserialize, Deserializer, Error, Visitor};
#[cfg(any(feature = "std", feature = "collections"))]
pub use de::content::{
Content,
TaggedContentVisitor,

View File

@ -1,4 +1,4 @@
use std::fmt::{self, Display};
use core::fmt::{self, Display};
use ser::{self, Serialize, Serializer, SerializeMap, SerializeStruct};