Skip to content

Commit bdb0db1

Browse files
authored
Merge pull request #123 from rust-osdev/multiboot2-v0.14.2-dev
Multiboot2 v0.14.2 dev
2 parents fd8e694 + bd060ab commit bdb0db1

File tree

14 files changed

+105
-29
lines changed

14 files changed

+105
-29
lines changed

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ insert_final_newline = true
99
indent_style = space
1010
indent_size = 4
1111
trim_trailing_whitespace = true
12+
max_line_length = 80
1213

1314
[*.yml]
1415
indent_size = 2

.github/workflows/qa.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: QA
2+
3+
on: [ push, pull_request ]
4+
5+
jobs:
6+
spellcheck:
7+
name: Spellcheck
8+
runs-on: ubuntu-22.04
9+
steps:
10+
- uses: actions/checkout@v3
11+
# Executes "typos ."
12+
- uses: crate-ci/[email protected]

.github/workflows/rust.yml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ env:
1010
CARGO_TERM_COLOR: always
1111

1212
jobs:
13+
# Regular build (with std) + test execution
1314
build:
1415
runs-on: ubuntu-latest
1516
strategy:
@@ -19,7 +20,7 @@ jobs:
1920
- nightly
2021
- 1.52.1 # MSVR
2122
steps:
22-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v3
2324
# Important preparation step: override the latest default Rust version in GitHub CI
2425
# with the current value of the iteration in the "strategy.matrix.rust"-array.
2526
- uses: actions-rs/toolchain@v1
@@ -30,10 +31,11 @@ jobs:
3031
# helps to identify if the right cargo version is actually used
3132
- run: cargo version
3233
- name: Build
33-
run: cargo build --verbose
34+
run: cargo build --all-targets --verbose
3435
- name: Run tests
3536
run: cargo test --verbose
3637

38+
# no-std build without tests
3739
build_no_std:
3840
runs-on: ubuntu-latest
3941
strategy:
@@ -43,7 +45,7 @@ jobs:
4345
- nightly
4446
- 1.52.1 # MSVR
4547
steps:
46-
- uses: actions/checkout@v2
48+
- uses: actions/checkout@v3
4749
# Important preparation step: override the latest default Rust version in GitHub CI
4850
# with the current value of the iteration in the "strategy.matrix.rust"-array.
4951
- uses: actions-rs/toolchain@v1
@@ -58,6 +60,26 @@ jobs:
5860
- name: Build (no_std)
5961
run: cargo build --target thumbv7em-none-eabihf
6062

63+
# Tests that the unstable feature, which requires nightly, builds.
64+
build_unstable:
65+
runs-on: ubuntu-latest
66+
strategy:
67+
matrix:
68+
rust:
69+
- nightly
70+
steps:
71+
- uses: actions/checkout@v3
72+
# Important preparation step: override the latest default Rust version in GitHub CI
73+
# with the current value of the iteration in the "strategy.matrix.rust"-array.
74+
- uses: actions-rs/toolchain@v1
75+
with:
76+
profile: default
77+
toolchain: ${{ matrix.rust }}
78+
override: true
79+
- name: Build (unstable)
80+
run: cargo build --all-targets --features unstable
81+
- name: Test (unstable)
82+
run: cargo test --all-targets --features unstable
6183

6284
# As discussed, these tasks are optional for PRs.
6385
style_checks:
@@ -67,7 +89,7 @@ jobs:
6789
rust:
6890
- 1.52.1 # MSVR
6991
steps:
70-
- uses: actions/checkout@v2
92+
- uses: actions/checkout@v3
7193
# Important preparation step: override the latest default Rust version in GitHub CI
7294
# with the current value of the iteration in the "strategy.matrix.rust"-array.
7395
- uses: actions-rs/toolchain@v1
@@ -80,6 +102,6 @@ jobs:
80102
- name: Rustfmt
81103
run: cargo fmt -- --check
82104
- name: Clippy
83-
run: cargo clippy
105+
run: cargo clippy --all-targets
84106
- name: Rustdoc
85-
run: cargo doc
107+
run: cargo doc --document-private-items

.typos.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Configuration for the typos spell checker utility (<https://github.com/crate-ci/typos>).
2+
3+
[files]
4+
extend-exclude = [
5+
# "uefi/src/table/boot.rs"
6+
]
7+
8+
[default.extend-words]
9+
Rela = "Rela"
10+
11+
[default.extend-identifiers]
12+
# FOOBAR = "FOOBAR"
13+

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
[workspace]
22
members = [
3-
# Multiboot2 Information Structure (MBI)
43
"multiboot2",
5-
# Multiboot2 headers
64
"multiboot2-header",
75
]

multiboot2-header/src/builder/traits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub(crate) trait StructAsBytes: Sized {
2323
}
2424

2525
/// Returns the structure as a vector of its bytes.
26-
/// The length is determined by [`size`].
26+
/// The length is determined by [`Self::byte_size`].
2727
fn struct_as_bytes(&self) -> alloc::vec::Vec<u8> {
2828
let ptr = self.as_ptr();
2929
let mut vec = alloc::vec::Vec::with_capacity(self.byte_size());

multiboot2/Cargo.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Multiboot2-compliant bootloaders, like GRUB. It supports all tags from the speci
66
including full support for the sections of ELF-64. This library is `no_std` and can be
77
used in a Multiboot2-kernel.
88
"""
9-
version = "0.14.1"
9+
version = "0.14.2"
1010
authors = [
1111
"Philipp Oppermann <[email protected]>",
1212
"Calvin Lee <[email protected]>",
@@ -31,5 +31,11 @@ homepage = "https://github.com/rust-osdev/multiboot2"
3131
repository = "https://github.com/rust-osdev/multiboot2"
3232
documentation = "https://docs.rs/multiboot2"
3333

34+
[features]
35+
default = []
36+
# Nightly-only features that will eventually be stabilized.
37+
unstable = []
38+
3439
[dependencies]
3540
bitflags = "1"
41+
derive_more = { version = "0.99.17", default-features = false, features = ["display"] }

multiboot2/Changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# CHANGELOG for crate `multiboot2`
22

3+
## 0.14.2 (2023-03-17)
4+
- documentation fixes
5+
- `MbiLoadError` now implements `Display`
6+
- Added the `unstable` feature, which enables nightly-only functionality.
7+
With this feature, `MbiLoadError` now implements `core::error::Error` and can
8+
be used with `anyhow::Result` for example.
9+
310
## 0.14.1 (2023-03-09)
411
- fixed the calculation of the last area of the memory map tag ([#119](https://github.com/rust-osdev/multiboot2/pull/119))
512
(Previously, iterating the EFI Memory map resulted in a superfluous entry as it ran over the next tag)

multiboot2/src/boot_loader_name.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ impl BootLoaderNameTag {
2121
///
2222
/// # Examples
2323
///
24-
/// ```ignore
24+
/// ```rust,no_run
25+
/// # let boot_info = unsafe { multiboot2::load(0xdeadbeef).unwrap() };
2526
/// if let Some(tag) = boot_info.boot_loader_name_tag() {
26-
/// let name = tag.name();
27-
/// assert_eq!("GRUB 2.02~beta3-5", name);
27+
/// assert_eq!(Ok("GRUB 2.02~beta3-5"), tag.name());
2828
/// }
2929
/// ```
3030
pub fn name(&self) -> Result<&str, Utf8Error> {

multiboot2/src/command_line.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ impl CommandLineTag {
2525
///
2626
/// # Examples
2727
///
28-
/// ```ignore
28+
/// ```rust,no_run
29+
/// # let boot_info = unsafe { multiboot2::load(0xdeadbeef).unwrap() };
2930
/// if let Some(tag) = boot_info.command_line_tag() {
3031
/// let command_line = tag.command_line();
31-
/// assert_eq!("/bootarg", command_line);
32+
/// assert_eq!(Ok("/bootarg"), command_line);
3233
/// }
3334
/// ```
3435
pub fn command_line(&self) -> Result<&str, str::Utf8Error> {

0 commit comments

Comments
 (0)