Skip to content

Std panicking unsafe block in unsafe fn #74200

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged

Conversation

poliorcetics
Copy link
Contributor

Partial fix of #73904.

This encloses unsafe operations in unsafe fn in libstd/ffi/panicking.rs.

I also made a two lines change to libstd/thread/local.rs to add the necessary unsafe block without breaking everything else.

@rustbot modify labels: F-unsafe-block-in-unsafe-fn

@rust-highfive
Copy link
Contributor

r? @shepmaster

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 9, 2020
@crlf0710 crlf0710 added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 24, 2020
@poliorcetics poliorcetics force-pushed the std-panicking-unsafe-block-in-unsafe-fn branch from 5fc0e08 to 2292064 Compare July 27, 2020 20:21
@poliorcetics
Copy link
Contributor Author

@Mark-Simulacrum the last commit made the do_catch and do_call function unsafe, with what I hope are good SAFETY comments. I also changed the others to fix them according to your comments.

@bors
Copy link
Collaborator

bors commented Jul 28, 2020

☔ The latest upstream changes (presumably #73265) made this pull request unmergeable. Please resolve the merge conflicts.

@Mark-Simulacrum
Copy link
Member

r=me with a rebase

@poliorcetics poliorcetics force-pushed the std-panicking-unsafe-block-in-unsafe-fn branch from 12fec55 to a39aae8 Compare July 28, 2020 16:48
@poliorcetics
Copy link
Contributor Author

Rebase done, checks are in progress. 😃

@Mark-Simulacrum
Copy link
Member

Please also squash all commits into one.

This adds SAFETY comments where necessary, explaining the preconditions
and how they are respected.
@poliorcetics poliorcetics force-pushed the std-panicking-unsafe-block-in-unsafe-fn branch from a39aae8 to 82ccdab Compare July 29, 2020 19:59
@Dylan-DPC-zz
Copy link

@bors r=Mark-Simulacrum rollup

@bors
Copy link
Collaborator

bors commented Aug 9, 2020

📌 Commit 82ccdab has been approved by Mark-Simulacrum

@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 Aug 9, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 10, 2020
Rollup of 8 pull requests

Successful merges:

 - rust-lang#74200 (Std panicking unsafe block in unsafe fn)
 - rust-lang#75286 (Add additional case for Path starts with)
 - rust-lang#75318 (Resolve `char` as a primitive even if there is a module in scope)
 - rust-lang#75320 (Detect likely `for foo of bar` JS syntax)
 - rust-lang#75328 (Cleanup E0749)
 - rust-lang#75344 (Rename "Important traits" to "Notable traits")
 - rust-lang#75348 (Move to intra-doc links in library/core/src/time.rs)
 - rust-lang#75350 (Do not ICE when lowering invalid extern fn with bodies)

Failed merges:

r? @ghost
@bors bors merged commit 62e5488 into rust-lang:master Aug 10, 2020
@poliorcetics poliorcetics deleted the std-panicking-unsafe-block-in-unsafe-fn branch August 10, 2020 16:54
@cuviper cuviper added this to the 1.47.0 milestone May 2, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
F-unsafe-block-in-unsafe-fn RFC #2585 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.

9 participants