Skip to content
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

Fix miri error in into_inner() of CString #62610

Merged
merged 1 commit into from
Jul 14, 2019
Merged

Fix miri error in into_inner() of CString #62610

merged 1 commit into from
Jul 14, 2019

Conversation

Stargateur
Copy link
Contributor

Fix #62553

I choice to not transmute because I think it's more unsafe and in case the structure change this code should always work.

r? @RalfJung

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @RalfJung (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.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 12, 2019
src/libstd/ffi/c_str.rs Outdated Show resolved Hide resolved
src/libstd/ffi/c_str.rs Outdated Show resolved Hide resolved
src/libstd/ffi/c_str.rs Outdated Show resolved Hide resolved
@Stargateur
Copy link
Contributor Author

I would like to add a test but I don't know how.

src/libstd/ffi/c_str.rs Outdated Show resolved Hide resolved
src/libstd/ffi/c_str.rs Outdated Show resolved Hide resolved
src/libstd/ffi/c_str.rs Outdated Show resolved Hide resolved
src/libstd/ffi/c_str.rs Outdated Show resolved Hide resolved
@RalfJung
Copy link
Member

RalfJung commented Jul 13, 2019

Thanks a lot! I prefer the ManuallyDrop version as well. :)

I would like to add a test but I don't know how.

You mean a test that this does not error in Miri any more? For that, please make a PR at https://github.com/rust-lang/miri/.

@RalfJung
Copy link
Member

This looks great! When you force-push and want a new review, please leave a note saying so; GitHub unfortunately does not send email notifications for force-pushes.

@bors r+

Do you want to try to add a Miri test case as well? Do you need mentoring for that?

@bors
Copy link
Contributor

bors commented Jul 14, 2019

📌 Commit 4c4bd34 has been approved by RalfJung

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 14, 2019
@bors
Copy link
Contributor

bors commented Jul 14, 2019

⌛ Testing commit 4c4bd34 with merge 85a360e...

bors added a commit that referenced this pull request Jul 14, 2019
…r=RalfJung

Fix miri error in into_inner() of CString

Fix #62553

I choice to not transmute because I think it's more unsafe and in case the structure change this code should always work.

r? @RalfJung
@bors
Copy link
Contributor

bors commented Jul 14, 2019

☀️ Test successful - checks-azure, checks-travis, status-appveyor
Approved by: RalfJung
Pushing 85a360e to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 14, 2019
@bors bors merged commit 4c4bd34 into rust-lang:master Jul 14, 2019
@Stargateur Stargateur deleted the fix-miri-error-cstring-into_inner branch July 14, 2019 20:48
@RalfJung RalfJung mentioned this pull request Oct 22, 2019
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CString::into_raw() trigger miri
5 participants