@@ -2,7 +2,7 @@ error: calling `CStr::new` with a byte string literal
2
2
--> $DIR/manual_c_str_literals.rs:32:5
3
3
|
4
4
LL | CStr::from_bytes_with_nul(b"foo\0");
5
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a c-str literal: `c"foo"`
5
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a `c""` literal: `c"foo"`
6
6
|
7
7
= note: `-D clippy::manual-c-str-literals` implied by `-D warnings`
8
8
= help: to override `-D warnings` add `#[allow(clippy::manual_c_str_literals)]`
@@ -11,37 +11,37 @@ error: calling `CStr::new` with a byte string literal
11
11
--> $DIR/manual_c_str_literals.rs:36:5
12
12
|
13
13
LL | CStr::from_bytes_with_nul(b"foo\0");
14
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a c-str literal: `c"foo"`
14
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a `c""` literal: `c"foo"`
15
15
16
16
error: calling `CStr::new` with a byte string literal
17
17
--> $DIR/manual_c_str_literals.rs:37:5
18
18
|
19
19
LL | CStr::from_bytes_with_nul(b"foo\x00");
20
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a c-str literal: `c"foo"`
20
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a `c""` literal: `c"foo"`
21
21
22
22
error: calling `CStr::new` with a byte string literal
23
23
--> $DIR/manual_c_str_literals.rs:38:5
24
24
|
25
25
LL | CStr::from_bytes_with_nul(b"foo\0").unwrap();
26
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a c-str literal: `c"foo"`
26
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a `c""` literal: `c"foo"`
27
27
28
28
error: calling `CStr::new` with a byte string literal
29
29
--> $DIR/manual_c_str_literals.rs:39:5
30
30
|
31
31
LL | CStr::from_bytes_with_nul(b"foo\\0sdsd\0").unwrap();
32
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a c-str literal: `c"foo\\0sdsd"`
32
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a `c""` literal: `c"foo\\0sdsd"`
33
33
34
34
error: calling `CStr::from_ptr` with a byte string literal
35
35
--> $DIR/manual_c_str_literals.rs:44:14
36
36
|
37
37
LL | unsafe { CStr::from_ptr(b"foo\0".as_ptr().cast()) };
38
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a c-str literal: `c"foo"`
38
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a `c""` literal: `c"foo"`
39
39
40
40
error: calling `CStr::from_ptr` with a byte string literal
41
41
--> $DIR/manual_c_str_literals.rs:45:14
42
42
|
43
43
LL | unsafe { CStr::from_ptr(b"foo\0".as_ptr() as *const _) };
44
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a c-str literal: `c"foo"`
44
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a `c""` literal: `c"foo"`
45
45
46
46
error: aborting due to 7 previous errors
47
47
0 commit comments