diff options
| author | bors <bors@rust-lang.org> | 2024-09-03 18:29:20 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-09-03 18:29:20 +0000 |
| commit | f2ef26d239efbe2a229ad663d4ea8b4411f65b2b (patch) | |
| tree | 0b67ddf24982ef65fcea0edb1746010888eb190d /compiler/rustc_codegen_llvm/src | |
| parent | e8ba5d1f7146e5b634b7ea34a02a0c30f0f56da9 (diff) | |
| parent | a5e3a3f9b6bd85611fa098dab8948ecdcac98acc (diff) | |
| download | rust-f2ef26d239efbe2a229ad663d4ea8b4411f65b2b.tar.gz rust-f2ef26d239efbe2a229ad663d4ea8b4411f65b2b.zip | |
Auto merge of #13263 - y21:warn_manual_c_str_literals, r=Centri3
move `manual_c_str_literals` to complexity IMO the suggestion to use `c""` literals over a hardcoded `\0` byte string literal has some fairly strong upsides (no need to manually null-terminate it and the compiler checks for intermediary null bytes) that this should just be enabled by default. It's also written slightly conservatively to only emit a warning when we can be reasonably confident that the lint is *actually* applicable (that is, lint on e.g. `b"foo\0".as_ptr()` but not `b"foo\0"`. The latter looks like a c-string but its type is `&[u8; _]`, and if it's used in a context where a byte slice is needed then you have no nice way to convert to it from a `c"foo"` literal of type `&CStr`). changelog: move [`manual_c_str_literals`] to complexity (now warn-by-default)
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions
