shell: fix const debug warnings on 1.48

This fixes a bunch of warnings that appeared with Rust 1.48.

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
Sean Cross 2020-11-23 17:21:24 +08:00
parent 12532e1734
commit 5c89487ca2

View file

@ -7,7 +7,7 @@ macro_rules! print
{
($($args:tt)+) => ({
use core::fmt::Write;
let _ = write!(crate::debug::DEFAULT, $($args)+);
let _ = write!(crate::debug::Uart {}, $($args)+);
});
}
#[macro_export]
@ -28,7 +28,8 @@ macro_rules! println
fn handle_irq(irq_no: usize, arg: *mut usize) {
print!("Handling IRQ {} (arg: {:08x}): ", irq_no, arg as usize);
while let Some(c) = crate::debug::DEFAULT.getc() {
let uart = crate::debug::Uart {};
while let Some(c) = uart.getc() {
print!("{}", c as char);
}
println!();
@ -39,7 +40,7 @@ pub struct Uart {}
// this is a hack to bypass an explicit initialization/allocation step for the debug structure
pub static mut DEFAULT_UART_ADDR: *mut usize = 0x0000_0000 as *mut usize;
pub const DEFAULT: Uart = Uart {};
// pub const DEFAULT: Uart = Uart {};
impl Uart {
fn map_uart(&self) {