You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: panic.rs
    path of file: ./repos/maestro/src
    
    the code of the file until where you have to start completion: /*
 * Copyright 2024 Luc Len√¥tre
 *
 * This file is part of Maestro.
 *
 * Maestro is free software: you can redistribute it and/or modify it under the
 * terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 *
 * Maestro is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 * A PARTICULAR PURPOSE. See the GNU General Public License for more
    
fn panic(panic_info: &PanicInfo) -> ! {
	crate::cli!();
	logger::LOGGER.lock().silent = false;

	#[cfg(test)]
	{
		use crate::selftest;

		if selftest::is_running() {
			crate::println!("FAILED\n");
			crate::println!("Error: {panic_info}\n");

			#[cfg(config_debug_qemu)]
			selftest::qemu::exit(selftest::qemu::FAILURE);
			#[cfg(not(config_debug_qemu))]
			halt();
		}
	}

	crate::println!("--- KERNEL PANIC ---\n");
	crate::println!("Kernel has been forced to halt due to internal problem, sorry :/");
	if let Some(msg) = panic_info.message() {
		crate::print!("Reason: {msg}");
	}
	if let Some(loc) = panic_info.location() {
		crate::println!(" (location: {loc})");
	} else {
		crate::println!();
	}
	crate::println!(
		"If you believe this is a bug on the kernel side, please feel free to report it."
	);

	let cr2 = unsafe { cpu::cr2_get() };
	crate::println!("cr2: {cr2:p}\n");

	#[cfg(config_debug_debug)]
	{
		use crate::debug;
		use core::ffi::c_void;
		use core::ptr::null_mut;

		crate::println!("--- Callstack ---");
		let ebp = unsafe { crate::register_get!("ebp") as *mut _ };
		let mut callstack: [*mut c_void; 8] = [null_mut::<c_void>(); 8];
		debug::get_callstack(ebp, &mut callstack);
		debug::print_callstack(&callstack);
	}

	power::halt();
}