From 37c05b3c63c4e7165bdfc797f2294598152cc4f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Kostrubiec?= Date: Tue, 17 Dec 2024 20:44:30 +0100 Subject: [PATCH] Updated rustc version + misc bugfixes --- src/basic_block.rs | 2 +- src/lib.rs | 5 ++--- src/rvalue.rs | 2 +- src/terminator/mod.rs | 2 +- test/arthm/num_test.rs | 1 + test/common.rs | 3 +++ 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/basic_block.rs b/src/basic_block.rs index a26bf1db..51f03fd3 100644 --- a/src/basic_block.rs +++ b/src/basic_block.rs @@ -55,7 +55,7 @@ fn simplify_handler<'tcx>( } => { let ty = crate::utilis::monomorphize(method_instance, place.ty(method, tcx).ty, tcx); - let drop_instance = Instance::resolve_drop_in_place(tcx, ty).polymorphize(tcx); + let drop_instance = Instance::resolve_drop_in_place(tcx, ty); if let InstanceKind::DropGlue(_, None) = drop_instance.def { //Empty drop, nothing needs to happen. simplify_handler(Some(target.as_u32()), blocks, tcx, method_instance, method) diff --git a/src/lib.rs b/src/lib.rs index c6e41b83..83ae6986 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -305,12 +305,11 @@ impl CodegenBackend for MyBackend { sess: &Session, codegen_results: CodegenResults, outputs: &OutputFilenames, - ) -> Result<(), ErrorGuaranteed> { + ) { use rustc_codegen_ssa::back::link::link_binary; //panic!(); link_binary(sess, &RlibArchiveBuilder, codegen_results, outputs) - .expect("Could not link the binary into a .rlib file!"); - Ok(()) + } } // Inspired by cranelifts glue code. Is responsible for turing the files produced by teh backend into diff --git a/src/rvalue.rs b/src/rvalue.rs index a21a4489..3728c394 100644 --- a/src/rvalue.rs +++ b/src/rvalue.rs @@ -136,7 +136,7 @@ pub fn handle_rvalue<'tcx>( args, rustc_middle::ty::ClosureKind::FnOnce, ) - .polymorphize(ctx.tcx()); + ; let call_info = CallInfo::sig_from_instance_(instance, ctx); let function_name = crate::utilis::function_name(ctx.tcx().symbol_name(instance)); diff --git a/src/terminator/mod.rs b/src/terminator/mod.rs index e9023883..3947f30d 100644 --- a/src/terminator/mod.rs +++ b/src/terminator/mod.rs @@ -154,7 +154,7 @@ pub fn handle_terminator<'tcx>( let ty = ctx.monomorphize(place.ty(ctx.body(), ctx.tcx()).ty); let drop_instance = - Instance::resolve_drop_in_place(ctx.tcx(), ty).polymorphize(ctx.tcx()); + Instance::resolve_drop_in_place(ctx.tcx(), ty); if let InstanceKind::DropGlue(_, None) = drop_instance.def { //Empty drop, nothing needs to happen. vec![CILRoot::GoTo { diff --git a/test/arthm/num_test.rs b/test/arthm/num_test.rs index 132499d7..a7848d0d 100644 --- a/test/arthm/num_test.rs +++ b/test/arthm/num_test.rs @@ -26,6 +26,7 @@ fn check_float_nan() { test_eq!((-9.0_f32).max(f32::NAN), -9.0); //test_eq!((-9.0_f64).max(f64::NAN), -9.0); } +#[allow(unpredictable_function_pointer_comparisons)] pub fn test_variadic_fnptr() { extern "C" { // This needs to use the correct function signature even though it isn't called as some diff --git a/test/common.rs b/test/common.rs index 015e835f..5c37c229 100644 --- a/test/common.rs +++ b/test/common.rs @@ -42,6 +42,7 @@ macro_rules! test { (), u32, >(line!()); + #[allow(unused_unsafe)] unsafe { core::intrinsics::breakpoint() }; core::intrinsics::abort(); } @@ -65,6 +66,7 @@ macro_rules! test_eq { (), u32, >(line!()); + #[allow(unused_unsafe)] unsafe { core::intrinsics::breakpoint() }; core::intrinsics::abort(); } @@ -86,6 +88,7 @@ macro_rules! test_ne { (), u32, >(line!()); + #[allow(unused_unsafe)] unsafe { core::intrinsics::breakpoint() }; core::intrinsics::abort(); }