Skip to content

Commit ef79b8b

Browse files
authored
Merge pull request #144 from rust-osdev/dev3
streamline default derives
2 parents 9dd5c2a + ab6bb32 commit ef79b8b

29 files changed

+80
-76
lines changed

multiboot2-header/src/address.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use core::mem::size_of;
55
/// format, but it must be provided if the image is in a.out format or in some
66
/// other format. Required for legacy boot (BIOS).
77
/// Determines load addresses.
8-
#[derive(Copy, Clone, Debug)]
8+
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
99
#[repr(C)]
1010
pub struct AddressHeaderTag {
1111
typ: HeaderTagType,

multiboot2-header/src/builder/header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use core::mem::size_of;
1414
/// Builder to construct a valid Multiboot2 header dynamically at runtime.
1515
/// The tags will appear in the order of their corresponding enumeration,
1616
/// except for the END tag.
17-
#[derive(Debug)]
17+
#[derive(Clone, Debug, PartialEq, Eq)]
1818
pub struct Multiboot2HeaderBuilder {
1919
arch: HeaderTagISA,
2020
// first

multiboot2-header/src/builder/information_request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use multiboot2::TagTypeId;
1111
/// at runtime. The information request tag has a dedicated builder because this way one
1212
/// can dynamically attach several requests to it. Otherwise, the number of requested tags
1313
/// must be known at compile time.
14-
#[derive(Debug)]
14+
#[derive(Clone, Debug, PartialEq, Eq)]
1515
#[cfg(feature = "builder")]
1616
pub struct InformationRequestHeaderTagBuilder {
1717
flag: HeaderTagFlag,

multiboot2-header/src/console.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use core::mem::size_of;
33

44
/// Possible flags for [`ConsoleHeaderTag`].
55
#[repr(u32)]
6-
#[derive(Copy, Clone, Debug)]
6+
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
77
pub enum ConsoleHeaderTagFlags {
88
/// Console required.
99
ConsoleRequired = 0,
@@ -13,7 +13,7 @@ pub enum ConsoleHeaderTagFlags {
1313

1414
/// Tells that a console must be available in MBI.
1515
/// Only relevant for legacy BIOS.
16-
#[derive(Copy, Clone, Debug)]
16+
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
1717
#[repr(C)]
1818
pub struct ConsoleHeaderTag {
1919
typ: HeaderTagType,

multiboot2-header/src/end.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::{HeaderTagFlag, HeaderTagType};
22
use core::mem::size_of;
33

44
/// Terminates a list of optional tags in a Multiboot2 header.
5-
#[derive(Copy, Clone, Debug)]
5+
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
66
#[repr(C)]
77
pub struct EndHeaderTag {
88
// u16 value

multiboot2-header/src/entry_address.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use core::mem::size_of;
55

66
/// Specifies the physical address to which the boot loader should jump in
77
/// order to start running the operating system. Not needed for ELF files.
8-
#[derive(Copy, Clone)]
8+
#[derive(Copy, Clone, PartialEq, Eq)]
99
#[repr(C)]
1010
pub struct EntryAddressHeaderTag {
1111
typ: HeaderTagType,

multiboot2-header/src/entry_efi_32.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use core::mem::size_of;
99
///
1010
/// Technically, this is equivalent to the [`crate::EntryAddressHeaderTag`] but with a different
1111
/// [`crate::HeaderTagType`].
12-
#[derive(Copy, Clone)]
12+
#[derive(Copy, Clone, PartialEq, Eq)]
1313
#[repr(C)]
1414
pub struct EntryEfi32HeaderTag {
1515
typ: HeaderTagType,

multiboot2-header/src/entry_efi_64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use core::mem::size_of;
99
///
1010
/// Technically, this is equivalent to the [`crate::EntryAddressHeaderTag`] but with a different
1111
/// [`crate::HeaderTagType`].
12-
#[derive(Copy, Clone)]
12+
#[derive(Copy, Clone, PartialEq, Eq)]
1313
#[repr(C)]
1414
pub struct EntryEfi64HeaderTag {
1515
typ: HeaderTagType,

multiboot2-header/src/framebuffer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use core::mem::size_of;
55
/// is present the bootloader assumes that the payload
66
/// has framebuffer support. Note: This is only a
77
/// recommended mode. Only relevant on legacy BIOS.
8-
#[derive(Copy, Clone, Debug)]
8+
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
99
#[repr(C)]
1010
pub struct FramebufferHeaderTag {
1111
typ: HeaderTagType,

multiboot2-header/src/header.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ impl<'a> Debug for Multiboot2Header<'a> {
200200

201201
/// Errors that can occur when parsing a header from a slice.
202202
/// See [`Multiboot2Header::find_header`].
203-
#[derive(Debug, Clone, PartialEq, Eq)]
203+
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
204204
pub enum LoadError {
205205
/// The checksum does not match the data.
206206
ChecksumMismatch,
@@ -226,7 +226,7 @@ impl core::error::Error for LoadError {}
226226
///
227227
/// The "basic" Multiboot2 header. This means only the properties, that are known during
228228
/// compile time. All other information are derived during runtime from the size property.
229-
#[derive(Copy, Clone)]
229+
#[derive(Copy, Clone, PartialEq, Eq)]
230230
#[repr(C)]
231231
pub struct Multiboot2BasicHeader {
232232
/// Must be the value of [`MULTIBOOT2_HEADER_MAGIC`].

0 commit comments

Comments
 (0)