diff --git a/serde/src/de/mod.rs b/serde/src/de/mod.rs index 79ecd9b0..245aa6ea 100644 --- a/serde/src/de/mod.rs +++ b/serde/src/de/mod.rs @@ -1498,6 +1498,11 @@ pub trait MapAccess<'de> { /// /// `Deserialize` implementations should typically use /// `MapAccess::next_value` instead. + /// + /// # Panics + /// + /// Calling `next_value_seed` before `next_key_seed` is incorrect and is + /// allowed to panic or return bogus results. fn next_value_seed(&mut self, seed: V) -> Result where V: DeserializeSeed<'de>; @@ -1546,6 +1551,11 @@ pub trait MapAccess<'de> { /// /// This method exists as a convenience for `Deserialize` implementations. /// `MapAccess` implementations should not override the default behavior. + /// + /// # Panics + /// + /// Calling `next_value` before `next_key` is incorrect and is allowed to + /// panic or return bogus results. #[inline] fn next_value(&mut self) -> Result where