Merge branch 'origin/1.0' into 'origin/remote'

Conflicts:
    serde_derive/src/de.rs
This commit is contained in:
David Tolnay 2017-04-09 13:19:04 -07:00
commit 78f682590a
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 7 additions and 15 deletions

View File

@ -234,13 +234,6 @@ fn deserialize_unit_struct(params: &Parameters, item_attrs: &attr::Item) -> Frag
{ {
_serde::export::Ok(#this) _serde::export::Ok(#this)
} }
#[inline]
fn visit_seq<__V>(self, _: __V) -> _serde::export::Result<Self::Value, __V::Error>
where __V: _serde::de::SeqVisitor<'de>
{
_serde::export::Ok(#this)
}
} }
_serde::Deserializer::deserialize_unit_struct(__deserializer, #type_name, __Visitor) _serde::Deserializer::deserialize_unit_struct(__deserializer, #type_name, __Visitor)

View File

@ -242,14 +242,6 @@ declare_tests! {
UnitStruct => &[ UnitStruct => &[
Token::UnitStruct("UnitStruct"), Token::UnitStruct("UnitStruct"),
], ],
UnitStruct => &[
Token::Seq(Some(0)),
Token::SeqEnd,
],
UnitStruct => &[
Token::Seq(None),
Token::SeqEnd,
],
} }
test_newtype_struct { test_newtype_struct {
NewtypeStruct(1) => &[ NewtypeStruct(1) => &[
@ -1036,4 +1028,11 @@ declare_error_tests! {
], ],
Error::Message("invalid type: floating point `0`, expected isize".into()), Error::Message("invalid type: floating point `0`, expected isize".into()),
} }
test_unit_struct_from_seq<UnitStruct> {
&[
Token::Seq(Some(0)),
Token::SeqEnd,
],
Error::Message("invalid type: sequence, expected unit struct UnitStruct".into()),
}
} }