diff --git a/tests/structs/src/debug_derive_bad.c b/tests/structs/src/debug_derive_bad.c index 32858b6294..65ea83ad67 100644 --- a/tests/structs/src/debug_derive_bad.c +++ b/tests/structs/src/debug_derive_bad.c @@ -10,6 +10,6 @@ typedef struct { } c; } b; } a; -} S2; +} StructWithUnion; -S2 kS2; \ No newline at end of file +StructWithUnion kStructWithUnion; \ No newline at end of file diff --git a/tests/structs/src/debug_derive_good.c b/tests/structs/src/debug_derive_good.c index f240e2130a..8c9bbb48a1 100644 --- a/tests/structs/src/debug_derive_good.c +++ b/tests/structs/src/debug_derive_good.c @@ -6,13 +6,9 @@ typedef struct { int a; } S1; -S1 kS1; - typedef struct { va_list v; -} S3; +} S2; -S3 get_struct_containing_va_list() { - S3 s; - return s; -} \ No newline at end of file +S1 *kS1; +S2 *kS2; diff --git a/tests/structs/src/test_debug_derive_bad.rs b/tests/structs/src/test_debug_derive_bad.rs index 8dbc19be66..bb09029fab 100644 --- a/tests/structs/src/test_debug_derive_bad.rs +++ b/tests/structs/src/test_debug_derive_bad.rs @@ -1,10 +1,10 @@ //! xfail mod debug_derive_bad; -use debug_derive_bad::rust_kS2; +use debug_derive_bad::rust_kStructWithUnion; pub fn test_union() { unsafe { - format!("{rust_kS2:?}"); + format!("{rust_kStructWithUnion:?}"); } } diff --git a/tests/structs/src/test_debug_derive_good.rs b/tests/structs/src/test_debug_derive_good.rs index baefcb6783..cdf558d69c 100644 --- a/tests/structs/src/test_debug_derive_good.rs +++ b/tests/structs/src/test_debug_derive_good.rs @@ -1,16 +1,11 @@ -//! feature_c_variadic, +//! feature_c_variadic -use crate::debug_derive_good::{rust_kS1, rust_get_struct_containing_va_list}; +use crate::debug_derive_good::{rust_kS1, rust_kS2}; +use std::fmt::Debug; -pub fn test_simple_struct() { +pub fn test_debuggable() { unsafe { - format!("{rust_kS1:?}"); + // Make sure each struct implements `Debug` + let _debuggable: Vec<*mut dyn Debug> = vec![rust_kS1, rust_kS2]; } } - -pub fn test_struct_containing_va_list() { - unsafe { - let s = rust_get_struct_containing_va_list(); - format!("{s:?}"); - } -} \ No newline at end of file