Hmm, I think that an immutable marker trait in the presence of unions seems confusing.
An immutable type could be a token to prove that a non-thread-safe api is only called from a single thread. For example on windows and macOS UI operations must happen on the main thread, so you could have a token to do such operations that isn't Send
or Sync
to ensure it isn't moved away from the main thread. In this case there is no interior mutability as the token could be a ZST which trivially doesn't have interior mutability.
5 Likes
@bjorn3 That's why I said almost
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.