From 69c10e0ba4ca66767e36bd12225b31b4838b2ef4 Mon Sep 17 00:00:00 2001 From: TheOddGarlic Date: Mon, 1 Aug 2022 14:50:41 +0300 Subject: [PATCH] misc warning fixes this concludes the fix warnings phase of the cleanup --- ableos/src/allocator/aalloc.rs | 8 ++++---- ableos/src/devices/pci/mod.rs | 2 -- ableos/src/handle.rs | 4 ++-- ableos/src/ipc/channel.rs | 4 ++-- ableos/src/unicode_utils.rs | 2 ++ ableos/src/virtio/mod.rs | 2 +- ableos/src/vterm.rs | 2 +- ableos/src/wasm/mod.rs | 4 ++-- ableos/src/wasm_jumploader/mod.rs | 5 +---- ext2-rs/src/lib.rs | 1 - kernel/src/aalloc/aalloc.rs | 7 ++----- kernel/src/lib.rs | 5 +---- qrcode-rust/src/cast.rs | 1 + qrcode-rust/src/render/unicode.rs | 6 +----- 14 files changed, 20 insertions(+), 33 deletions(-) diff --git a/ableos/src/allocator/aalloc.rs b/ableos/src/allocator/aalloc.rs index 75349835..fcf0f3f1 100644 --- a/ableos/src/allocator/aalloc.rs +++ b/ableos/src/allocator/aalloc.rs @@ -10,8 +10,8 @@ const BLOCK_SIZE: usize = 1024; const BLOCK_COUNT: usize = 512; #[derive(Debug, Clone, Copy)] pub struct MemoryRegion { - start: usize, - end: usize, + _start: usize, + _end: usize, } #[derive(Debug, Clone, Copy)] pub struct AAlloc { @@ -36,8 +36,8 @@ impl AAlloc { }; aalloc.add_region(MemoryRegion { - start: 0x00100000, - end: 0x00EFFFFF, + _start: 0x00100000, + _end: 0x00EFFFFF, }); debug!("{}", aalloc); } diff --git a/ableos/src/devices/pci/mod.rs b/ableos/src/devices/pci/mod.rs index ce3fc5a3..6d087b0b 100644 --- a/ableos/src/devices/pci/mod.rs +++ b/ableos/src/devices/pci/mod.rs @@ -2,8 +2,6 @@ // Copyright (c) 2021 trashbyte // See LICENSE.txt for full license -#![feature(asm)] - extern crate alloc; use alloc::{format, string::String, vec::Vec}; use core::fmt::{Display, Error, Formatter}; diff --git a/ableos/src/handle.rs b/ableos/src/handle.rs index 592cb429..dda62396 100644 --- a/ableos/src/handle.rs +++ b/ableos/src/handle.rs @@ -6,8 +6,8 @@ use core::fmt::Display; #[derive(Debug)] pub struct BinaryData { - name: String, - data: Vec, + _name: String, + _data: Vec, } #[derive(Debug, Eq, Hash, PartialEq, Clone, Copy)] diff --git a/ableos/src/ipc/channel.rs b/ableos/src/ipc/channel.rs index 852ed2ae..d711d8e6 100644 --- a/ableos/src/ipc/channel.rs +++ b/ableos/src/ipc/channel.rs @@ -16,7 +16,7 @@ pub struct ChannelPermission { #[derive(Debug)] pub struct Channel { pub public: bool, - name: String, + _name: String, inner: VecDeque, } @@ -26,7 +26,7 @@ impl Channel { Self { public, - name: name.into(), + _name: name.into(), inner: deq, } } diff --git a/ableos/src/unicode_utils.rs b/ableos/src/unicode_utils.rs index 11c95f05..45d1930a 100644 --- a/ableos/src/unicode_utils.rs +++ b/ableos/src/unicode_utils.rs @@ -1,3 +1,5 @@ +#![allow(dead_code)] + pub const CONSOLE: &str = "\u{E795}"; pub const POWER_SIGN: &str = "\u{23FB}"; pub const LAMBDA: &str = "λ"; diff --git a/ableos/src/virtio/mod.rs b/ableos/src/virtio/mod.rs index b75f1607..cb22fa19 100644 --- a/ableos/src/virtio/mod.rs +++ b/ableos/src/virtio/mod.rs @@ -6,7 +6,7 @@ //! pub struct VirtioDevice { - status: VirtioDeviceStatus, + _status: VirtioDeviceStatus, } use crate::devices::pci::PciDeviceInfo; diff --git a/ableos/src/vterm.rs b/ableos/src/vterm.rs index d743a6ad..cbaf1103 100644 --- a/ableos/src/vterm.rs +++ b/ableos/src/vterm.rs @@ -2,7 +2,7 @@ use crate::vga_e::VGAE; use vga::{colors::Color16, writers::GraphicsWriter}; const TERM_MINUS_ONE_LINE: usize = 4720; -const CURSOR_COLOR: Color16 = Color16::Cyan; +// const CURSOR_COLOR: Color16 = Color16::Cyan; #[derive(Debug)] pub struct Term { diff --git a/ableos/src/wasm/mod.rs b/ableos/src/wasm/mod.rs index fbc9a869..7d558491 100644 --- a/ableos/src/wasm/mod.rs +++ b/ableos/src/wasm/mod.rs @@ -44,8 +44,8 @@ pub enum SectionType { pub struct Section { /// The section type - stype: SectionType, - section_size: u8, + _stype: SectionType, + _section_size: u8, } /// A wasm type diff --git a/ableos/src/wasm_jumploader/mod.rs b/ableos/src/wasm_jumploader/mod.rs index ba6047aa..ab5a674d 100644 --- a/ableos/src/wasm_jumploader/mod.rs +++ b/ableos/src/wasm_jumploader/mod.rs @@ -114,10 +114,7 @@ pub fn run_program(program: &[u8]) { match instance { Ok(inst) => { - let mut instance = inst.assert_no_start(); - - let abc = instance.globals().capacity(); - + let instance = inst.assert_no_start(); let mut is_driver = false; let _is_program = false; let mut has_driver_entry = false; diff --git a/ext2-rs/src/lib.rs b/ext2-rs/src/lib.rs index 549af9c4..dab5858e 100644 --- a/ext2-rs/src/lib.rs +++ b/ext2-rs/src/lib.rs @@ -3,7 +3,6 @@ #![deny(missing_docs)] #![feature( min_specialization, - const_fn_trait_bound, step_trait, associated_type_defaults )] diff --git a/kernel/src/aalloc/aalloc.rs b/kernel/src/aalloc/aalloc.rs index 84994493..54d55987 100644 --- a/kernel/src/aalloc/aalloc.rs +++ b/kernel/src/aalloc/aalloc.rs @@ -5,11 +5,8 @@ #![allow(missing_docs)] use alloc::alloc::{GlobalAlloc, Layout}; -use core::{ - fmt::Display, - ptr::{self, null_mut}, -}; -use log::{debug, info, trace}; +use core::{fmt::Display, ptr::null_mut}; +use log::{debug, info}; // const HEAP_START: usize = 600_000_000; const HEAP_START: usize = 0x00100000; diff --git a/kernel/src/lib.rs b/kernel/src/lib.rs index b5e28401..9b89327a 100644 --- a/kernel/src/lib.rs +++ b/kernel/src/lib.rs @@ -18,10 +18,7 @@ pub mod proccess; pub mod syscalls; pub mod time; -use core::{ - arch::asm, - sync::atomic::{AtomicU64, Ordering::Relaxed}, -}; +use core::arch::asm; use versioning::Version; /// The number of ticks since the first CPU was started diff --git a/qrcode-rust/src/cast.rs b/qrcode-rust/src/cast.rs index 91634b8a..a4b19547 100644 --- a/qrcode-rust/src/cast.rs +++ b/qrcode-rust/src/cast.rs @@ -36,6 +36,7 @@ impl ExpectOrOverflow for Option { macro_rules! impl_as { ($ty:ty) => { + #[allow(unconditional_recursion)] // idk why #[cfg(debug_assertions)] impl As for $ty { fn as_u16(self) -> u16 { diff --git a/qrcode-rust/src/render/unicode.rs b/qrcode-rust/src/render/unicode.rs index e7bd4bfe..10d80e3e 100644 --- a/qrcode-rust/src/render/unicode.rs +++ b/qrcode-rust/src/render/unicode.rs @@ -1,11 +1,7 @@ //! UTF-8 rendering, with 2 pixels per symbol. -use alloc::{ - string::String, - vec::{self, Vec}, -}; - use crate::render::{Canvas as RenderCanvas, Color, Pixel}; +use alloc::{string::String, vec::Vec}; const CODEPAGE: [&str; 4] = [" ", "\u{2584}", "\u{2580}", "\u{2588}"];