Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

rust: edition 2024#1586

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nicholasbishop merged 8 commits intorust-osdev:mainfromphip1611:edition-2024
May 18, 2025
Merged

Conversation

phip1611
Copy link
Member

Closes#1584

Checklist

  • Sensible git history (for example, squash "typo" or "fix" commits). See theRewriting History guide for help.
  • Update the changelog (if necessary)

@phip1611phip1611 self-assigned thisMar 23, 2025
@phip1611phip1611force-pushed theedition-2024 branch 2 times, most recently from4719df1 toc0a9cd1CompareMarch 23, 2025 14:52
@phip1611
Copy link
MemberAuthor

phip1611 commentedMar 23, 2025
edited
Loading

@nicholasbishop I have a never ending back-and-forth between code gen and formatting with these lines and I don't really understand where the root cause is. Using full-text search, I can't find anything. Any idea?

diff --git a/uefi-raw/src/protocol/device_path/device_path_gen.rs b/uefi-raw/src/protocol/device_path/device_path_gen.rsindex 9914779c..825a2792 100644--- a/uefi-raw/src/protocol/device_path/device_path_gen.rs+++ b/uefi-raw/src/protocol/device_path/device_path_gen.rs@@ -10,7 +10,7 @@ #![allow(missing_debug_implementations)] use crate::protocol::device_path; use crate::table::boot::MemoryType;-use crate::{guid, Guid, IpAddress};+use crate::{Guid, IpAddress, guid}; use bitflags::bitflags; use device_path::DevicePathProtocol as DevicePathHeader; #[cfg(doc)]diff --git a/uefi/src/proto/device_path/device_path_gen.rs b/uefi/src/proto/device_path/device_path_gen.rsindex 915e1ff6..3892524b 100644--- a/uefi/src/proto/device_path/device_path_gen.rs+++ b/uefi/src/proto/device_path/device_path_gen.rs@@ -15,7 +15,7 @@ use crate::proto::device_path::{     self, DevicePathHeader, DevicePathNode, DeviceSubType, DeviceType, NodeConversionError, }; use crate::proto::network::IpAddress;-use crate::{guid, Guid};+use crate::{Guid, guid}; use bitflags::bitflags; use core::mem::{size_of, size_of_val}; use core::ptr::addr_of;@@ -3647,10 +3647,10 @@ impl TryFrom<&DevicePathNode> for DevicePathNodeEnum<'_> { /// Build device paths from their component nodes. pub mod build {     use super::*;+    use crate::CStr16;     use crate::proto::device_path::build::{BuildError, BuildNode};     use crate::proto::device_path::{DeviceSubType, DeviceType};-    use crate::CStr16;-    use core::mem::{size_of_val, MaybeUninit};+    use core::mem::{MaybeUninit, size_of_val};     /// Device path build nodes for [`DeviceType::END`].     pub mod end {         use super::*;

@nicholasbishop
Copy link
Member

Interesting. I'm not surewhy this is happening, but explicitly passing--style-edition=2024 to the rustfmt command in the code generator fixes it:

diff --git a/xtask/src/device_path/util.rs b/xtask/src/device_path/util.rsindex 59cdc662..e1b9fe4e 100644--- a/xtask/src/device_path/util.rs+++ b/xtask/src/device_path/util.rs@@ -16,6 +16,7 @@ pub fn is_doc_attr(attr: &Attribute) -> bool { pub fn rustfmt_string(input: String) -> Result<String> {     let mut child = Command::new("rustfmt")         .args([+            "--style-edition=2024",             "--config",             // Convert `#[doc = "..."]` to `///` for readability.             "normalize_doc_attributes=true",

It seems as though it's ignoring the config file, but I'm not sure why that would be.

@phip1611
Copy link
MemberAuthor

phip1611 commentedMar 24, 2025
edited
Loading

Ahh, got it. I deletedrustfmt.toml again once I setedition = "2024" inCargo.toml.cargo fmt forwards--edition 2024 torustfmt but direct invocations ofrustfmt are not aware ofCargo.toml#edition of course.

@phip1611phip1611 changed the titlerust: edition 2024[BLOCKED until Rust May 15/ Rust 1.87] rust: edition 2024Apr 8, 2025
@phip1611phip1611 changed the title[BLOCKED until Rust May 15/ Rust 1.87] rust: edition 2024[BLOCKED until May 15/ Rust 1.87] rust: edition 2024Apr 8, 2025
@phip1611phip1611 mentioned this pull requestMay 5, 2025
10 tasks
@phip1611phip1611 changed the title[BLOCKED until May 15/ Rust 1.87] rust: edition 2024rust: edition 2024May 17, 2025
@phip1611phip1611 marked this pull request as ready for reviewMay 17, 2025 10:33
@phip1611
Copy link
MemberAuthor

phip1611 commentedMay 17, 2025
edited
Loading

Are we good to go here,@nicholasbishop?

I'm not sure how to handle the Miri error 🤔

@phip1611phip1611force-pushed theedition-2024 branch 2 times, most recently fromb8f137d tod9e1f0aCompareMay 17, 2025 10:57
@phip1611
Copy link
MemberAuthor

phip1611 commentedMay 17, 2025
edited
Loading

Oh interesting, miri error might be unrelated to this PR, also happens here:https://github.com/rust-osdev/uefi-rs/actions/runs/15084802709/job/42405995121

Update: contextrust-lang/miri#4323

@nicholasbishopnicholasbishop added this pull request to themerge queueMay 18, 2025
Merged via the queue intorust-osdev:main with commit8ecb54dMay 18, 2025
27 of 28 checks passed
@phip1611phip1611 deleted the edition-2024 branchMay 19, 2025 04:10
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nicholasbishopnicholasbishopnicholasbishop approved these changes

Assignees

@phip1611phip1611

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Plan for edition 2024
2 participants
@phip1611@nicholasbishop

[8]ページ先頭

©2009-2025 Movatter.jp