Stream: t-lang/wg-unsafe-code-guidelines

Topic: *mut T -> &T


Diggory Blake (May 21 2020 at 22:23, on Zulip):

If I have a *mut T, can I turn it into a reference with &*ptr without enforcing uniqueness, or do I have to cast it to a *const T first? &*(ptr as *const T)

Lokathor (May 21 2020 at 23:49, on Zulip):

It's the same either way if you're making &T

Last update: Jun 05 2020 at 23:10UTC