Skip to content

Commit 4b26b65

Browse files
committed
Fix more tests
1 parent fd5ac23 commit 4b26b65

File tree

17 files changed

+48
-21
lines changed

17 files changed

+48
-21
lines changed

c2rust-transpile/src/rust_ast/set_span.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ impl SetSpan for Expr {
140140
RangeLimits::Closed(mut r) => r.spans[0] = s,
141141
RangeLimits::HalfOpen(mut r) => r.spans[0] = s,
142142
},
143+
Expr::RawAddr(e) => e.and_token.span = s,
143144
Expr::Reference(e) => e.and_token.span = s,
144145
Expr::Return(e) => e.return_token.span = s,
145146
Expr::Try(e) => e.question_token.span = s,

tests/arrays/src/test_arrays.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! feature_raw_ref_op
2+
13
use crate::arrays::rust_entry;
24
use crate::incomplete_arrays::{rust_check_some_ints, rust_entry2, rust_test_sized_array};
35
use crate::variable_arrays::{rust_alloca_arrays, rust_variable_arrays};

tests/builtins/src/test_builtins.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! feature_core_intrinsics
1+
//! feature_core_intrinsics, feature_raw_ref_op
22
33
use crate::atomics::{rust_atomics_entry, rust_new_atomics};
44
use crate::math::{rust_ffs, rust_ffsl, rust_ffsll, rust_isfinite, rust_isinf_sign, rust_isnan};

tests/casts/src/test_casts.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! feature_raw_ref_op
2+
13
use crate::cast_funptr::{rust_entry, rust_get_identity, rust_identity};
24
use crate::casts::rust_cast_stuff;
35

tests/conditionals/src/test_conditionals.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
//! feature_raw_ref_op
2+
13
use crate::binary_conditional::rust_entry3;
24
use crate::conditional::rust_entry;
35
use crate::conditionals::{rust_entry2, rust_ternaries};
6+
use crate::else_if_chain::rust_entry4;
47
use crate::unused_conditionals::{
58
rust_unused_conditional1, rust_unused_conditional2, rust_unused_conditional3,
69
};
7-
use crate::else_if_chain::rust_entry4;
810
use std::ffi::{c_int, c_uint};
911

1012
#[link(name = "test")]
@@ -14,7 +16,7 @@ extern "C" {
1416
fn entry2(_: c_uint, _: *mut c_int);
1517

1618
fn entry3(_: c_uint, _: *mut c_int);
17-
19+
1820
fn entry4(_: c_int) -> c_int;
1921

2022
fn unused_conditional1() -> c_int;
@@ -83,11 +85,11 @@ pub fn test_unused_conditional() {
8385
}
8486

8587
#[test]
86-
pub fn test_else_if_chain(){
88+
pub fn test_else_if_chain() {
8789
unsafe {
88-
assert_eq!(entry4(0) , rust_entry4(0));
89-
assert_eq!(entry4(10) , rust_entry4(10));
90-
assert_eq!(entry4(20) , rust_entry4(20));
91-
assert_eq!(entry4(30) , rust_entry4(30));
90+
assert_eq!(entry4(0), rust_entry4(0));
91+
assert_eq!(entry4(10), rust_entry4(10));
92+
assert_eq!(entry4(20), rust_entry4(20));
93+
assert_eq!(entry4(30), rust_entry4(30));
9294
}
9395
}

tests/ints/src/test_arithmetic.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! feature_raw_ref_op
2+
13
use crate::arithmetic::rust_entry2;
24
use std::ffi::{c_int, c_uint};
35

tests/items/src/test_varargs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! feature_c_variadic,
1+
//! feature_c_variadic, feature_raw_ref_op
22
33
use crate::varargs::rust_call_printf;
44
// See #1281. Varargs don't yet work on aarch64.

tests/macros/src/test_define.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! feature_raw_ref_op
2+
13
use crate::define::{rust_fns, rust_stmt_expr_inc};
24
use crate::define::{rust_reference_define, TEST_CONST1, TEST_CONST2, TEST_PARENS};
35
use crate::define::{rust_test_zstd, ZSTD_WINDOWLOG_MAX_32, ZSTD_WINDOWLOG_MAX_64};

tests/misc/src/test_exprs.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! feature_raw_ref_op
2+
13
use crate::exprs::rust_exprs;
24
use std::ffi::{c_int, c_uint};
35

tests/misc/src/test_quicksort.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! feature_raw_ref_op
2+
13
use crate::qsort::{rust_partition, rust_quickSort, rust_swap};
24
use std::ffi::c_int;
35

0 commit comments

Comments
 (0)