diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2022-09-12 22:47:14 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-12 22:47:14 +0200 |
| commit | 7fc3183520bfc20c40bdc1718376378df05716c7 (patch) | |
| tree | 693dbf65a18e6578861333781da228fb3189b5d9 /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | |
| parent | b7504d6f4f418f991274c6e062111348c55afb3a (diff) | |
| parent | cb02b647dc0441cfe152fa037ee14f4606c477cb (diff) | |
| download | rust-7fc3183520bfc20c40bdc1718376378df05716c7.tar.gz rust-7fc3183520bfc20c40bdc1718376378df05716c7.zip | |
Rollup merge of #100291 - WaffleLapkin:cstr_const_methods, r=oli-obk
constify some `CStr` methods
This PR marks the following public APIs as `const`:
```rust
impl CStr {
// feature(const_cstr_from_bytes)
pub const fn from_bytes_until_nul(bytes: &[u8]) -> Result<&CStr, FromBytesUntilNulError>;
pub const fn from_bytes_with_nul(bytes: &[u8]) -> Result<&Self, FromBytesWithNulError>;
// feature(const_cstr_to_bytes)
pub const fn to_bytes(&self) -> &[u8];
pub const fn to_bytes_with_nul(&self) -> &[u8];
pub const fn to_str(&self) -> Result<&str, str::Utf8Error>;
}
```
r? ```@oli-obk``` (use of `const_eval_select` :P )
cc ```@mina86``` (you've asked for this <3 )
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
