-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Language ref sales pitch says that C functions are unsafe #1212
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
And they can even be declared as pure (which probably needs to be added to the ref as well) |
Some compilers have a |
Pure is an annotation for rust functions. It's sensible to apply to some imported c functions. |
Oh, you meant within rust. Alright. Can the safety/purity be verified though? |
No. It's just a "trust me" assertion in the context of an external C function. |
Sales pitch is gone. |
Improve `needless_borrow` lint fixes: rust-lang#5327 fixes: rust-lang#1726 fixes: rust-lang#1212 This is merging `needless_borrow` into the `dereference` pass in preparation for `explicit_auto_deref`. `explicit_auto_deref` needs to implement most of what `needless_borrow` implements in order to work. There is a minor regression here where `let x: &str = &x.deref()` will trigger `needless_borrow` without triggering `explicit_deref_methods`. Removing the redundant borrow will cause `explicit_deref_methods` to trigger. This will be fixed when `explicit_auto_deref` is implemented. changelog: Lint `needless_borrow` when a borrow is auto-derefed more than once changelog: Lint `needless_borrow` in the trailing expression of a block for a match arm
…g#1212) * Define `min` expression * Add `atomic_min*` intrinsics * Add test and remove negative ones * Add support for `atomic_umin*` * Add test for `umin` and remove negative ones * Complete `is_side_effect` and use in `min` * Use `any` instead of local function Co-authored-by: Daniel Schwartz-Narbonne <danielsn@users.noreply.github.com>
This is not currently true.
The text was updated successfully, but these errors were encountered: