str.as_bytes uses mem::transmute. The mem::transmute documentation says that this copies the bytes.
But I find it hard to believe that as_bytes, which is used everywhere, include str.len, would be so involved. Further, a simple test shows that if you mutate the returned bytes, the original string is mutated.
So, either I'm misunderstanding mem::transmute's documentation, or I'm missing something very obvious.
When as_bytes uses transmute, the bytes that are copied are the 16 bytes that make up that pointer and length. The data behind the pointer is not copied.