Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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?



(*role) is not a reference at all, it is a value. its type is Role.


lvalue not mutable reference, got it. I'm surprised there are contexts where one is fine but the other is UB, but I understand the rule.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: