diff --git a/serde/src/ser/mod.rs b/serde/src/ser/mod.rs index 54dac04e..6472909b 100644 --- a/serde/src/ser/mod.rs +++ b/serde/src/ser/mod.rs @@ -1639,6 +1639,11 @@ pub trait SerializeMap { T: Serialize; /// Serialize a map value. + /// + /// # Panics + /// + /// Calling `serialize_value` before `serialize_key` is incorrect and is + /// allowed to panic or produce bogus results. fn serialize_value(&mut self, value: &T) -> Result<(), Self::Error> where T: Serialize;