Skip to content

Commit 9aa5ed7

Browse files
uefi: Fix compilation of minimal example
This turns out to be easier than I expected: just add `extern crate std;` so that the panic handler and global allocator are set. The line is hidden so that it doesn't appear in the rendered docs. This allows the code block to `no_run` instead of `ignore`, so it will be compiled (but not run, so there's no `main` linker error), and that also has the nice side effect of removing the orange `!` warning bubble in the rendered docs.
1 parent f529325 commit 9aa5ed7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

uefi/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
//! Minimal example for an UEFI application using functionality of the
1313
//! `uefi` crate:
1414
//!
15-
//! ```ignore
15+
//! ```no_run
1616
//! #![no_main]
1717
//! #![no_std]
1818
//!
@@ -24,6 +24,7 @@
2424
//!
2525
//! Status::SUCCESS
2626
//! }
27+
//! # extern crate std;
2728
//! ```
2829
//!
2930
//! Please find more info in our [Rust UEFI Book].

0 commit comments

Comments
 (0)