Skip to content

Commit c4743bd

Browse files
committed
Move to the 2024 edition
1 parent c2d7ac4 commit c4743bd

File tree

8 files changed

+13
-13
lines changed

8 files changed

+13
-13
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "rustc_codegen_cranelift"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition = "2024"
55

66
[lib]
77
crate-type = ["dylib"]

src/abi/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ pub(crate) fn codegen_fn_prelude<'tcx>(fx: &mut FunctionCx<'_, '_, 'tcx>, start_
268268
// individual function arguments.
269269

270270
let tupled_arg_tys = match arg_ty.kind() {
271-
ty::Tuple(ref tys) => tys,
271+
ty::Tuple(tys) => tys,
272272
_ => bug!("spread argument isn't a tuple?! but {:?}", arg_ty),
273273
};
274274

@@ -491,7 +491,7 @@ pub(crate) fn codegen_terminator_call<'tcx>(
491491
};
492492

493493
let tupled_arguments = match pack_arg.value.layout().ty.kind() {
494-
ty::Tuple(ref tupled_arguments) => tupled_arguments,
494+
ty::Tuple(tupled_arguments) => tupled_arguments,
495495
_ => bug!("argument to function with \"rust-call\" ABI is not a tuple"),
496496
};
497497

src/base.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
382382
fx.bcx.ins().nop();
383383

384384
match &**msg {
385-
AssertKind::BoundsCheck { ref len, ref index } => {
385+
AssertKind::BoundsCheck { len, index } => {
386386
let len = codegen_operand(fx, len).load_scalar(fx);
387387
let index = codegen_operand(fx, index).load_scalar(fx);
388388
let location = fx.get_caller_location(source_info).load_scalar(fx);
@@ -395,7 +395,7 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
395395
source_info.span,
396396
);
397397
}
398-
AssertKind::MisalignedPointerDereference { ref required, ref found } => {
398+
AssertKind::MisalignedPointerDereference { required, found } => {
399399
let required = codegen_operand(fx, required).load_scalar(fx);
400400
let found = codegen_operand(fx, found).load_scalar(fx);
401401
let location = fx.get_caller_location(source_info).load_scalar(fx);
@@ -977,7 +977,7 @@ fn codegen_stmt<'tcx>(fx: &mut FunctionCx<'_, '_, 'tcx>, cur_block: Block, stmt:
977977
| StatementKind::AscribeUserType(..) => {}
978978

979979
StatementKind::Coverage { .. } => unreachable!(),
980-
StatementKind::Intrinsic(ref intrinsic) => match &**intrinsic {
980+
StatementKind::Intrinsic(intrinsic) => match &**intrinsic {
981981
// We ignore `assume` intrinsics, they are only useful for optimizations
982982
NonDivergingIntrinsic::Assume(_) => {}
983983
NonDivergingIntrinsic::CopyNonOverlapping(mir::CopyNonOverlapping {

src/compiler_builtins.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ macro_rules! builtin_functions {
1818
) => {
1919
#[cfg(feature = "jit")]
2020
#[allow(improper_ctypes)]
21-
extern "C" {
21+
unsafe extern "C" {
2222
$(
2323
$(#[$attr])?
2424
fn $name($($arg_name: $arg_ty),*) -> $ret_ty;

src/constant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ pub(crate) fn mir_operand_get_const_val<'tcx>(
576576
{
577577
return None;
578578
}
579-
StatementKind::Intrinsic(ref intrinsic) => match **intrinsic {
579+
StatementKind::Intrinsic(intrinsic) => match **intrinsic {
580580
NonDivergingIntrinsic::CopyNonOverlapping(..) => return None,
581581
NonDivergingIntrinsic::Assume(..) => {}
582582
},

src/debuginfo/emit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ impl WriterRelocate {
9696
if jit_module.declarations().get_function_decl(func_id).name.as_deref()
9797
== Some("rust_eh_personality")
9898
{
99-
extern "C" {
99+
unsafe extern "C" {
100100
fn rust_eh_personality() -> !;
101101
}
102102
rust_eh_personality as *const u8

src/debuginfo/unwind.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ impl UnwindContext {
279279
// Everything after this line up to the end of the file is loosely based on
280280
// https://github.com/bytecodealliance/wasmtime/blob/4471a82b0c540ff48960eca6757ccce5b1b5c3e4/crates/jit/src/unwind/systemv.rs
281281
#[cfg(target_os = "macos")]
282-
{
282+
unsafe {
283283
// On macOS, `__register_frame` takes a pointer to a single FDE
284284
let start = eh_frame.as_ptr();
285285
let end = start.add(eh_frame.len());
@@ -301,12 +301,12 @@ impl UnwindContext {
301301
#[cfg(not(target_os = "macos"))]
302302
{
303303
// On other platforms, `__register_frame` will walk the FDEs until an entry of length 0
304-
__register_frame(eh_frame.as_ptr());
304+
unsafe { __register_frame(eh_frame.as_ptr()) };
305305
}
306306
}
307307
}
308308

309-
extern "C" {
309+
unsafe extern "C" {
310310
// libunwind import
311311
fn __register_frame(fde: *const u8);
312312
}

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ fn build_isa(sess: &Session, jit: bool) -> Arc<dyn TargetIsa + 'static> {
382382
}
383383

384384
/// This is the entrypoint for a hot plugged rustc_codegen_cranelift
385-
#[no_mangle]
385+
#[unsafe(no_mangle)]
386386
pub fn __rustc_codegen_backend() -> Box<dyn CodegenBackend> {
387387
Box::new(CraneliftCodegenBackend { config: None })
388388
}

0 commit comments

Comments
 (0)