Skip to content

Commit 06117e4

Browse files
committed
ignore test
1 parent 93f140e commit 06117e4

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

src/runtime.md

+18-3
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,30 @@ The `panic_handler` attribute can only be applied to a function with signature
1717
Below is shown a `panic_handler` function that logs the panic message and then halts the
1818
thread.
1919

20-
``` rust
20+
<!-- NOTE(ignore) `mdbook test` doesn't support `no_std` code -->
21+
22+
``` rust, ignore
2123
#![no_std]
2224
23-
use core::intrinsics;
25+
use core::fmt::{self, Write};
2426
use core::panic::PanicInfo;
2527
28+
struct Sink {
29+
// ..
30+
# _0: (),
31+
}
32+
#
33+
# impl Sink {
34+
# fn new() -> Sink { Sink { _0: () }}
35+
# }
36+
#
37+
# impl fmt::Write for Sink {
38+
# fn write_str(&mut self, _: &str) -> fmt::Result { Ok(()) }
39+
# }
40+
2641
#[panic_handler]
2742
fn panic(info: &PanicInfo) -> ! {
28-
let mut sink = /* .. */;
43+
let mut sink = Sink::new();
2944
3045
// logs "panicked at '$reason', src/main.rs:27:4" to some `sink`
3146
let _ = writeln!(sink, "{}", info);

0 commit comments

Comments
 (0)