1
1
error: calling `CStr::new` with a byte string literal
2
- --> tests/ui/manual_c_str_literals.rs:31 :5
2
+ --> tests/ui/manual_c_str_literals.rs:34 :5
3
3
|
4
4
LL | CStr::from_bytes_with_nul(b"foo\0");
5
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a `c""` literal: `c"foo"`
@@ -8,73 +8,73 @@ LL | CStr::from_bytes_with_nul(b"foo\0");
8
8
= help: to override `-D warnings` add `#[allow(clippy::manual_c_str_literals)]`
9
9
10
10
error: calling `CStr::new` with a byte string literal
11
- --> tests/ui/manual_c_str_literals.rs:35 :5
11
+ --> tests/ui/manual_c_str_literals.rs:38 :5
12
12
|
13
13
LL | CStr::from_bytes_with_nul(b"foo\0");
14
14
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a `c""` literal: `c"foo"`
15
15
16
16
error: calling `CStr::new` with a byte string literal
17
- --> tests/ui/manual_c_str_literals.rs:36 :5
17
+ --> tests/ui/manual_c_str_literals.rs:39 :5
18
18
|
19
19
LL | CStr::from_bytes_with_nul(b"foo\x00");
20
20
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a `c""` literal: `c"foo"`
21
21
22
22
error: calling `CStr::new` with a byte string literal
23
- --> tests/ui/manual_c_str_literals.rs:37 :5
23
+ --> tests/ui/manual_c_str_literals.rs:40 :5
24
24
|
25
25
LL | CStr::from_bytes_with_nul(b"foo\0").unwrap();
26
26
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a `c""` literal: `c"foo"`
27
27
28
28
error: calling `CStr::new` with a byte string literal
29
- --> tests/ui/manual_c_str_literals.rs:38 :5
29
+ --> tests/ui/manual_c_str_literals.rs:41 :5
30
30
|
31
31
LL | CStr::from_bytes_with_nul(b"foo\\0sdsd\0").unwrap();
32
32
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a `c""` literal: `c"foo\\0sdsd"`
33
33
34
34
error: calling `CStr::from_ptr` with a byte string literal
35
- --> tests/ui/manual_c_str_literals.rs:43 :14
35
+ --> tests/ui/manual_c_str_literals.rs:46 :14
36
36
|
37
37
LL | unsafe { CStr::from_ptr(b"foo\0".as_ptr().cast()) };
38
38
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a `c""` literal: `c"foo"`
39
39
40
40
error: calling `CStr::from_ptr` with a byte string literal
41
- --> tests/ui/manual_c_str_literals.rs:44 :14
41
+ --> tests/ui/manual_c_str_literals.rs:47 :14
42
42
|
43
43
LL | unsafe { CStr::from_ptr(b"foo\0".as_ptr() as *const _) };
44
44
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use a `c""` literal: `c"foo"`
45
45
46
46
error: manually constructing a nul-terminated string
47
- --> tests/ui/manual_c_str_literals.rs:45 :23
47
+ --> tests/ui/manual_c_str_literals.rs:48 :23
48
48
|
49
49
LL | let _: *const _ = b"foo\0".as_ptr();
50
50
| ^^^^^^^^ help: use a `c""` literal: `c"foo"`
51
51
52
52
error: manually constructing a nul-terminated string
53
- --> tests/ui/manual_c_str_literals.rs:46 :23
53
+ --> tests/ui/manual_c_str_literals.rs:49 :23
54
54
|
55
55
LL | let _: *const _ = "foo\0".as_ptr();
56
56
| ^^^^^^^ help: use a `c""` literal: `c"foo"`
57
57
58
58
error: manually constructing a nul-terminated string
59
- --> tests/ui/manual_c_str_literals.rs:49 :23
59
+ --> tests/ui/manual_c_str_literals.rs:52 :23
60
60
|
61
61
LL | let _: *const _ = b"foo\0".as_ptr().cast::<i8>();
62
62
| ^^^^^^^^ help: use a `c""` literal: `c"foo"`
63
63
64
64
error: manually constructing a nul-terminated string
65
- --> tests/ui/manual_c_str_literals.rs:52 :13
65
+ --> tests/ui/manual_c_str_literals.rs:55 :13
66
66
|
67
67
LL | let _ = "电脑\\\0".as_ptr();
68
68
| ^^^^^^^^^^ help: use a `c""` literal: `c"电脑\\"`
69
69
70
70
error: manually constructing a nul-terminated string
71
- --> tests/ui/manual_c_str_literals.rs:53 :13
71
+ --> tests/ui/manual_c_str_literals.rs:56 :13
72
72
|
73
73
LL | let _ = "电脑\0".as_ptr();
74
74
| ^^^^^^^^ help: use a `c""` literal: `c"电脑"`
75
75
76
76
error: manually constructing a nul-terminated string
77
- --> tests/ui/manual_c_str_literals.rs:54 :13
77
+ --> tests/ui/manual_c_str_literals.rs:57 :13
78
78
|
79
79
LL | let _ = "电脑\x00".as_ptr();
80
80
| ^^^^^^^^^^ help: use a `c""` literal: `c"电脑"`
0 commit comments