We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 46c52c4 commit 2f4c1bfCopy full SHA for 2f4c1bf
1 file changed
tests/unit/out/unsafe/string_literals_c.rs
@@ -19,12 +19,12 @@ unsafe fn main_0() -> i32 {
19
b"c\0".as_ptr().cast_mut(),
20
];
21
let mut immutable_strings: [*const u8; 3] = [
22
- b"a\0".as_ptr().cast_mut(),
23
- b"b\0".as_ptr().cast_mut(),
24
- b"c\0".as_ptr().cast_mut(),
+ b"a\0".as_ptr().cast_mut().cast_const(),
+ b"b\0".as_ptr().cast_mut().cast_const(),
+ b"c\0".as_ptr().cast_mut().cast_const(),
25
26
let mut mutable_string: *mut u8 = b"hello\0".as_ptr().cast_mut();
27
- let mut immutable_string: *const u8 = b"hello\0".as_ptr().cast_mut();
+ let mut immutable_string: *const u8 = b"hello\0".as_ptr().cast_mut().cast_const();
28
(unsafe {
29
let _str: *mut u8 = b"world\0".as_ptr().cast_mut();
30
foo_0(_str)
0 commit comments