@@ -2,7 +2,7 @@ error: calling `CStr::new` with a byte string literal
22 --> $DIR/manual_c_str_literals.rs:32:5
33 |
44LL | 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"`
66 |
77 = note: `-D clippy::manual-c-str-literals` implied by `-D warnings`
88 = 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
1111 --> $DIR/manual_c_str_literals.rs:36:5
1212 |
1313LL | 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"`
1515
1616error: calling `CStr::new` with a byte string literal
1717 --> $DIR/manual_c_str_literals.rs:37:5
1818 |
1919LL | 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"`
2121
2222error: calling `CStr::new` with a byte string literal
2323 --> $DIR/manual_c_str_literals.rs:38:5
2424 |
2525LL | 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"`
2727
2828error: calling `CStr::new` with a byte string literal
2929 --> $DIR/manual_c_str_literals.rs:39:5
3030 |
3131LL | 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"`
3333
3434error: calling `CStr::from_ptr` with a byte string literal
3535 --> $DIR/manual_c_str_literals.rs:44:14
3636 |
3737LL | 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"`
3939
4040error: calling `CStr::from_ptr` with a byte string literal
4141 --> $DIR/manual_c_str_literals.rs:45:14
4242 |
4343LL | 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"`
4545
4646error: aborting due to 7 previous errors
4747
0 commit comments