Okay, so I think I've figured this out: This occurs because we incorrectly "calculate" the deserialiser tags in Rust. We do this: https://searchfox.org/mozilla-central/rev/4a8bd8efdfaa43dd14a16d3cb15bf86796fd1def/tools/profiler/rust-api/src/marker/deserializer_tags_state.rs#64 ```rust let unique_marker_tag = &T::marker_type_name as *const _ as usize; ``` which //claims// to take the address of the `marker_type_name` method of the struct that we're trying to serialise. In reality, however, it does something different (I'm unsure of the specific semantics), and always returns a constant `1`. Because of this, when we come to deserialise, we always choose the deserialiser function of the //first// marker that we recorded. In my case, that involved trying to deserialise two integers (rather than an integer and a bool), which then panicked. To fix this, we need to make it so that the `unique_marker_tag` is, well, unique. This seems to work instead: ```rust let unique_marker_tag = T::marker_type_name as *const () as usize; ```
Bug 1918186 Comment 1 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Okay, so I think I've figured this out: This occurs because we incorrectly "calculate" the deserialiser tags in Rust. We do this: https://searchfox.org/mozilla-central/rev/4a8bd8efdfaa43dd14a16d3cb15bf86796fd1def/tools/profiler/rust-api/src/marker/deserializer_tags_state.rs#64 ```rust let unique_marker_tag = &T::marker_type_name as *const _ as usize; ``` which *claims* to take the address of the `marker_type_name` method of the struct that we're trying to serialise. In reality, however, it does something different (I'm unsure of the specific semantics), and always returns a constant `1`. Because of this, when we come to deserialise, we always choose the deserialiser function of the *first* marker that we recorded. In my case, that involved trying to deserialise two integers (rather than an integer and a bool), which then panicked. To fix this, we need to make it so that the `unique_marker_tag` is, well, unique. This seems to work instead: ```rust let unique_marker_tag = T::marker_type_name as *const () as usize; ```