diff --git a/nac3artiq/src/lib.rs b/nac3artiq/src/lib.rs index 553264d83..b49a88e86 100644 --- a/nac3artiq/src/lib.rs +++ b/nac3artiq/src/lib.rs @@ -1,10 +1,4 @@ -#![deny( - future_incompatible, - let_underscore, - nonstandard_style, - clippy::all -)] -#![warn(rust_2024_compatibility)] +#![deny(future_incompatible, let_underscore, nonstandard_style, clippy::all)] #![warn(clippy::pedantic)] #![allow( unsafe_op_in_unsafe_fn, @@ -741,7 +735,7 @@ impl Nac3 { }; let return_obj = - generator.gen_expr(ctx, &expr)?.map(|value| (expr.custom.unwrap(), value)); + generator.gen_expr(ctx, expr)?.map(|value| (expr.custom.unwrap(), value)); has_return = return_obj.is_some(); registry.wait_tasks_complete(handles); attributes_writeback( @@ -765,7 +759,7 @@ impl Nac3 { let buffers = membuffers.lock(); let main = context .create_module_from_ir(MemoryBuffer::create_from_memory_range( - &buffers.last().unwrap(), + buffers.last().unwrap(), "main", )) .unwrap(); diff --git a/nac3ast/src/lib.rs b/nac3ast/src/lib.rs index e31394602..769191582 100644 --- a/nac3ast/src/lib.rs +++ b/nac3ast/src/lib.rs @@ -1,10 +1,4 @@ -#![deny( - future_incompatible, - let_underscore, - nonstandard_style, - clippy::all -)] -#![warn(rust_2024_compatibility)] +#![deny(future_incompatible, let_underscore, nonstandard_style, clippy::all)] #![warn(clippy::pedantic)] #![allow( clippy::missing_errors_doc, diff --git a/nac3core/build.rs b/nac3core/build.rs index 8a5c56fee..c2059a2d7 100644 --- a/nac3core/build.rs +++ b/nac3core/build.rs @@ -56,9 +56,8 @@ fn main() { let output = Command::new("clang-irrt") .args(flags) .output() - .map(|o| { + .inspect(|o| { assert!(o.status.success(), "{}", std::str::from_utf8(&o.stderr).unwrap()); - o }) .unwrap(); diff --git a/nac3core/src/lib.rs b/nac3core/src/lib.rs index c2faade9f..91ae05a48 100644 --- a/nac3core/src/lib.rs +++ b/nac3core/src/lib.rs @@ -1,10 +1,4 @@ -#![deny( - future_incompatible, - let_underscore, - nonstandard_style, - clippy::all -)] -#![warn(rust_2024_compatibility)] +#![deny(future_incompatible, let_underscore, nonstandard_style, clippy::all)] #![warn(clippy::pedantic)] #![allow( dead_code, diff --git a/nac3core/src/typecheck/type_inferencer/mod.rs b/nac3core/src/typecheck/type_inferencer/mod.rs index e5a6cf892..6068f6304 100644 --- a/nac3core/src/typecheck/type_inferencer/mod.rs +++ b/nac3core/src/typecheck/type_inferencer/mod.rs @@ -536,9 +536,8 @@ impl<'a> Fold<()> for Inferencer<'a> { } ast::StmtKind::Assert { test, msg, .. } => { self.unify(test.custom.unwrap(), self.primitives.bool, &test.location)?; - match msg { - Some(m) => self.unify(m.custom.unwrap(), self.primitives.str, &m.location)?, - None => (), + if let Some(m) = msg { + self.unify(m.custom.unwrap(), self.primitives.str, &m.location)?; } } _ => return report_error("Unsupported statement type", stmt.location), diff --git a/nac3ld/src/lib.rs b/nac3ld/src/lib.rs index 4d5a51f0a..73e065dd5 100644 --- a/nac3ld/src/lib.rs +++ b/nac3ld/src/lib.rs @@ -1,10 +1,4 @@ -#![deny( - future_incompatible, - let_underscore, - nonstandard_style, - clippy::all -)] -#![warn(rust_2024_compatibility)] +#![deny(future_incompatible, let_underscore, nonstandard_style, clippy::all)] #![warn(clippy::pedantic)] #![allow( clippy::cast_possible_truncation, diff --git a/nac3parser/src/lib.rs b/nac3parser/src/lib.rs index 6f3fcaa42..7aa6e82d3 100644 --- a/nac3parser/src/lib.rs +++ b/nac3parser/src/lib.rs @@ -15,13 +15,7 @@ //! //! ``` -#![deny( - future_incompatible, - let_underscore, - nonstandard_style, - clippy::all -)] -#![warn(rust_2024_compatibility)] +#![deny(future_incompatible, let_underscore, nonstandard_style, clippy::all)] #![warn(clippy::pedantic)] #![allow( clippy::enum_glob_use, diff --git a/nac3standalone/src/main.rs b/nac3standalone/src/main.rs index 698ff9cde..2fce5d16a 100644 --- a/nac3standalone/src/main.rs +++ b/nac3standalone/src/main.rs @@ -1,10 +1,4 @@ -#![deny( - future_incompatible, - let_underscore, - nonstandard_style, - clippy::all -)] -#![warn(rust_2024_compatibility)] +#![deny(future_incompatible, let_underscore, nonstandard_style, clippy::all)] #![warn(clippy::pedantic)] #![allow(clippy::too_many_lines, clippy::wildcard_imports)] diff --git a/runkernel/src/main.rs b/runkernel/src/main.rs index fa99f6933..971f3a735 100644 --- a/runkernel/src/main.rs +++ b/runkernel/src/main.rs @@ -1,10 +1,4 @@ -#![deny( - future_incompatible, - let_underscore, - nonstandard_style, - clippy::all -)] -#![warn(rust_2024_compatibility)] +#![deny(future_incompatible, let_underscore, nonstandard_style, clippy::all)] #![warn(clippy::pedantic)] #![allow(clippy::semicolon_if_nothing_returned, clippy::uninlined_format_args)] @@ -12,47 +6,47 @@ use std::env; static mut NOW: i64 = 0; -#[no_mangle] +#[unsafe(no_mangle)] pub extern "C" fn now_mu() -> i64 { unsafe { NOW } } -#[no_mangle] +#[unsafe(no_mangle)] pub extern "C" fn at_mu(t: i64) { unsafe { NOW = t } } -#[no_mangle] +#[unsafe(no_mangle)] pub extern "C" fn delay_mu(dt: i64) { unsafe { NOW += dt } } -#[no_mangle] +#[unsafe(no_mangle)] pub extern "C" fn rtio_init() { println!("rtio_init"); } -#[no_mangle] +#[unsafe(no_mangle)] pub extern "C" fn rtio_get_counter() -> i64 { 0 } -#[no_mangle] +#[unsafe(no_mangle)] pub extern "C" fn rtio_output(target: i32, data: i32) { println!("rtio_output @{} target={target:04x} data={data}", unsafe { NOW }); } -#[no_mangle] +#[unsafe(no_mangle)] pub extern "C" fn print_int32(x: i32) { println!("print_int32: {x}"); } -#[no_mangle] +#[unsafe(no_mangle)] pub extern "C" fn print_int64(x: i64) { println!("print_int64: {x}"); } -#[no_mangle] +#[unsafe(no_mangle)] pub extern "C" fn __nac3_personality(_state: u32, _exception_object: u32, _context: u32) -> u32 { unimplemented!(); }