-
Notifications
You must be signed in to change notification settings - Fork 13.3k
extern functions can't be declared unsafe #2952
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
Comments
I don't think this is a problem - making a function unsafe means what whoever calls it must surround it with an unsafe block or be unsafe themself, but extern functions are never called, only passed. Try |
I use the unsafe marker as a way to reduce the visual complexity of a function in which there are a number of unsafe blocks, or the whole body of the function belongs in an unsafe block. |
You can also write |
Curses, the one permutation I did not try. |
It's equivalent to the one I said above, just with fewer braces. |
cronjob auto-PR: try to fix setting the remote branch
The "CBMC latest" workflow is composed of two jobs (`regression` and `perf`) which perform testing with the most recent development version of CBMC. At present, the `regression` jobs are not actually testing with the CBMC that we build from source, but the CBMC installed through the setup scripts, as revealed in rust-lang#2954. This PR changes the `regression` jobs so that they use `cmake` to build. This allows the runner to pick up the recently-built CBMC development version instead of the one installed through setup scripts, as it's done in the `perf` jobs. Unfortunately, [this CI run](https://github.com/adpaco-aws/rmc/actions/runs/7390380572) doesn't demonstrate the fix as it should due to an unrelated breaking change in the latest CBMC version. However, rust-lang#2952 provides more context in case you need it.
/Users/jdm/src/servo/src/servo/dom/bindings/document.rs:124:7: 124:13 error: expecting fn, found extern
/Users/jdm/src/servo/src/servo/dom/bindings/document.rs:124:7: 124:13 error: expecting mod, found unsafe
/Users/jdm/src/servo/src/servo/dom/bindings/document.rs:124:10: 124:16 error: found
unsafein restricted position
The text was updated successfully, but these errors were encountered: