mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-28 01:07:57 +00:00
Compare commits
24 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| da05163d51 | |||
| f3e2bb5104 | |||
| 7a4c1086b5 | |||
| e89feb9635 | |||
| 5f72766c27 | |||
| 85ae57040d | |||
| d55a4a279f | |||
| bee9299693 | |||
| 9529fcec96 | |||
| bcec168e23 | |||
| 102a332616 | |||
| a280942f02 | |||
| 637dba5c2a | |||
| 24f292d081 | |||
| fa5c99e48a | |||
| 48f1a2c9b2 | |||
| 50ebbd63c6 | |||
| 4e5f63ff45 | |||
| de709e72a8 | |||
| 56d3c8f071 | |||
| ce89adecc1 | |||
| bc7a85063d | |||
| 0574f1e020 | |||
| f9fdd60e2e |
@@ -48,6 +48,12 @@ matrix:
|
|||||||
- rust: 1.21.0
|
- rust: 1.21.0
|
||||||
- rust: 1.25.0
|
- rust: 1.25.0
|
||||||
- rust: 1.26.0
|
- rust: 1.26.0
|
||||||
|
- rust: 1.34.0
|
||||||
|
|
||||||
|
- rust: 1.36.0
|
||||||
|
script:
|
||||||
|
- cd "${TRAVIS_BUILD_DIR}/serde"
|
||||||
|
- cargo build --no-default-features --features alloc
|
||||||
|
|
||||||
- rust: nightly
|
- rust: nightly
|
||||||
name: Clippy
|
name: Clippy
|
||||||
|
|||||||
+2
-6
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.94" # remember to update html_root_url
|
version = "1.0.95" # remember to update html_root_url
|
||||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
|
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
description = "A generic serialization/deserialization framework"
|
description = "A generic serialization/deserialization framework"
|
||||||
@@ -48,11 +48,7 @@ unstable = []
|
|||||||
# Provide impls for types in the Rust core allocation and collections library
|
# Provide impls for types in the Rust core allocation and collections library
|
||||||
# including String, Box<T>, Vec<T>, and Cow<T>. This is a subset of std but may
|
# including String, Box<T>, Vec<T>, and Cow<T>. This is a subset of std but may
|
||||||
# be enabled without depending on all of std.
|
# be enabled without depending on all of std.
|
||||||
#
|
alloc = []
|
||||||
# Requires a dependency on the unstable core allocation library:
|
|
||||||
#
|
|
||||||
# https://doc.rust-lang.org/alloc/
|
|
||||||
alloc = ["unstable"]
|
|
||||||
|
|
||||||
# Opt into impls for Rc<T> and Arc<T>. Serializing and deserializing these types
|
# Opt into impls for Rc<T> and Arc<T>. Serializing and deserializing these types
|
||||||
# does not preserve identity and may result in multiple copies of the same data.
|
# does not preserve identity and may result in multiple copies of the same data.
|
||||||
|
|||||||
@@ -68,6 +68,10 @@ fn main() {
|
|||||||
if minor >= 28 {
|
if minor >= 28 {
|
||||||
println!("cargo:rustc-cfg=num_nonzero");
|
println!("cargo:rustc-cfg=num_nonzero");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if minor >= 34 {
|
||||||
|
println!("cargo:rustc-cfg=std_integer_atomics");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn rustc_minor_version() -> Option<u32> {
|
fn rustc_minor_version() -> Option<u32> {
|
||||||
|
|||||||
+32
-2
@@ -790,7 +790,8 @@ seq_impl!(
|
|||||||
BinaryHeap::clear,
|
BinaryHeap::clear,
|
||||||
BinaryHeap::with_capacity(size_hint::cautious(seq.size_hint())),
|
BinaryHeap::with_capacity(size_hint::cautious(seq.size_hint())),
|
||||||
BinaryHeap::reserve,
|
BinaryHeap::reserve,
|
||||||
BinaryHeap::push);
|
BinaryHeap::push
|
||||||
|
);
|
||||||
|
|
||||||
#[cfg(any(feature = "std", feature = "alloc"))]
|
#[cfg(any(feature = "std", feature = "alloc"))]
|
||||||
seq_impl!(
|
seq_impl!(
|
||||||
@@ -799,7 +800,8 @@ seq_impl!(
|
|||||||
BTreeSet::clear,
|
BTreeSet::clear,
|
||||||
BTreeSet::new(),
|
BTreeSet::new(),
|
||||||
nop_reserve,
|
nop_reserve,
|
||||||
BTreeSet::insert);
|
BTreeSet::insert
|
||||||
|
);
|
||||||
|
|
||||||
#[cfg(any(feature = "std", feature = "alloc"))]
|
#[cfg(any(feature = "std", feature = "alloc"))]
|
||||||
seq_impl!(
|
seq_impl!(
|
||||||
@@ -2543,3 +2545,31 @@ where
|
|||||||
Deserialize::deserialize(deserializer).map(Wrapping)
|
Deserialize::deserialize(deserializer).map(Wrapping)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(all(feature = "std", std_integer_atomics))]
|
||||||
|
macro_rules! atomic_impl {
|
||||||
|
($($ty:ident)*) => {
|
||||||
|
$(
|
||||||
|
impl<'de> Deserialize<'de> for $ty {
|
||||||
|
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
|
||||||
|
where
|
||||||
|
D: Deserializer<'de>,
|
||||||
|
{
|
||||||
|
Deserialize::deserialize(deserializer).map(Self::new)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)*
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(all(feature = "std", std_integer_atomics))]
|
||||||
|
atomic_impl! {
|
||||||
|
AtomicBool
|
||||||
|
AtomicI8 AtomicI16 AtomicI32 AtomicIsize
|
||||||
|
AtomicU8 AtomicU16 AtomicU32 AtomicUsize
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(all(feature = "std", std_integer_atomics, not(target_os = "emscripten")))]
|
||||||
|
atomic_impl! {
|
||||||
|
AtomicI64 AtomicU64
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
/// Conditional compilation depending on whether Serde is built with support for
|
/// Conditional compilation depending on whether Serde is built with support for
|
||||||
/// 128-bit integers.
|
/// 128-bit integers.
|
||||||
///
|
///
|
||||||
/// Data formats that wish to support Rust compiler versions older than 1.26 may
|
/// Data formats that wish to support Rust compiler versions older than 1.26
|
||||||
/// place the i128 / u128 methods of their Serializer and Deserializer behind
|
/// (or targets that lack 128-bit integers) may place the i128 / u128 methods
|
||||||
/// this macro.
|
/// of their Serializer and Deserializer behind this macro.
|
||||||
///
|
///
|
||||||
/// Data formats that require a minimum Rust compiler version of at least 1.26
|
/// Data formats that require a minimum Rust compiler version of at least 1.26,
|
||||||
/// do not need to bother with this macro and may assume support for 128-bit
|
/// or do not target platforms that lack 128-bit integers, do not need to
|
||||||
/// integers.
|
/// bother with this macro and may assume support for 128-bit integers.
|
||||||
///
|
///
|
||||||
/// ```edition2018
|
/// ```edition2018
|
||||||
/// # use serde::private::ser::Error;
|
/// # use serde::private::ser::Error;
|
||||||
|
|||||||
+9
-1
@@ -73,7 +73,7 @@
|
|||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
// Serde types in rustdoc of other crates get linked to here.
|
// Serde types in rustdoc of other crates get linked to here.
|
||||||
#![doc(html_root_url = "https://docs.rs/serde/1.0.94")]
|
#![doc(html_root_url = "https://docs.rs/serde/1.0.95")]
|
||||||
// Support using Serde without the standard library!
|
// Support using Serde without the standard library!
|
||||||
#![cfg_attr(not(feature = "std"), no_std)]
|
#![cfg_attr(not(feature = "std"), no_std)]
|
||||||
// Unstable functionality only if the user asks for it. For tracking and
|
// Unstable functionality only if the user asks for it. For tracking and
|
||||||
@@ -212,6 +212,14 @@ mod lib {
|
|||||||
#[cfg(range_inclusive)]
|
#[cfg(range_inclusive)]
|
||||||
pub use self::core::ops::RangeInclusive;
|
pub use self::core::ops::RangeInclusive;
|
||||||
|
|
||||||
|
#[cfg(all(feature = "std", std_integer_atomics))]
|
||||||
|
pub use std::sync::atomic::{
|
||||||
|
AtomicBool, AtomicI16, AtomicI32, AtomicI8, AtomicIsize, AtomicU16, AtomicU32, AtomicU8,
|
||||||
|
AtomicUsize, Ordering,
|
||||||
|
};
|
||||||
|
#[cfg(all(feature = "std", std_integer_atomics, not(target_os = "emscripten")))]
|
||||||
|
pub use std::sync::atomic::{AtomicI64, AtomicU64};
|
||||||
|
|
||||||
#[cfg(any(core_duration, feature = "std"))]
|
#[cfg(any(core_duration, feature = "std"))]
|
||||||
pub use self::core::time::Duration;
|
pub use self::core::time::Duration;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -620,6 +620,7 @@ impl Serialize for SystemTime {
|
|||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
macro_rules! serialize_display_bounded_length {
|
macro_rules! serialize_display_bounded_length {
|
||||||
($value:expr, $max:expr, $serializer:expr) => {{
|
($value:expr, $max:expr, $serializer:expr) => {{
|
||||||
|
#[allow(deprecated)]
|
||||||
let mut buffer: [u8; $max] = unsafe { mem::uninitialized() };
|
let mut buffer: [u8; $max] = unsafe { mem::uninitialized() };
|
||||||
let remaining_len = {
|
let remaining_len = {
|
||||||
let mut remaining = &mut buffer[..];
|
let mut remaining = &mut buffer[..];
|
||||||
@@ -838,3 +839,33 @@ where
|
|||||||
self.0.serialize(serializer)
|
self.0.serialize(serializer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#[cfg(all(feature = "std", std_integer_atomics))]
|
||||||
|
macro_rules! atomic_impl {
|
||||||
|
($($ty:ident)*) => {
|
||||||
|
$(
|
||||||
|
impl Serialize for $ty {
|
||||||
|
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||||
|
where
|
||||||
|
S: Serializer,
|
||||||
|
{
|
||||||
|
self.load(Ordering::SeqCst).serialize(serializer)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)*
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(all(feature = "std", std_integer_atomics))]
|
||||||
|
atomic_impl! {
|
||||||
|
AtomicBool
|
||||||
|
AtomicI8 AtomicI16 AtomicI32 AtomicIsize
|
||||||
|
AtomicU8 AtomicU16 AtomicU32 AtomicUsize
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(all(feature = "std", std_integer_atomics, not(target_os = "emscripten")))]
|
||||||
|
atomic_impl! {
|
||||||
|
AtomicI64 AtomicU64
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.94" # remember to update html_root_url
|
version = "1.0.95" # remember to update html_root_url
|
||||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
|
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
description = "Macros 1.1 implementation of #[derive(Serialize, Deserialize)]"
|
description = "Macros 1.1 implementation of #[derive(Serialize, Deserialize)]"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
//!
|
//!
|
||||||
//! [https://serde.rs/derive.html]: https://serde.rs/derive.html
|
//! [https://serde.rs/derive.html]: https://serde.rs/derive.html
|
||||||
|
|
||||||
#![doc(html_root_url = "https://docs.rs/serde_derive/1.0.94")]
|
#![doc(html_root_url = "https://docs.rs/serde_derive/1.0.95")]
|
||||||
#![allow(unknown_lints, bare_trait_objects)]
|
#![allow(unknown_lints, bare_trait_objects)]
|
||||||
#![cfg_attr(feature = "cargo-clippy", allow(renamed_and_removed_lints))]
|
#![cfg_attr(feature = "cargo-clippy", allow(renamed_and_removed_lints))]
|
||||||
#![cfg_attr(feature = "cargo-clippy", deny(clippy, clippy_pedantic))]
|
#![cfg_attr(feature = "cargo-clippy", deny(clippy, clippy_pedantic))]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "serde_test"
|
name = "serde_test"
|
||||||
version = "1.0.94" # remember to update html_root_url
|
version = "1.0.95" # remember to update html_root_url
|
||||||
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
|
authors = ["Erick Tryzelaar <erick.tryzelaar@gmail.com>", "David Tolnay <dtolnay@gmail.com>"]
|
||||||
license = "MIT OR Apache-2.0"
|
license = "MIT OR Apache-2.0"
|
||||||
description = "Token De/Serializer for testing De/Serialize implementations"
|
description = "Token De/Serializer for testing De/Serialize implementations"
|
||||||
|
|||||||
@@ -144,7 +144,7 @@
|
|||||||
//! # }
|
//! # }
|
||||||
//! ```
|
//! ```
|
||||||
|
|
||||||
#![doc(html_root_url = "https://docs.rs/serde_test/1.0.94")]
|
#![doc(html_root_url = "https://docs.rs/serde_test/1.0.95")]
|
||||||
#![cfg_attr(feature = "cargo-clippy", allow(renamed_and_removed_lints))]
|
#![cfg_attr(feature = "cargo-clippy", allow(renamed_and_removed_lints))]
|
||||||
#![cfg_attr(feature = "cargo-clippy", deny(clippy, clippy_pedantic))]
|
#![cfg_attr(feature = "cargo-clippy", deny(clippy, clippy_pedantic))]
|
||||||
// Ignored clippy lints
|
// Ignored clippy lints
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ serde = { path = "../serde" }
|
|||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
fnv = "1.0"
|
fnv = "1.0"
|
||||||
rustc-serialize = "0.3.16"
|
rustc-serialize = "0.3.16"
|
||||||
select-rustc = "0.1"
|
rustversion = "0.1"
|
||||||
serde = { path = "../serde", features = ["rc", "derive"] }
|
serde = { path = "../serde", features = ["rc", "derive"] }
|
||||||
serde_derive = { path = "../serde_derive", features = ["deserialize_in_place"] }
|
serde_derive = { path = "../serde_derive", features = ["deserialize_in_place"] }
|
||||||
serde_test = { path = "../serde_test" }
|
serde_test = { path = "../serde_test" }
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#[cfg(not(target_os = "emscripten"))]
|
#[cfg(not(target_os = "emscripten"))]
|
||||||
#[rustc::attr(not(nightly), ignore)]
|
#[rustversion::attr(not(nightly), ignore)]
|
||||||
#[test]
|
#[test]
|
||||||
fn ui() {
|
fn ui() {
|
||||||
let t = trybuild::TestCases::new();
|
let t = trybuild::TestCases::new();
|
||||||
|
|||||||
@@ -1,18 +1,27 @@
|
|||||||
#![allow(clippy::decimal_literal_representation)]
|
#![allow(clippy::decimal_literal_representation, clippy::unreadable_literal)]
|
||||||
#![cfg_attr(feature = "unstable", feature(never_type))]
|
#![cfg_attr(feature = "unstable", feature(never_type))]
|
||||||
|
|
||||||
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
|
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
|
||||||
use std::default::Default;
|
use std::default::Default;
|
||||||
use std::ffi::{CStr, CString, OsString};
|
use std::ffi::{CStr, CString, OsString};
|
||||||
|
use std::fmt::Debug;
|
||||||
use std::net;
|
use std::net;
|
||||||
use std::num::Wrapping;
|
use std::num::Wrapping;
|
||||||
use std::ops::Bound;
|
use std::ops::Bound;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
use std::rc::{Rc, Weak as RcWeak};
|
use std::rc::{Rc, Weak as RcWeak};
|
||||||
|
use std::sync::atomic::{
|
||||||
|
AtomicBool, AtomicI16, AtomicI32, AtomicI8, AtomicIsize, AtomicU16, AtomicU32, AtomicU8,
|
||||||
|
AtomicUsize, Ordering,
|
||||||
|
};
|
||||||
use std::sync::{Arc, Weak as ArcWeak};
|
use std::sync::{Arc, Weak as ArcWeak};
|
||||||
use std::time::{Duration, UNIX_EPOCH};
|
use std::time::{Duration, UNIX_EPOCH};
|
||||||
|
|
||||||
|
#[cfg(not(target_os = "emscripten"))]
|
||||||
|
use std::sync::atomic::{AtomicI64, AtomicU64};
|
||||||
|
|
||||||
use fnv::FnvHasher;
|
use fnv::FnvHasher;
|
||||||
|
use serde::de::DeserializeOwned;
|
||||||
use serde::{Deserialize, Deserializer};
|
use serde::{Deserialize, Deserializer};
|
||||||
use serde_test::{assert_de_tokens, assert_de_tokens_error, Configure, Token};
|
use serde_test::{assert_de_tokens, assert_de_tokens_error, Configure, Token};
|
||||||
|
|
||||||
@@ -1140,6 +1149,45 @@ fn test_never_type() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_atomics() {
|
||||||
|
fn test<L, A, T>(load: L, val: T, token: Token)
|
||||||
|
where
|
||||||
|
L: Fn(&A, Ordering) -> T,
|
||||||
|
A: DeserializeOwned,
|
||||||
|
T: PartialEq + Debug,
|
||||||
|
{
|
||||||
|
let tokens = &[token];
|
||||||
|
let mut de = serde_test::Deserializer::new(tokens);
|
||||||
|
match A::deserialize(&mut de) {
|
||||||
|
Ok(v) => {
|
||||||
|
let loaded = load(&v, Ordering::SeqCst);
|
||||||
|
assert_eq!(val, loaded);
|
||||||
|
}
|
||||||
|
Err(e) => panic!("tokens failed to deserialize: {}", e),
|
||||||
|
};
|
||||||
|
if de.remaining() > 0 {
|
||||||
|
panic!("{} remaining tokens", de.remaining());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
test(AtomicBool::load, true, Token::Bool(true));
|
||||||
|
test(AtomicI8::load, -127, Token::I8(-127i8));
|
||||||
|
test(AtomicI16::load, -510, Token::I16(-510i16));
|
||||||
|
test(AtomicI32::load, -131072, Token::I32(-131072i32));
|
||||||
|
test(AtomicIsize::load, -131072isize, Token::I32(-131072));
|
||||||
|
test(AtomicU8::load, 127, Token::U8(127u8));
|
||||||
|
test(AtomicU16::load, 510u16, Token::U16(510u16));
|
||||||
|
test(AtomicU32::load, 131072u32, Token::U32(131072u32));
|
||||||
|
test(AtomicUsize::load, 131072usize, Token::U32(131072));
|
||||||
|
|
||||||
|
#[cfg(not(target_os = "emscripten"))]
|
||||||
|
{
|
||||||
|
test(AtomicI64::load, -8589934592, Token::I64(-8589934592));
|
||||||
|
test(AtomicU64::load, 8589934592u64, Token::U64(8589934592));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
declare_error_tests! {
|
declare_error_tests! {
|
||||||
test_unknown_field<StructDenyUnknown> {
|
test_unknown_field<StructDenyUnknown> {
|
||||||
&[
|
&[
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
#![allow(clippy::unreadable_literal)]
|
||||||
#![cfg_attr(feature = "unstable", feature(never_type))]
|
#![cfg_attr(feature = "unstable", feature(never_type))]
|
||||||
|
|
||||||
use std::cell::RefCell;
|
use std::cell::RefCell;
|
||||||
@@ -9,11 +10,17 @@ use std::num::Wrapping;
|
|||||||
use std::ops::Bound;
|
use std::ops::Bound;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
use std::rc::{Rc, Weak as RcWeak};
|
use std::rc::{Rc, Weak as RcWeak};
|
||||||
|
use std::sync::atomic::{
|
||||||
|
AtomicBool, AtomicI16, AtomicI32, AtomicI8, AtomicIsize, AtomicU16, AtomicU32, AtomicU8,
|
||||||
|
AtomicUsize,
|
||||||
|
};
|
||||||
use std::sync::{Arc, Weak as ArcWeak};
|
use std::sync::{Arc, Weak as ArcWeak};
|
||||||
use std::time::{Duration, UNIX_EPOCH};
|
use std::time::{Duration, UNIX_EPOCH};
|
||||||
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
use std::str;
|
use std::str;
|
||||||
|
#[cfg(not(target_os = "emscripten"))]
|
||||||
|
use std::sync::atomic::{AtomicI64, AtomicU64};
|
||||||
|
|
||||||
use fnv::FnvHasher;
|
use fnv::FnvHasher;
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
@@ -483,6 +490,26 @@ declare_tests! {
|
|||||||
Token::Str("1a"),
|
Token::Str("1a"),
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
test_atomic {
|
||||||
|
AtomicBool::new(false) => &[Token::Bool(false)],
|
||||||
|
AtomicBool::new(true) => &[Token::Bool(true)],
|
||||||
|
AtomicI8::new(63i8) => &[Token::I8(63i8)],
|
||||||
|
AtomicI16::new(-318i16) => &[Token::I16(-318i16)],
|
||||||
|
AtomicI32::new(65792i32) => &[Token::I32(65792i32)],
|
||||||
|
AtomicIsize::new(-65792isize) => &[Token::I64(-65792i64)],
|
||||||
|
AtomicU8::new(192u8) => &[Token::U8(192u8)],
|
||||||
|
AtomicU16::new(510u16) => &[Token::U16(510u16)],
|
||||||
|
AtomicU32::new(131072u32) => &[Token::U32(131072u32)],
|
||||||
|
AtomicUsize::new(655360usize) => &[Token::U64(655360u64)],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(not(target_os = "emscripten"))]
|
||||||
|
declare_tests! {
|
||||||
|
test_atomic64 {
|
||||||
|
AtomicI64::new(-4295032832i64) => &[Token::I64(-4295032832i64)],
|
||||||
|
AtomicU64::new(12884901888u64) => &[Token::U64(12884901888u64)],
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
declare_tests! {
|
declare_tests! {
|
||||||
|
|||||||
Reference in New Issue
Block a user