Skip to content

Commit 6043bee

Browse files
committed
tests/unit: update most tests to edition 2024
1 parent 5d9c36b commit 6043bee

41 files changed

Lines changed: 44 additions & 45 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tests/unit/README.md

Lines changed: 1 addition & 1 deletion

tests/unit/arrays/Cargo.toml

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

66
[dependencies]
77
libc = "0.2"

tests/unit/arrays/src/test_arrays.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::variable_arrays::{rust_alloca_arrays, rust_variable_arrays};
66
use std::ffi::{c_int, c_uint};
77

88
#[link(name = "test")]
9-
extern "C" {
9+
unsafe extern "C" {
1010
fn entry(_: c_uint, _: *mut c_int);
1111

1212
fn entry2(_: c_uint, _: *mut c_int);
@@ -20,9 +20,10 @@ extern "C" {
2020
fn check_some_ints() -> bool;
2121
}
2222

23-
#[no_mangle]
23+
#[unsafe(no_mangle)]
2424
pub static SOME_INTS: [u32; 4] = [2, 0, 1, 8];
25-
#[no_mangle]
25+
26+
#[unsafe(no_mangle)]
2627
pub static rust_SOME_INTS: [u32; 4] = [2, 0, 1, 8];
2728

2829
const BUFFER_SIZE: usize = 49;

tests/unit/asm.aarch64/Cargo.toml

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

66
[dependencies]
77
c2rust-asm-casts = { path = "../../../c2rust-asm-casts", version = "0.22.1" }

tests/unit/asm.aarch64/src/test_asm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::asm::rust_entry;
44
use std::ffi::{c_int, c_uint};
55

66
#[link(name = "test")]
7-
extern "C" {
7+
unsafe extern "C" {
88
fn entry(_: c_uint, _: *mut c_int);
99
}
1010

tests/unit/asm.arm/Cargo.toml

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

66
[dependencies]

tests/unit/asm.arm/src/test_asm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::asm::rust_entry;
22
use std::ffi::{c_int, c_uint};
33

44
#[link(name = "test")]
5-
extern "C" {
5+
unsafe extern "C" {
66
fn entry(_: c_uint, _: *mut c_int);
77
}
88

tests/unit/asm.x86_64/Cargo.toml

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

66
[dependencies]
77
c2rust-asm-casts = { path = "../../../c2rust-asm-casts", version = "0.22.1" }

tests/unit/asm.x86_64/src/test_asm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::asm::rust_entry;
44
use std::ffi::{c_int, c_uint};
55

66
#[link(name = "test")]
7-
extern "C" {
7+
unsafe extern "C" {
88
fn entry(_: c_uint, _: *mut c_int);
99
}
1010

tests/unit/casts/Cargo.toml

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

66
[dependencies]
77
libc = "0.2"

0 commit comments

Comments
 (0)