Fix assert_next_token on old rustc
This commit is contained in:
parent
f54d597b2e
commit
aed5a77540
@ -28,17 +28,17 @@ impl<'a> Serializer<'a> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
macro_rules! assert_next_token {
|
macro_rules! assert_next_token {
|
||||||
($self:ident, $expected:ident($a:expr)) => {
|
($ser:ident, $expected:ident($a:expr)) => {
|
||||||
assert_next_token!($self, $expected { a: $a });
|
assert_next_token!($ser, $expected { a: $a });
|
||||||
};
|
};
|
||||||
($self:ident, $expected:ident($a:expr, $b:expr)) => {
|
($ser:ident, $expected:ident($a:expr, $b:expr)) => {
|
||||||
assert_next_token!($self, $expected { a: $a, b: $b });
|
assert_next_token!($ser, $expected { a: $a, b: $b });
|
||||||
};
|
};
|
||||||
($self:ident, $expected:ident($a:expr, $b:expr, $c:expr)) => {
|
($ser:ident, $expected:ident($a:expr, $b:expr, $c:expr)) => {
|
||||||
assert_next_token!($self, $expected { a: $a, b: $b, c: $c });
|
assert_next_token!($ser, $expected { a: $a, b: $b, c: $c });
|
||||||
};
|
};
|
||||||
($self:ident, $expected:ident $({ $($n:ident: $v:expr),* })*) => {
|
($ser:ident, $expected:ident $({ $($n:ident: $v:expr),* })*) => {
|
||||||
match $self.next_token() {
|
match $ser.next_token() {
|
||||||
Some(Token::$expected $(($($n),*))*) $(if $($n == $v)&&*)* => {}
|
Some(Token::$expected $(($($n),*))*) $(if $($n == $v)&&*)* => {}
|
||||||
Some(other) => {
|
Some(other) => {
|
||||||
panic!("expected Token::{} but serialized as {:?}",
|
panic!("expected Token::{} but serialized as {:?}",
|
||||||
|
@ -67,10 +67,14 @@ else
|
|||||||
cd "$DIR/serde"
|
cd "$DIR/serde"
|
||||||
channel build --features rc
|
channel build --features rc
|
||||||
channel build --no-default-features
|
channel build --no-default-features
|
||||||
|
cd "$DIR/serde_test"
|
||||||
|
channel build
|
||||||
|
|
||||||
CHANNEL=1.13.0
|
CHANNEL=1.13.0
|
||||||
cargo clean
|
cargo clean
|
||||||
cd "$DIR/serde"
|
cd "$DIR/serde"
|
||||||
channel build --features rc
|
channel build --features rc
|
||||||
channel build --no-default-features
|
channel build --no-default-features
|
||||||
|
cd "$DIR/serde_test"
|
||||||
|
channel build
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user