diff --git a/multiboot2-common/CHANGELOG.md b/multiboot2-common/CHANGELOG.md index 5ee4c12f..f2b5579b 100644 --- a/multiboot2-common/CHANGELOG.md +++ b/multiboot2-common/CHANGELOG.md @@ -1,25 +1,34 @@ # Changelog for Crate `multiboot2-common` +## Unreleased + +- Small code improvements + + ## v0.3.0 (2025-06-01) - **Breaking:** Removed the optional `unstable` feature (required nightly) - `core::error::Error` is now implemented unconditionally - **Breaking:** The MSRV is now 1.85 + ## v0.2.1 (2024-09-19) - Documentation improvements + ## v0.2.0 (2024-09-17) - dependency updates - **Breaking:** MSRV is now 1.75 - misc metadata fixes + ## v0.1.2 (2024-08-24) - Documentation improvements + ## 0.1.0 / 0.1.1 (2024-08-20) Initial release. diff --git a/multiboot2-common/src/lib.rs b/multiboot2-common/src/lib.rs index 2e38a688..584c6de3 100644 --- a/multiboot2-common/src/lib.rs +++ b/multiboot2-common/src/lib.rs @@ -330,7 +330,7 @@ pub struct DynSizedStructure { impl DynSizedStructure { /// Creates a new fat-pointer backed reference to a [`DynSizedStructure`] /// from the given [`BytesRef`]. - pub fn ref_from_bytes(bytes: BytesRef) -> Result<&Self, MemoryError> { + pub fn ref_from_bytes(bytes: BytesRef<'_, H>) -> Result<&Self, MemoryError> { let ptr = bytes.as_ptr().cast::(); let hdr = unsafe { &*ptr }; diff --git a/multiboot2-common/src/tag.rs b/multiboot2-common/src/tag.rs index 8b1876e3..8ba6b19c 100644 --- a/multiboot2-common/src/tag.rs +++ b/multiboot2-common/src/tag.rs @@ -62,7 +62,7 @@ pub trait MaybeDynSized: Pointee { /// Returns the whole allocated bytes for this structure encapsulated in /// [`BytesRef`]. This includes padding bytes. To only get the "true" tag /// data, read the tag size from [`Self::header`] and create a sub slice. - fn as_bytes(&self) -> BytesRef { + fn as_bytes(&self) -> BytesRef<'_, Self::Header> { let ptr = core::ptr::addr_of!(*self); // Actual tag size with optional terminating padding. let size = mem::size_of_val(self); diff --git a/multiboot2-header/CHANGELOG.md b/multiboot2-header/CHANGELOG.md index ffa901ad..dfa5dbcf 100644 --- a/multiboot2-header/CHANGELOG.md +++ b/multiboot2-header/CHANGELOG.md @@ -1,21 +1,29 @@ # Changelog for Crate `multiboot2-header` +## Unreleased + +- Small code improvements + + ## v0.7.0 (2025-06-01) - **Breaking:** Removed the optional `unstable` feature (required nightly) - `core::error::Error` is now implemented unconditionally - **Breaking:** The MSRV is now 1.85 + ## v0.6.0 (2024-09-17) - dependency updates - **Breaking:** MSRV is now 1.75 - misc metadata fixes + ## v0.5.1 (2024-08-24) - Documentation improvements + ## v0.5.0 (2024-05-20) This release contains a major refactoring of the internals, guaranteeing @@ -37,12 +45,14 @@ All previous versions have been marked as **YANKED**. `0.5.0` is the first version where all unit tests are passed by Miri, i.e., the first version without Undefined Behavior. + ## 0.4.0 (2024-05-01) (**YANKED**) - added `EndHeaderTag::default()` - MSRV is 1.70 - Can add multiple `TagType::Smbios` tags in the builder. + ## 0.3.2 (2023-11-30) (**YANKED**) - **BREAKING** bumped `multiboot2` dependency to `v0.19.0` @@ -50,10 +60,12 @@ without Undefined Behavior. anymore - doc update + ## 0.3.1 (2023-06-28) (**YANKED**) - doc update + ## 0.3.0 (2023-06-23) (**YANKED**) - **BREAKING** MSRV is 1.68.0 (UPDATE: This is actually 1.69.) @@ -67,6 +79,7 @@ without Undefined Behavior. - added the optional `unstable` feature (requires nightly) - implement `core::error::Error` for `LoadError` + ## 0.2.0 (2022-05-03) (**YANKED**) - **BREAKING** renamed `EntryHeaderTag` to `EntryAddressHeaderTag` @@ -75,6 +88,7 @@ without Undefined Behavior. -> thus, import paths are much more logically now - internal code improvements + ## 0.1.1 (2022-05-02) (**YANKED**) - fixed a bug that prevented the usage of the crate in `no_std` environments @@ -83,10 +97,12 @@ without Undefined Behavior. (this feature can be disabled which will also remove the dependency to the `alloc` crate) + ## 0.1.0 (2021-10-08) (**YANKED**) - initial release + ## 0.0.0 Empty release to save the name on crates.io diff --git a/multiboot2-header/src/header.rs b/multiboot2-header/src/header.rs index 66c127a0..12260bfd 100644 --- a/multiboot2-header/src/header.rs +++ b/multiboot2-header/src/header.rs @@ -103,7 +103,7 @@ impl<'a> Multiboot2Header<'a> { /// Returns a [`TagIter`]. #[must_use] - pub fn iter(&self) -> TagIter { + pub fn iter(&self) -> TagIter<'_> { TagIter::new(self.0.payload()) } diff --git a/multiboot2/CHANGELOG.md b/multiboot2/CHANGELOG.md index d3847106..1c9112c6 100644 --- a/multiboot2/CHANGELOG.md +++ b/multiboot2/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog for Crate `multiboot2` +## Unreleased + +- Small code improvements + + ## v0.24.0 (2025-06-01) - **Breaking:** Removed the optional `unstable` feature (required nightly) @@ -7,6 +12,7 @@ - **Breaking:** The MSRV is now 1.85 - Fixed a bug causing UB in `ElfSection::name()` + ## v0.23.1 (2024-10-21) - Fix wrong tag ID when using `BootdevTag::new` @@ -15,6 +21,7 @@ `.sections()` to iterate the sections - Fixed the debug output of `BootInformation` + ## v0.23.0 (2024-09-17) - dependency updates @@ -26,15 +33,18 @@ - `BootInformation::tags` iterator is now public - misc metadata fixes + ## v0.22.2 (2024-08-24) - Documentation improvements - Improve debug formatting for EFIMemoryMapTag + ## v0.22.1 (2024-08-20) Minor documentation fixes. + ## v0.22.0 (2024-08-20) This release contains another major refactoring of the internals, guaranteeing @@ -73,6 +83,7 @@ All previous versions have been marked as **YANKED**. `0.22.0` is the first version where all unit tests are passed by Miri, i.e., the first version without Undefined Behavior. + ## 0.21.0 (2024-08-17) (**YANKED**) This release contains a massive refactoring of various internals. Now, almost @@ -104,10 +115,12 @@ release and you'll be fine!** - documentation enhancements - updated dependencies + ## 0.20.2 (2024-05-26) (**YANKED**) - fix Debug implementation of `EfiMemoryMapTag` + ## 0.20.1 (2024-05-26) (**YANKED**) - fixed the handling of `EFIMemoryMapTag` and `EFIMemoryAreaIter` @@ -116,11 +129,13 @@ release and you'll be fine!** `EFIMemoryMapTag::new_from_map`. - `ModuleTag::new`'s `end` parameter now must be bigger than `start`. + ## 0.20.0 (2024-05-01) (**YANKED**) - added `InformationBuilder::default()` - MSRV is 1.70 + ## 0.19.0 (2023-09-21) (**YANKED**) - **BREAKING** MSRV is 1.69.0 @@ -135,10 +150,12 @@ release and you'll be fine!** - `InformationBuilder` now also allows to add custom tags. The new public method `add_tag` was introduced for that. + ## 0.18.1 (2023-07-13) (**YANKED**) - Documentation improvements + ## 0.18.0 (2023-07-13) (**YANKED**) - **BREAKING** The `TagTrait` was enhanced and now has an associated `ID` @@ -160,6 +177,7 @@ release and you'll be fine!** - Better debug output of `BootInformation` and `MemoryArea` - Internal code cleanup. + ## 0.17.0 (2023-07-12) (**YANKED**) - **BREAKING** Make functions of `InformationBuilder` chainable. They now @@ -167,6 +185,7 @@ release and you'll be fine!** - **BREAKING** Allow non-standard memory area types by using new pair of corresponding types: `MemoryAreaTypeId` and `MemoryAreaType`. + ## 0.16.0 (2023-06-23) (**YANKED**) - **BREAKING** renamed `MULTIBOOT2_BOOTLOADER_MAGIC` to `MAGIC` @@ -205,6 +224,7 @@ release and you'll be fine!** - added `BootInformation::load` as new default constructor - added `MemoryMapTag::entry_size` and `MemoryMapTag::entry_version` + ## 0.15.1 (2023-03-18) (**YANKED**) - **BREAKING** `MemoryMapTag::all_memory_areas()` was renamed to `memory_areas` @@ -220,6 +240,7 @@ release and you'll be fine!** value. This prevents possible panics. - fix: prevent a possible panic in `ElfSection::section_type()` + ## 0.15.0 (2023-03-17) (**YANKED**) - **BREAKING** MSRV is 1.56.1 @@ -242,6 +263,7 @@ release and you'll be fine!** (check docs.rs). There is also a small unit test that you can use to learn from. + ## 0.14.2 (2023-03-17) (**YANKED**) - documentation fixes @@ -250,6 +272,7 @@ release and you'll be fine!** With this feature, `MbiLoadError` now implements `core::error::Error` and can be used with `anyhow::Result` for example. + ## 0.14.1 (2023-03-09) (**YANKED**) - fixed the calculation of the last area of the memory map @@ -257,6 +280,7 @@ release and you'll be fine!** (Previously, iterating the EFI Memory map resulted in a superfluous entry as it ran over the next tag) + ## 0.14.0 (2022-06-30) (**YANKED**) - **BREAKING CHANGES** \ @@ -273,25 +297,30 @@ release and you'll be fine!** - `RsdpV2Tag::oem_id` now returns a Result instead of an Option - internal code improvements + ## 0.13.3 (2022-06-03) (**YANKED**) - impl `Send` for `BootInformation` + ## 0.13.2 (2022-05-02) (**YANKED**) - `TagType` now implements `Ord` so that it can be used in `BTreeSet` - small internal improvements and restructuring of the code (no breaking changes to public API) + ## 0.13.1 (2022-01-09) (**YANKED**) - minor fix + ## 0.13.0 (2022-01-09) (**YANKED**) - added missing getters for tag `ImageLoadPhysAddr` - added missing getters for tags `EFIImageHandle32` and `EFIImageHandle64` + ## 0.12.2 (2021-10-02) (**YANKED**) - `TagType` now implements `Eq` and `Hash` @@ -305,11 +334,13 @@ release and you'll be fine!** - prepared co-existence of crates `multiboot2` and `multiboot2-header` in a Cargo workspace inside the same repository + ## 0.12.1 (2021-08-11) (**YANKED**) - `TagType`-enum introduced in `v0.11` is now actually public - internal code improvements + ## 0.12.0 (2021-08-06) (**YANKED**) - **breaking:** `load()` and `load_with_offset` now returns a result @@ -317,6 +348,7 @@ release and you'll be fine!** - Rust edition 2018 (instead of 2015) - internal code improvements + ## 0.11.0 (2021-07-07) (**YANKED**) - **breaking:** iterator functions (e.g. `ElfSectionsTag::sections()`) @@ -326,16 +358,19 @@ release and you'll be fine!** - much improved debug-formatting of `BootInformation` - internal code improvements / formatting + ## 0.10.0 (2020-11-03) (**YANKED**) - allow access to all memory regions (MemoryMap-Tag) - internal code improvements + ## 0.9.0 (2020-07-06) - Add a `checksum_is_valid` method to the RSDP tags ([#64](https://github.com/rust-osdev/multiboot2/pull/64)) + ## 0.8.2 (2022-03-02) - Add some basic diff --git a/multiboot2/src/boot_information.rs b/multiboot2/src/boot_information.rs index ba4f0fb5..8771fffe 100644 --- a/multiboot2/src/boot_information.rs +++ b/multiboot2/src/boot_information.rs @@ -254,7 +254,7 @@ impl<'a> BootInformation<'a> { /// ``` #[must_use] #[deprecated = "Use elf_sections_tag() instead and corresponding getters"] - pub fn elf_sections(&self) -> Option { + pub fn elf_sections(&self) -> Option> { let tag = self.get_tag::(); tag.map(|t| { assert!((t.entry_size() * t.shndx()) <= t.header().size); @@ -295,7 +295,7 @@ impl<'a> BootInformation<'a> { /// /// [`ModuleTag`]: crate::ModuleTag #[must_use] - pub fn module_tags(&self) -> ModuleIter { + pub fn module_tags(&self) -> ModuleIter<'_> { module::module_iter(self.tags()) } @@ -411,7 +411,7 @@ impl<'a> BootInformation<'a> { /// times, even tho this is unusual. However, it is recommended to use the /// tag getters as normal bootloaders provide most tags only once. #[must_use] - pub fn tags(&self) -> TagIter { + pub fn tags(&self) -> TagIter<'_> { TagIter::new(self.0.payload()) } } diff --git a/multiboot2/src/elf_sections.rs b/multiboot2/src/elf_sections.rs index a084cb4c..78096e37 100644 --- a/multiboot2/src/elf_sections.rs +++ b/multiboot2/src/elf_sections.rs @@ -39,7 +39,7 @@ impl ElfSectionsTag { /// Get an iterator over the ELF sections. #[must_use] - pub const fn sections(&self) -> ElfSectionIter { + pub const fn sections(&self) -> ElfSectionIter<'_> { let string_section_offset = (self.shndx * self.entry_size) as isize; let string_section_ptr = unsafe { self.sections.as_ptr().offset(string_section_offset) as *const _ }; diff --git a/multiboot2/src/framebuffer.rs b/multiboot2/src/framebuffer.rs index 8151dccf..188b66ad 100644 --- a/multiboot2/src/framebuffer.rs +++ b/multiboot2/src/framebuffer.rs @@ -165,7 +165,7 @@ impl FramebufferTag { } /// The type of framebuffer, one of: `Indexed`, `RGB` or `Text`. - pub fn buffer_type(&self) -> Result { + pub fn buffer_type(&self) -> Result, UnknownFramebufferType> { let mut reader = Reader::new(&self.buffer); // TODO: We should use the newtype pattern instead or so to properly diff --git a/multiboot2/src/memory_map.rs b/multiboot2/src/memory_map.rs index 07422984..0aca78c7 100644 --- a/multiboot2/src/memory_map.rs +++ b/multiboot2/src/memory_map.rs @@ -363,7 +363,7 @@ impl EFIMemoryMapTag { /// Usually, this should already reflect the memory consumed by the /// code running this. #[must_use] - pub fn memory_areas(&self) -> EFIMemoryAreaIter { + pub fn memory_areas(&self) -> EFIMemoryAreaIter<'_> { // If this ever fails, this needs to be refactored in a joint-effort // with the uefi-rs project to have all corresponding typings. assert_eq!(self.desc_version, EFIMemoryDesc::VERSION);