]> git.lizzy.rs Git - rust.git/commit - src/tools/miri
Rollup merge of #82057 - upsuper-forks:cstr, r=davidtwco,wesleywiser
authorDylan DPC <dylan.dpc@gmail.com>
Sat, 27 Feb 2021 01:34:21 +0000 (02:34 +0100)
committerGitHub <noreply@github.com>
Sat, 27 Feb 2021 01:34:21 +0000 (02:34 +0100)
commitcabe97272d782294e0d642135f3d8b13579b2929
tree2af31ef1bee69e720a118099e88dbe0d33137255
parentdb8ac16d000e9cd454f8ab99fb04c4410243fa88
parent38e4233a3291b0b8e3148e7ea47da66c9d8b307f
Rollup merge of #82057 - upsuper-forks:cstr, r=davidtwco,wesleywiser

Replace const_cstr with cstr crate

This PR replaces the `const_cstr` macro inside `rustc_data_structures` with `cstr` macro from [cstr](https://crates.io/crates/cstr) crate.

The two macros basically serve the same purpose, which is to generate `&'static CStr` from a string literal. `cstr` is better because it validates the literal at compile time, while the existing `const_cstr` does it at runtime when `debug_assertions` is enabled. In addition, the value `cstr` generates can be used in constant context (which is seemingly not needed anywhere currently, though).
Cargo.lock
compiler/rustc_codegen_llvm/Cargo.toml
compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs
compiler/rustc_data_structures/src/lib.rs