Skip to content

Document CStr::as_ptr dangers. #34356

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

Merged
merged 1 commit into from
Jun 22, 2016
Merged

Document CStr::as_ptr dangers. #34356

merged 1 commit into from
Jun 22, 2016

Conversation

matklad
Copy link
Member

@matklad matklad commented Jun 19, 2016

r? @steveklabnik

Hi! I've tried to document CString::new("hello").unwrap().as_ptr() footgun. Related RFC and the original discussion.

@matklad matklad force-pushed the cstr-docs branch 2 times, most recently from dbd543e to 9ed36d7 Compare June 19, 2016 10:26
@GuillaumeGomez
Copy link
Member

Nice explanation, I approve! Thanks!

@bors: r+ rollup

@bors
Copy link
Collaborator

bors commented Jun 19, 2016

📌 Commit 9ed36d7 has been approved by GuillaumeGomez

@matklad
Copy link
Member Author

matklad commented Jun 19, 2016

Oups, didn't know that no_run still compiles the snippets, and even uses #[deny(warnings)]. Updated the PR.

@GuillaumeGomez
Copy link
Member

Ah right, didn't pay attention.

@bors: r+ rollup

@bors
Copy link
Collaborator

bors commented Jun 19, 2016

📌 Commit 677aa47 has been approved by GuillaumeGomez

@bors
Copy link
Collaborator

bors commented Jun 20, 2016

⌛ Testing commit 677aa47 with merge 33aa3ed...

Manishearth added a commit to Manishearth/rust that referenced this pull request Jun 20, 2016
Document `CStr::as_ptr` dangers.

r? @steveklabnik

Hi! I've tried to document `CString::new("hello").unwrap().as_ptr()` footgun. Related [RFC] and the original [discussion].

[RFC]: rust-lang/rfcs#1642
[discussion]: https://users.rust-lang.org/t/you-should-stop-telling-people-that-safe-rust-is-always-safe/6094
@bors
Copy link
Collaborator

bors commented Jun 20, 2016

⛄ The build was interrupted to prioritize another pull request.

bors added a commit that referenced this pull request Jun 20, 2016
Rollup of 4 pull requests

- Successful merges: #34313, #34335, #34340, #34356
- Failed merges:
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jun 21, 2016
Document `CStr::as_ptr` dangers.

r? @steveklabnik

Hi! I've tried to document `CString::new("hello").unwrap().as_ptr()` footgun. Related [RFC] and the original [discussion].

[RFC]: rust-lang/rfcs#1642
[discussion]: https://users.rust-lang.org/t/you-should-stop-telling-people-that-safe-rust-is-always-safe/6094
bors added a commit that referenced this pull request Jun 21, 2016
Rollup of 7 pull requests

- Successful merges: #34356, #34360, #34369, #34371, #34378, #34380, #34391
- Failed merges:
@bors bors merged commit 677aa47 into rust-lang:master Jun 22, 2016
@matklad matklad deleted the cstr-docs branch July 9, 2019 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants