Do you have a source/explanation for *role not being a mutable reference? What is this expression's type then?
You mention ptr::write() but it is not used here, and I don't see how you could use it to write to a field?
You mention ptr::write() but it is not used here, and I don't see how you could use it to write to a field?