From a9f1bc447045c9368b557448d68d3cd9a8b0adcc Mon Sep 17 00:00:00 2001 From: Agent Smith Date: Thu, 19 Dec 2024 18:30:31 +0800 Subject: [PATCH] chore: make clippy happy --- immix | 2 +- src/ast/ctx/cast.rs | 4 +--- vm/src/lib.rs | 6 ++---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/immix b/immix index e8ee732b..6eec34aa 160000 --- a/immix +++ b/immix @@ -1 +1 @@ -Subproject commit e8ee732bdfaeba9b122245573937fb27ab09f692 +Subproject commit 6eec34aac99630aaf539641151cf724958614860 diff --git a/src/ast/ctx/cast.rs b/src/ast/ctx/cast.rs index 35e72991..cbfecdd4 100644 --- a/src/ast/ctx/cast.rs +++ b/src/ast/ctx/cast.rs @@ -288,9 +288,7 @@ impl<'a, 'ctx> Ctx<'a> { if let PLType::Union(u) = &*target_pltype.borrow() { let mut union_members = vec![]; for tp in &u.sum_types { - let tp = self.run_in_type_mod(u, |ctx,u|{ - tp.get_type(ctx, builder, true) - })?; + let tp = self.run_in_type_mod(u, |ctx, _| tp.get_type(ctx, builder, true))?; union_members.push(tp); } for (i, tp) in union_members.iter().enumerate() { diff --git a/vm/src/lib.rs b/vm/src/lib.rs index 54ae1758..9825d180 100644 --- a/vm/src/lib.rs +++ b/vm/src/lib.rs @@ -91,21 +91,19 @@ fn vm_ftoa(f: f32, rec: *mut u8) { } #[is_runtime] -fn new_thread(f: *mut i128, sp:*mut u8) { +fn new_thread(f: *mut i128, sp: *mut u8) { // f's first 8 byte is fn pointer, next 8 byte is data pointer let ptr = f as *const i64; let f_ptr = ptr as *const extern "C" fn(i64); let data_ptr = unsafe { *ptr.offset(1) }; let func = unsafe { *f_ptr }; let (s, r) = channel::<()>(); - let ptr_i = ptr as i64; + // let ptr_i = ptr as i64; immix::pin(data_ptr as _); // immix::gc_keep_live(data_ptr as _); // immix::gc_add_root(data_ptr as *mut _, ObjectType::Pointer.int_value()); let c = move || { // thread::sleep(std::time::Duration::from_secs(1)); - let sp = immix::Collector::current_sp(); - immix::set_high_sp(sp); // immix::gc_keep_live(data_ptr as _); // immix::set_evacuation(false); // immix::gc_add_root(&mut f as *mut _ as *mut _, ObjectType::Trait.int_value());