Skip to content

Edition 2024 - #248

Merged
mulkieran merged 3 commits into
stratis-storage:masterfrom
mulkieran:edition-2024
Jun 30, 2026
Merged

mulkieran merged 3 commits into
stratis-storage:masterfrom
mulkieran:edition-2024

Conversation

@mulkieran

@mulkieran mulkieran commented Jun 26, 2026 •

Copy link
Copy Markdown
Member

This library conforms to edition 2024 requirements already, except for
some macros, that need to be reviewed.

Signed-off-by: mulhern <amulhern@redhat.com>
@mulkieran mulkieran self-assigned this Jun 26, 2026
@mulkieran mulkieran added this to the libblkid-rs-0.4.3 milestone Jun 26, 2026
@mulkieran mulkieran moved this to In Progress in 2026June Jun 26, 2026
@packit-as-a-service

Copy link
Copy Markdown

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo dnf install -y 'dnf*-command(copr)'
  • dnf copr enable packit/stratis-storage-libblkid-rs-248
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

1 similar comment
@packit-as-a-service

Copy link
Copy Markdown

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo dnf install -y 'dnf*-command(copr)'
  • dnf copr enable packit/stratis-storage-libblkid-rs-248
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

Signed-off-by: mulhern <amulhern@redhat.com>
@mulkieran

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 29, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fd91e81c-188d-4616-9c8e-84fb1789a959

📥 Commits

Reviewing files that changed from the base of the PR and between e6b5990 and 52c4386.

📒 Files selected for processing (1)
  • Cargo.toml

Walkthrough

Cargo.toml updates the crate's Rust edition from 2021 to 2024 and adds a rust-2024-compatibility lint entry set to deny with priority 5 in the [lints.rust] section.

Changes

Rust 2024 Edition Upgrade

Layer / File(s) Summary
Edition and lint configuration
Cargo.toml
edition changed to 2024; rust-2024-compatibility lint added under [lints.rust] set to deny at priority 5.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: updating the crate to Rust edition 2024.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

cargo-fix identifies the following macro definitions that use expr.
Since expr does not match certain patterns in edition 2021 that it does
match in edition 2024, cargo-fix suggests using the more restrictive
expr_2021. I don't think this is necessary in any of these macro
definitions.

Also reformat in a few places, since the new edition requires it.

"""
diff --git a/src/macros.rs b/src/macros.rs
index 9ccc0b5..67c25bf4 100644
--- a/src/macros.rs
+++ b/src/macros.rs
@@ -3,7 +3,7 @@
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.

 macro_rules! str_ptr_to_owned {
-    ($str_ptr:expr) => {
+    ($str_ptr:expr_2021) => {
         unsafe { std::ffi::CStr::from_ptr($str_ptr) }
             .to_str()?
             .to_string()
@@ -11,7 +11,7 @@ macro_rules! str_ptr_to_owned {
 }

 macro_rules! str_ptr_with_size_to_owned {
-    ($str_ptr:expr, $size:expr) => {
+    ($str_ptr:expr_2021, $size:expr_2021) => {
         std::ffi::CStr::from_bytes_with_nul(unsafe {
             std::slice::from_raw_parts($str_ptr as *const u8, $size)
         })?
@@ -21,7 +21,7 @@ macro_rules! str_ptr_with_size_to_owned {
 }

 macro_rules! errno {
-    ($ret_expr:expr) => {
+    ($ret_expr:expr_2021) => {
         match $ret_expr {
             i if i == 0 => Ok(()),
             i if i < 0 => Err($crate::err::BlkidErr::LibErr(i64::from(i))),
@@ -31,7 +31,7 @@ macro_rules! errno {
 }

 macro_rules! errno_ptr {
-    ($ret_expr:expr) => {{
+    ($ret_expr:expr_2021) => {{
         let ptr = $ret_expr;
         if ptr.is_null() {
             Err($crate::err::BlkidErr::LibErr(0))
@@ -42,7 +42,7 @@ macro_rules! errno_ptr {
 }

 macro_rules! option_ptr {
-    ($ret_expr:expr) => {{
+    ($ret_expr:expr_2021) => {{
         let ptr = $ret_expr;
         if ptr.is_null() {
             None
@@ -53,7 +53,7 @@ macro_rules! option_ptr {
 }

 macro_rules! errno_with_ret {
-    ($ret_expr:expr) => {
+    ($ret_expr:expr_2021) => {
         match $ret_expr {
             i if i < 0 => Err($crate::err::BlkidErr::LibErr(i64::from(i))),
             i => Ok(i),
@@ -62,7 +62,7 @@ macro_rules! errno_with_ret {
 }

 macro_rules! consts_enum_conv {
-    ($(#[$enum_meta:meta])* $enum_ident:ident <=> $conv_type:ty, $($(#[$var_meta:meta])* $variant:ident => $const:expr),+) => {
+    ($(#[$enum_meta:meta])* $enum_ident:ident <=> $conv_type:ty, $($(#[$var_meta:meta])* $variant:ident => $const:expr_2021),+) => {
         $(
             #[$enum_meta]
         )*

Signed-off-by: mulhern <amulhern@redhat.com>
@mulkieran mulkieran moved this from In Progress to In Review in 2026June Jun 30, 2026
@mulkieran
mulkieran requested a review from jbaublitz June 30, 2026 15:03
@mulkieran
mulkieran merged commit e7be01a into stratis-storage:master Jun 30, 2026
16 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in 2026June Jun 30, 2026
@mulkieran
mulkieran deleted the edition-2024 branch June 30, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants