bytes!(...).as_ptr() is used in freestanding code to produce needed byte arrays with specific content. This causes an entire allocation of the slice data in rustc:
@const = private constant [6 x i8] c"TEXT!\00"
@_ZN4main5BYTES20h0c254b3a0ff92eb8Naa4v0.0E = internal unnamed_addr constant { i8*, i32 } { i8* getelementptr inbounds ([6 x i8]* @const, i32 0, i32 0), i32 6 }
whereas in clang, the structure is elided, as evidenced by compiling this C code with -O4 -S:
static struct {
char *ptr;
int size;
} ZN = {"TEXT!", 6};
int main() {
return (int) ZN.ptr;
}