Skip to content

Commit 18bedf4

Browse files
Rollup merge of #152367 - Conaclos:conaclos/FromBytesUntilNulError-impl-Copy, r=clarfonthey
Derives `Copy` for `ffi::FromBytesUntilNulError` [`ffi::FromBytesWithNulError` derives `Copy` since Rust 1.93](2f5a3d4) while `ffi::FromBytesUntilNulError` doesn't. This Pr fixes that by deriving `Copy` for `ffi::FromBytesUntilNulError`. I encountered this issue while I was working in a const context. Note: I couldn't find any documentation about what kind of PR is allowed. As this one is very small, I guess it is ok to submit it directly without opening an issue first?
2 parents 43de103 + 8e8b4de commit 18bedf4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

library/core/src/ffi/c_str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ impl Error for FromBytesWithNulError {}
155155
/// within the slice.
156156
///
157157
/// This error is created by the [`CStr::from_bytes_until_nul`] method.
158-
#[derive(Clone, PartialEq, Eq, Debug)]
158+
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
159159
#[stable(feature = "cstr_from_bytes_until_nul", since = "1.69.0")]
160160
pub struct FromBytesUntilNulError(());
161161

0 commit comments

Comments
 (0)