Skip to content

Commit 79183bc

Browse files
committed
fix warnings
1 parent 4d57b77 commit 79183bc

23 files changed

Lines changed: 60 additions & 42 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ default = []
4040
nightly = []
4141
no-atomic-cas = []
4242
multi-core = []
43+
error-msg = []
4344
defmt = ["dep:defmt", "dep:defmt-rtt"]
4445

4546
[build-dependencies]

build.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
use core::panic;
2-
use std::process::Command;
3-
use std::{collections::HashMap, fs, fs::File, path::Path, path::PathBuf};
1+
use std::{collections::HashMap, fs::File, path::Path};
42

53
extern crate rand;
64
extern crate syn;

examples/hello-world/Cargo.toml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,3 @@ osiris = { workspace = true }
1515

1616
[build-dependencies]
1717
cfg_aliases = "0.2.1"
18-
19-
[profile.dev]
20-
panic = "abort"
21-
strip = false
22-
opt-level = 2
23-
24-
[profile.release]
25-
panic = "abort"
26-
opt-level = "z"
27-
codegen-units = 1
28-
lto = true

machine/testing/src/asm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub fn are_interrupts_enabled() -> bool {
3131
}
3232

3333
#[inline(always)]
34-
pub fn enable_irq_restr(state: usize) {}
34+
pub fn enable_irq_restr(_state: usize) {}
3535

3636
#[macro_export]
3737
macro_rules! __macro_startup_trampoline {

macros/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub fn derive_tagged_links(input: proc_macro::TokenStream) -> proc_macro::TokenS
1717

1818
#[proc_macro_attribute]
1919
pub fn fmt(
20-
args: proc_macro::TokenStream,
20+
_args: proc_macro::TokenStream,
2121
input: proc_macro::TokenStream,
2222
) -> proc_macro::TokenStream {
2323
let input = syn::parse_macro_input!(input as syn::DeriveInput);
@@ -31,7 +31,7 @@ pub fn fmt(
3131

3232
#[proc_macro_attribute]
3333
pub fn app_main(
34-
input: proc_macro::TokenStream,
34+
_attr: proc_macro::TokenStream,
3535
item: proc_macro::TokenStream,
3636
) -> proc_macro::TokenStream {
3737
let item = syn::parse_macro_input!(item as syn::ItemFn);

macros/src/logging.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use syn::{DeriveInput, ItemFn};
1+
use syn::DeriveInput;
22

33
pub fn derive_fmt(input: &DeriveInput) -> syn::Result<proc_macro2::TokenStream> {
44
// Check if the env variable "OSIRIS_DEBUG_DEFMT" is set. If it is, generate a defmt::Format implementation. Otherwise, generate a Debug implementation.

src/error.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ macro_rules! bug_on {
5656
}};
5757
}
5858

59+
#[allow(unused_macros)]
5960
macro_rules! warn_on {
6061
($cond:expr) => {{
6162
let cond = $cond;
@@ -91,6 +92,7 @@ macro_rules! kerr {
9192
}
9293

9394
#[proc_macros::fmt]
95+
#[allow(dead_code)]
9496
#[derive(Clone, PartialEq, Eq)]
9597
pub enum Kind {
9698
InvalidAlign,

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pub unsafe extern "C" fn kernel_init() -> ! {
5151
idle::init();
5252
kprintln!("Idle thread initialized.");
5353

54-
let (cyc, ns) = hal::Machine::bench_end();
54+
let (cyc, _ns) = hal::Machine::bench_end();
5555
kprintln!("Kernel init took {} cycles.", cyc);
5656

5757
// Start the init application.

src/mem.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ pub mod alloc;
1111
pub mod pfa;
1212
pub mod vmm;
1313

14+
#[allow(dead_code)]
1415
pub const BITS_PER_PTR: usize = core::mem::size_of::<usize>() * 8;
1516

1617
unsafe extern "C" {

src/mem/pfa.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ trait Allocator<const N: usize> {
3030
fn initializer() -> unsafe fn(PhysAddr, usize) -> Result<Pin<Box<Self>>>;
3131

3232
fn alloc(&mut self, page_count: usize) -> Option<PhysAddr>;
33+
#[allow(dead_code)]
3334
fn free(&mut self, addr: PhysAddr, page_count: usize);
3435
}
3536

@@ -50,6 +51,7 @@ pub fn alloc_page(page_count: usize) -> Option<PhysAddr> {
5051
pfa.as_mut()?.alloc(page_count)
5152
}
5253

54+
#[allow(dead_code)]
5355
pub fn free_page(addr: PhysAddr, page_count: usize) {
5456
let mut pfa = PFA.lock();
5557
if let Some(pfa) = pfa.as_mut() {

0 commit comments

Comments
 (0)