-
Notifications
You must be signed in to change notification settings - Fork 381
Modifications to PR 1005 #1568
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
Modifications to PR 1005 #1568
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
error: extern blocks should be unsafe --> tests/ffi/lib.rs:109:48 | 109 | fn c_return_shared_ptr() -> SharedPtr<C>; | ^ | | | help: needs `unsafe` before the extern keyword: `unsafe` | = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024! = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-extern.html> note: the lint level is defined here --> tests/ffi/lib.rs:16:9 | 16 | #![deny(warnings)] // Check that expansion of `cxx::bridge` doesn't trigger warnings. | ^^^^^^^^ = note: `#[deny(missing_unsafe_on_extern)]` implied by `#[deny(warnings)]` error[E0133]: call to unsafe function `<ffi::C as cxx::memory::SharedPtrTarget>::__from_unmanaged::__from_unmanaged` is unsafe and requires unsafe block --> tests/ffi/lib.rs:109:48 | 109 | fn c_return_shared_ptr() -> SharedPtr<C>; | ^ call to unsafe function | = note: for more information, see <https://doc.rust-lang.org/edition-guide/rust-2024/unsafe-op-in-unsafe-fn.html> = note: consult the function's documentation for information on how to avoid undefined behavior note: an unsafe function restricts its caller, but its body is safe by default --> tests/ffi/lib.rs:109:48 | 109 | fn c_return_shared_ptr() -> SharedPtr<C>; | ^ note: the lint level is defined here --> tests/ffi/lib.rs:15:11 | 15 | #![forbid(unsafe_op_in_unsafe_fn)] | ^^^^^^^^^^^^^^^^^^^^^^
This matches standard library's Box::from_raw.
warning: borrow as raw pointer --> tests/test.rs:297:15 | 297 | let ptr = &*unique as *const _; | ^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::addr_of!(*unique)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_as_ptr = note: `-W clippy::borrow-as-ptr` implied by `-W clippy::pedantic` = help: to override `-W clippy::pedantic` add `#[allow(clippy::borrow_as_ptr)]` warning: borrow as raw pointer --> tests/test.rs:299:16 | 299 | assert_eq!(&*shared as *const _, ptr); | ^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::addr_of!(*shared)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_as_ptr warning: borrow as raw pointer --> tests/test.rs:306:15 | 306 | let ptr = &*unique as *const _; | ^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::addr_of!(*unique)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_as_ptr warning: borrow as raw pointer --> tests/test.rs:308:16 | 308 | assert_eq!(&*shared as *const _, ptr); | ^^^^^^^^^^^^^^^^^^^^ help: try: `std::ptr::addr_of!(*shared)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#borrow_as_ptr
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#1005