Skip to content
This repository was archived by the owner on Mar 7, 2021. It is now read-only.

Commit 197a5bb

Browse files
committed
Fix printk by allocating and also fighting with macros
1 parent 24ced39 commit 197a5bb

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![no_std]
2-
#![feature(alloc, global_allocator, allocator_api, const_fn, lang_items)]
2+
#![feature(alloc, global_allocator, allocator_api, const_fn, lang_items, use_extern_macros)]
33

44
extern crate alloc;
55
#[macro_use]
@@ -12,6 +12,8 @@ pub mod filesystem;
1212
pub mod printk;
1313
pub mod types;
1414

15+
pub use alloc::format;
16+
1517
pub use error::{Error, KernelResult};
1618

1719
#[macro_export]

src/printk.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ macro_rules! println {
3030
use ::core::fmt::Write;
3131
// TODO: Don't allocate!
3232
let s = format!(concat!("\x016", $fmt, "\n"), $($arg)*);
33-
let _ = $crate::printk::KernelConsole.write_str(s);
33+
let _ = $crate::printk::KernelConsole.write_str(&s);
3434
});
3535
}

0 commit comments

Comments
 (0)