maually remove warning, pt2

toolchain_update
Ben Pig Chu 6 years ago
parent 1ca2bde069
commit 07b8a063ec

@ -108,7 +108,7 @@ impl<T: PageTable, M: SwapManager, S: Swapper> SwapExt<T, M, S> {
** @param addr: VirtAddr the target page's virtual address ** @param addr: VirtAddr the target page's virtual address
*/ */
pub unsafe fn set_swappable<T2: InactivePageTable>(&mut self, pt: *mut T2, addr: VirtAddr){ pub unsafe fn set_swappable<T2: InactivePageTable>(&mut self, pt: *mut T2, addr: VirtAddr){
let Self {ref mut page_table, ref mut swap_manager, ref mut swapper} = self; let Self {ref mut page_table, ref mut swap_manager, ..} = self;
let targetpt = &mut *(pt); let targetpt = &mut *(pt);
let pttoken = { let pttoken = {
info!("SET_SWAPPABLE: the target page table token is {:x?}, addr is {:x?}", targetpt.token(), addr); info!("SET_SWAPPABLE: the target page table token is {:x?}, addr is {:x?}", targetpt.token(), addr);
@ -209,7 +209,7 @@ impl<T: PageTable, M: SwapManager, S: Swapper> SwapExt<T, M, S> {
** the error if failed ** the error if failed
*/ */
fn swap_out<T2: InactivePageTable>(&mut self, frame: &Frame) -> Result<PhysAddr, SwapError> { fn swap_out<T2: InactivePageTable>(&mut self, frame: &Frame) -> Result<PhysAddr, SwapError> {
let Self {ref mut page_table, ref mut swap_manager, ref mut swapper} = self; let Self {ref mut page_table, ref mut swapper, ..} = self;
let ret = unsafe{ let ret = unsafe{
let pt = &mut *(frame.get_page_table() as *mut T2); let pt = &mut *(frame.get_page_table() as *mut T2);
pt.with(|| { pt.with(|| {

@ -69,6 +69,7 @@ impl<T: PartialEq> EventHub<T> {
} }
self.timers.insert(i, timer); self.timers.insert(i, timer);
} }
#[allow(dead_code)]
pub fn get_time(&self) -> Time { pub fn get_time(&self) -> Time {
self.tick self.tick
} }

@ -6,6 +6,7 @@ use crate::scheduler::Scheduler;
use crate::event_hub::EventHub; use crate::event_hub::EventHub;
struct Process { struct Process {
#[allow(dead_code)]
id: Pid, id: Pid,
status: Status, status: Status,
status_after_stop: Status, status_after_stop: Status,

@ -79,7 +79,7 @@ mod rr {
*rest == 0 *rest == 0
} }
fn set_priority(&mut self, pid: usize, priority: u8) { fn set_priority(&mut self, _pid: usize, _priority: u8) {
} }
fn move_to_head(&mut self, pid: usize) { fn move_to_head(&mut self, pid: usize) {

@ -23,7 +23,7 @@ fn processor() -> &'static Processor {
#[linkage = "weak"] #[linkage = "weak"]
#[no_mangle] #[no_mangle]
/// Construct a `Context` of the new kernel thread /// Construct a `Context` of the new kernel thread
fn new_kernel_context(entry: extern fn(usize) -> !, arg: usize) -> Box<Context> { fn new_kernel_context(_entry: extern fn(usize) -> !, _arg: usize) -> Box<Context> {
unimplemented!("thread: Please implement and export `new_kernel_context`") unimplemented!("thread: Please implement and export `new_kernel_context`")
} }

@ -374,8 +374,10 @@ impl From<FileInfo> for Stat {
mode: match info.type_ { mode: match info.type_ {
FileType::File => StatMode::FILE, FileType::File => StatMode::FILE,
FileType::Dir => StatMode::DIR, FileType::Dir => StatMode::DIR,
#[allow(unreachable_patterns)] // _ => StatMode::NULL,
_ => StatMode::NULL, //Note: we should mark FileType as #[non_exhaustive]
// but it is currently not implemented for enum
// see rust-lang/rust#44109
}, },
nlinks: info.nlinks as u32, nlinks: info.nlinks as u32,
blocks: info.blocks as u32, blocks: info.blocks as u32,

Loading…
Cancel
Save