-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added Error and Display impl for std::ffi::FromBytesWithNulError #39960
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @BurntSushi (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
src/libstd/ffi/c_str.rs
Outdated
@@ -455,6 +455,20 @@ impl From<NulError> for io::Error { | |||
} | |||
} | |||
|
|||
#[unstable(feature = "frombyteswithnulerror_impls", reason = "recently added", issue = "39925")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh unfortunately impls aren't subject to stability the same way as other parts of the standard library, so these'll be "insta-stable" so it's ok to just go ahead and tag this with #[stable]
Looks good to me, thanks @lukaramu! @rfcbot fcp merge |
Team member @alexcrichton has proposed to merge this. The next step is review by the rest of the tagged teams: No concerns currently listed. Once these reviewers reach consensus, this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
Changed stability annotations for the new Error and Display impls for std::ffi::FromBytesWithNulError as they aren't subject to stability the same way.
src/libstd/ffi/c_str.rs
Outdated
#[unstable(feature = "frombyteswithnulerror_impls", reason = "recently added", issue = "39925")] | ||
impl Error for FromBytesWithNulError { | ||
fn description(&self) -> &str { | ||
"data provided is not null terminated or contains an interior nul byte" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be interior null byte?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessarily. https://en.wikipedia.org/wiki/Null_character
Also note the name of the error type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see, thanks for the correction @jmesmon
🔔 This is now entering its final comment period, as per the review above. 🔔 |
@bors: r+ |
📌 Commit 48331ef has been approved by |
added Error and Display impl for std::ffi::FromBytesWithNulError Fixes rust-lang#39925. This is my first PR, so I wasn't quite sure about the stability annotation.
Fixes #39925.
This is my first PR, so I wasn't quite sure about the stability annotation.