Make serialize_with attribute produce code that works if respanned to 2024 edition (#2950, thanks @aytey)