()
| 626 | #[test] |
| 627 | #[should_panic(expected = "type changed")] |
| 628 | fn test_tuple_len_changed() { |
| 629 | struct TupleN(usize); |
| 630 | impl Serialize for TupleN { |
| 631 | fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> { |
| 632 | let mut tuple = serializer.serialize_tuple(self.0)?; |
| 633 | (0..self.0).try_for_each(|_| tuple.serialize_element(&false))?; |
| 634 | tuple.end() |
| 635 | } |
| 636 | } |
| 637 | let _ = crate::serialize(&vec![TupleN(1), TupleN(2)]); |
| 638 | } |
| 639 | |
| 640 | // Has to be a macro because it borrows something on the stack and returns it. |
| 641 | macro_rules! new_wrapper { |
nothing calls this directly
no test coverage detected