Skip to content

Commit 46ab172

Browse files
committed
clippy: lifetime warnings
fix various "hiding a lifetime that's elided elsewhere is confusing"
1 parent d6332cf commit 46ab172

File tree

10 files changed

+69
-9
lines changed

10 files changed

+69
-9
lines changed

multiboot2-common/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,34 @@
11
# Changelog for Crate `multiboot2-common`
22

3+
## Unreleased
4+
5+
- Small code improvements
6+
7+
38
## v0.3.0 (2025-06-01)
49

510
- **Breaking:** Removed the optional `unstable` feature (required nightly)
611
- `core::error::Error` is now implemented unconditionally
712
- **Breaking:** The MSRV is now 1.85
813

14+
915
## v0.2.1 (2024-09-19)
1016

1117
- Documentation improvements
1218

19+
1320
## v0.2.0 (2024-09-17)
1421

1522
- dependency updates
1623
- **Breaking:** MSRV is now 1.75
1724
- misc metadata fixes
1825

26+
1927
## v0.1.2 (2024-08-24)
2028

2129
- Documentation improvements
2230

31+
2332
## 0.1.0 / 0.1.1 (2024-08-20)
2433

2534
Initial release.

multiboot2-common/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ pub struct DynSizedStructure<H: Header> {
330330
impl<H: Header> DynSizedStructure<H> {
331331
/// Creates a new fat-pointer backed reference to a [`DynSizedStructure`]
332332
/// from the given [`BytesRef`].
333-
pub fn ref_from_bytes(bytes: BytesRef<H>) -> Result<&Self, MemoryError> {
333+
pub fn ref_from_bytes(bytes: BytesRef<'_, H>) -> Result<&Self, MemoryError> {
334334
let ptr = bytes.as_ptr().cast::<H>();
335335
let hdr = unsafe { &*ptr };
336336

multiboot2-common/src/tag.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pub trait MaybeDynSized: Pointee {
6262
/// Returns the whole allocated bytes for this structure encapsulated in
6363
/// [`BytesRef`]. This includes padding bytes. To only get the "true" tag
6464
/// data, read the tag size from [`Self::header`] and create a sub slice.
65-
fn as_bytes(&self) -> BytesRef<Self::Header> {
65+
fn as_bytes(&self) -> BytesRef<'_, Self::Header> {
6666
let ptr = core::ptr::addr_of!(*self);
6767
// Actual tag size with optional terminating padding.
6868
let size = mem::size_of_val(self);

multiboot2-header/CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,29 @@
11
# Changelog for Crate `multiboot2-header`
22

3+
## Unreleased
4+
5+
- Small code improvements
6+
7+
38
## v0.7.0 (2025-06-01)
49

510
- **Breaking:** Removed the optional `unstable` feature (required nightly)
611
- `core::error::Error` is now implemented unconditionally
712
- **Breaking:** The MSRV is now 1.85
813

14+
915
## v0.6.0 (2024-09-17)
1016

1117
- dependency updates
1218
- **Breaking:** MSRV is now 1.75
1319
- misc metadata fixes
1420

21+
1522
## v0.5.1 (2024-08-24)
1623

1724
- Documentation improvements
1825

26+
1927
## v0.5.0 (2024-05-20)
2028

2129
This release contains a major refactoring of the internals, guaranteeing
@@ -37,23 +45,27 @@ All previous versions have been marked as **YANKED**. `0.5.0` is the first
3745
version where all unit tests are passed by Miri, i.e., the first version
3846
without Undefined Behavior.
3947

48+
4049
## 0.4.0 (2024-05-01) (**YANKED**)
4150

4251
- added `EndHeaderTag::default()`
4352
- MSRV is 1.70
4453
- Can add multiple `TagType::Smbios` tags in the builder.
4554

55+
4656
## 0.3.2 (2023-11-30) (**YANKED**)
4757

4858
- **BREAKING** bumped `multiboot2` dependency to `v0.19.0`
4959
- the `multiboot2` dependency doesn't pull in the `multiboot2/builder` feature
5060
anymore
5161
- doc update
5262

63+
5364
## 0.3.1 (2023-06-28) (**YANKED**)
5465

5566
- doc update
5667

68+
5769
## 0.3.0 (2023-06-23) (**YANKED**)
5870

5971
- **BREAKING** MSRV is 1.68.0 (UPDATE: This is actually 1.69.)
@@ -67,6 +79,7 @@ without Undefined Behavior.
6779
- added the optional `unstable` feature (requires nightly)
6880
- implement `core::error::Error` for `LoadError`
6981

82+
7083
## 0.2.0 (2022-05-03) (**YANKED**)
7184

7285
- **BREAKING** renamed `EntryHeaderTag` to `EntryAddressHeaderTag`
@@ -75,6 +88,7 @@ without Undefined Behavior.
7588
-> thus, import paths are much more logically now
7689
- internal code improvements
7790

91+
7892
## 0.1.1 (2022-05-02) (**YANKED**)
7993

8094
- fixed a bug that prevented the usage of the crate in `no_std` environments
@@ -83,10 +97,12 @@ without Undefined Behavior.
8397
(this feature can be disabled which will also remove the dependency to
8498
the `alloc` crate)
8599

100+
86101
## 0.1.0 (2021-10-08) (**YANKED**)
87102

88103
- initial release
89104

105+
90106
## 0.0.0
91107

92108
Empty release to save the name on crates.io

multiboot2-header/src/header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ impl<'a> Multiboot2Header<'a> {
103103

104104
/// Returns a [`TagIter`].
105105
#[must_use]
106-
pub fn iter(&self) -> TagIter {
106+
pub fn iter(&self) -> TagIter<'_> {
107107
TagIter::new(self.0.payload())
108108
}
109109

multiboot2/CHANGELOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
# Changelog for Crate `multiboot2`
22

3+
## Unreleased
4+
5+
- Small code improvements
6+
7+
38
## v0.24.0 (2025-06-01)
49

510
- **Breaking:** Removed the optional `unstable` feature (required nightly)
611
- `core::error::Error` is now implemented unconditionally
712
- **Breaking:** The MSRV is now 1.85
813
- Fixed a bug causing UB in `ElfSection::name()`
914

15+
1016
## v0.23.1 (2024-10-21)
1117

1218
- Fix wrong tag ID when using `BootdevTag::new`
@@ -15,6 +21,7 @@
1521
`.sections()` to iterate the sections
1622
- Fixed the debug output of `BootInformation`
1723

24+
1825
## v0.23.0 (2024-09-17)
1926

2027
- dependency updates
@@ -26,15 +33,18 @@
2633
- `BootInformation::tags` iterator is now public
2734
- misc metadata fixes
2835

36+
2937
## v0.22.2 (2024-08-24)
3038

3139
- Documentation improvements
3240
- Improve debug formatting for EFIMemoryMapTag
3341

42+
3443
## v0.22.1 (2024-08-20)
3544

3645
Minor documentation fixes.
3746

47+
3848
## v0.22.0 (2024-08-20)
3949

4050
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
7383
version where all unit tests are passed by Miri, i.e., the first version
7484
without Undefined Behavior.
7585

86+
7687
## 0.21.0 (2024-08-17) (**YANKED**)
7788

7889
This release contains a massive refactoring of various internals. Now, almost
@@ -104,10 +115,12 @@ release and you'll be fine!**
104115
- documentation enhancements
105116
- updated dependencies
106117

118+
107119
## 0.20.2 (2024-05-26) (**YANKED**)
108120

109121
- fix Debug implementation of `EfiMemoryMapTag`
110122

123+
111124
## 0.20.1 (2024-05-26) (**YANKED**)
112125

113126
- fixed the handling of `EFIMemoryMapTag` and `EFIMemoryAreaIter`
@@ -116,11 +129,13 @@ release and you'll be fine!**
116129
`EFIMemoryMapTag::new_from_map`.
117130
- `ModuleTag::new`'s `end` parameter now must be bigger than `start`.
118131

132+
119133
## 0.20.0 (2024-05-01) (**YANKED**)
120134

121135
- added `InformationBuilder::default()`
122136
- MSRV is 1.70
123137

138+
124139
## 0.19.0 (2023-09-21) (**YANKED**)
125140

126141
- **BREAKING** MSRV is 1.69.0
@@ -135,10 +150,12 @@ release and you'll be fine!**
135150
- `InformationBuilder` now also allows to add custom tags. The new public method
136151
`add_tag` was introduced for that.
137152

153+
138154
## 0.18.1 (2023-07-13) (**YANKED**)
139155

140156
- Documentation improvements
141157

158+
142159
## 0.18.0 (2023-07-13) (**YANKED**)
143160

144161
- **BREAKING** The `TagTrait` was enhanced and now has an associated `ID`
@@ -160,13 +177,15 @@ release and you'll be fine!**
160177
- Better debug output of `BootInformation` and `MemoryArea`
161178
- Internal code cleanup.
162179

180+
163181
## 0.17.0 (2023-07-12) (**YANKED**)
164182

165183
- **BREAKING** Make functions of `InformationBuilder` chainable. They now
166184
consume the builder.
167185
- **BREAKING** Allow non-standard memory area types by using new pair of
168186
corresponding types: `MemoryAreaTypeId` and `MemoryAreaType`.
169187

188+
170189
## 0.16.0 (2023-06-23) (**YANKED**)
171190

172191
- **BREAKING** renamed `MULTIBOOT2_BOOTLOADER_MAGIC` to `MAGIC`
@@ -205,6 +224,7 @@ release and you'll be fine!**
205224
- added `BootInformation::load` as new default constructor
206225
- added `MemoryMapTag::entry_size` and `MemoryMapTag::entry_version`
207226

227+
208228
## 0.15.1 (2023-03-18) (**YANKED**)
209229

210230
- **BREAKING** `MemoryMapTag::all_memory_areas()` was renamed to `memory_areas`
@@ -220,6 +240,7 @@ release and you'll be fine!**
220240
value. This prevents possible panics.
221241
- fix: prevent a possible panic in `ElfSection::section_type()`
222242

243+
223244
## 0.15.0 (2023-03-17) (**YANKED**)
224245

225246
- **BREAKING** MSRV is 1.56.1
@@ -242,6 +263,7 @@ release and you'll be fine!**
242263
(check docs.rs). There is also a small unit test that you can use to learn
243264
from.
244265

266+
245267
## 0.14.2 (2023-03-17) (**YANKED**)
246268

247269
- documentation fixes
@@ -250,13 +272,15 @@ release and you'll be fine!**
250272
With this feature, `MbiLoadError` now implements `core::error::Error` and can
251273
be used with `anyhow::Result` for example.
252274

275+
253276
## 0.14.1 (2023-03-09) (**YANKED**)
254277

255278
- fixed the calculation of the last area of the memory map
256279
tag ([#119](https://github.com/rust-osdev/multiboot2/pull/119))
257280
(Previously, iterating the EFI Memory map resulted in a superfluous entry as
258281
it ran over the next tag)
259282

283+
260284
## 0.14.0 (2022-06-30) (**YANKED**)
261285

262286
- **BREAKING CHANGES** \
@@ -273,25 +297,30 @@ release and you'll be fine!**
273297
- `RsdpV2Tag::oem_id` now returns a Result instead of an Option
274298
- internal code improvements
275299

300+
276301
## 0.13.3 (2022-06-03) (**YANKED**)
277302

278303
- impl `Send` for `BootInformation`
279304

305+
280306
## 0.13.2 (2022-05-02) (**YANKED**)
281307

282308
- `TagType` now implements `Ord` so that it can be used in `BTreeSet`
283309
- small internal improvements and restructuring of the code (no breaking changes
284310
to public API)
285311

312+
286313
## 0.13.1 (2022-01-09) (**YANKED**)
287314

288315
- minor fix
289316

317+
290318
## 0.13.0 (2022-01-09) (**YANKED**)
291319

292320
- added missing getters for tag `ImageLoadPhysAddr`
293321
- added missing getters for tags `EFIImageHandle32` and `EFIImageHandle64`
294322

323+
295324
## 0.12.2 (2021-10-02) (**YANKED**)
296325

297326
- `TagType` now implements `Eq` and `Hash`
@@ -305,18 +334,21 @@ release and you'll be fine!**
305334
- prepared co-existence of crates `multiboot2` and `multiboot2-header`
306335
in a Cargo workspace inside the same repository
307336

337+
308338
## 0.12.1 (2021-08-11) (**YANKED**)
309339

310340
- `TagType`-enum introduced in `v0.11` is now actually public
311341
- internal code improvements
312342

343+
313344
## 0.12.0 (2021-08-06) (**YANKED**)
314345

315346
- **breaking:** `load()` and `load_with_offset` now returns a result
316347
- added public constant `MULTIBOOT2_BOOTLOADER_MAGIC`
317348
- Rust edition 2018 (instead of 2015)
318349
- internal code improvements
319350

351+
320352
## 0.11.0 (2021-07-07) (**YANKED**)
321353

322354
- **breaking:** iterator functions (e.g. `ElfSectionsTag::sections()`)
@@ -326,16 +358,19 @@ release and you'll be fine!**
326358
- much improved debug-formatting of `BootInformation`
327359
- internal code improvements / formatting
328360

361+
329362
## 0.10.0 (2020-11-03) (**YANKED**)
330363

331364
- allow access to all memory regions (MemoryMap-Tag)
332365
- internal code improvements
333366

367+
334368
## 0.9.0 (2020-07-06)
335369

336370
- Add a `checksum_is_valid` method to the RSDP
337371
tags ([#64](https://github.com/rust-osdev/multiboot2/pull/64))
338372

373+
339374
## 0.8.2 (2022-03-02)
340375

341376
- Add some basic

multiboot2/src/boot_information.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ impl<'a> BootInformation<'a> {
254254
/// ```
255255
#[must_use]
256256
#[deprecated = "Use elf_sections_tag() instead and corresponding getters"]
257-
pub fn elf_sections(&self) -> Option<ElfSectionIter> {
257+
pub fn elf_sections(&self) -> Option<ElfSectionIter<'_>> {
258258
let tag = self.get_tag::<ElfSectionsTag>();
259259
tag.map(|t| {
260260
assert!((t.entry_size() * t.shndx()) <= t.header().size);
@@ -295,7 +295,7 @@ impl<'a> BootInformation<'a> {
295295
///
296296
/// [`ModuleTag`]: crate::ModuleTag
297297
#[must_use]
298-
pub fn module_tags(&self) -> ModuleIter {
298+
pub fn module_tags(&self) -> ModuleIter<'_> {
299299
module::module_iter(self.tags())
300300
}
301301

@@ -411,7 +411,7 @@ impl<'a> BootInformation<'a> {
411411
/// times, even tho this is unusual. However, it is recommended to use the
412412
/// tag getters as normal bootloaders provide most tags only once.
413413
#[must_use]
414-
pub fn tags(&self) -> TagIter {
414+
pub fn tags(&self) -> TagIter<'_> {
415415
TagIter::new(self.0.payload())
416416
}
417417
}

0 commit comments

Comments
 (0)