From: Bartosz Golaszewski <brgl@bgdev.pl>
To: Viresh Kumar <viresh.kumar@linaro.org>,
Linus Walleij <linus.walleij@linaro.org>,
Erik Wierich <erik@riscstar.com>
Cc: linux-gpio@vger.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Subject: [PATCH libgpiod 02/10] bindings: rust: add missing unsafe block ahead of rust version bump
Date: Tue, 12 Aug 2025 14:10:32 +0200 [thread overview]
Message-ID: <20250812-rust-1-0-0-release-v1-2-372d698f23e8@linaro.org> (raw)
In-Reply-To: <20250812-rust-1-0-0-release-v1-0-372d698f23e8@linaro.org>
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Rust edition 2024 changed the semantics of the unsafe keyword used as
function modifier[1]. Unsafe operations inside unsafe functions must
still be wrapped in an unsafe {} block. Update the code ahead of the
rust version bump.
[1] https://rust-lang.github.io/rfcs/2585-unsafe-block-in-unsafe-fn.html
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
bindings/rust/libgpiod/src/line_info.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bindings/rust/libgpiod/src/line_info.rs b/bindings/rust/libgpiod/src/line_info.rs
index bd290f6e1369a3968a39178c5bcfb9f6aaf26239..8def1ab4e52962fffa6911976e64204c3d02df6f 100644
--- a/bindings/rust/libgpiod/src/line_info.rs
+++ b/bindings/rust/libgpiod/src/line_info.rs
@@ -51,7 +51,7 @@ impl InfoRef {
/// owned by the thread invoking this method. The owning object may not be
/// moved to another thread for the entire lifetime 'a.
pub(crate) unsafe fn from_raw<'a>(info: *mut gpiod::gpiod_line_info) -> &'a InfoRef {
- &*(info as *mut _)
+ unsafe { &*(info as *mut _) }
}
fn as_raw_ptr(&self) -> *mut gpiod::gpiod_line_info {
--
2.48.1
next prev parent reply other threads:[~2025-08-12 12:10 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-12 12:10 [PATCH libgpiod 00/10] bindings: rust: prepare v1.0.0 release Bartosz Golaszewski
2025-08-12 12:10 ` [PATCH libgpiod 01/10] bindings: rust: make Buffer::read_edge_events() lifetimes more explicit Bartosz Golaszewski
2025-08-12 12:10 ` Bartosz Golaszewski [this message]
2025-08-12 12:10 ` [PATCH libgpiod 03/10] bindings: rust: update bindgen dependency Bartosz Golaszewski
2025-08-12 12:10 ` [PATCH libgpiod 04/10] bindings: rust: update errno dependency Bartosz Golaszewski
2025-08-13 6:56 ` Erik Schilling
2025-08-13 7:18 ` Bartosz Golaszewski
2025-08-13 8:24 ` Erik Schilling
2025-08-13 8:33 ` Bartosz Golaszewski
2025-08-12 12:10 ` [PATCH libgpiod 05/10] bindings: rust: update cc dependency Bartosz Golaszewski
2025-08-12 12:10 ` [PATCH libgpiod 06/10] bindings: rust: update system-deps dependency Bartosz Golaszewski
2025-08-12 12:10 ` [PATCH libgpiod 07/10] bindings: rust: update thiserror dependency Bartosz Golaszewski
2025-08-12 12:10 ` [PATCH libgpiod 08/10] bindings: rust: update intmap dependency Bartosz Golaszewski
2025-08-13 6:57 ` Erik Schilling
2025-08-13 7:18 ` Bartosz Golaszewski
2025-08-13 8:24 ` Erik Schilling
2025-08-12 12:10 ` [PATCH libgpiod 09/10] bindings: rust: update rust version Bartosz Golaszewski
2025-08-13 6:57 ` Erik Schilling
2025-08-13 7:12 ` Bartosz Golaszewski
2025-08-13 8:24 ` Erik Schilling
2025-08-12 12:10 ` [PATCH libgpiod 10/10] bindings: rust: update crate versions to v1.0.0 Bartosz Golaszewski
2025-08-13 3:27 ` [PATCH libgpiod 00/10] bindings: rust: prepare v1.0.0 release Viresh Kumar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250812-rust-1-0-0-release-v1-2-372d698f23e8@linaro.org \
--to=brgl@bgdev.pl \
--cc=bartosz.golaszewski@linaro.org \
--cc=erik@riscstar.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=viresh.kumar@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).