-
Notifications
You must be signed in to change notification settings - Fork 247
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
40 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
//! derive:Debug | ||
|
||
#include <stdarg.h> | ||
|
||
typedef struct { | ||
int a; | ||
} Debuggable1; | ||
|
||
typedef struct { | ||
va_list v; | ||
} Debuggable2; | ||
|
||
Debuggable1 *kDebuggable1; | ||
Debuggable2 *kDebuggable2; | ||
|
||
// A struct containing a union cannot derive Debug, so make | ||
// sure we don't generate a #[derive] for it | ||
typedef struct { | ||
struct { | ||
struct { | ||
union { | ||
int d; | ||
float e; | ||
} c; | ||
} b; | ||
} a; | ||
} NotDebuggable1; | ||
|
||
NotDebuggable1 kNotDebuggable1; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//! feature_c_variadic | ||
use crate::debug_derive::{rust_kDebuggable1, rust_kDebuggable2}; | ||
use std::fmt::Debug; | ||
|
||
pub fn test_debuggable() { | ||
unsafe { | ||
// Make sure all debuggable structs implement `Debug` | ||
let _debuggable: Vec<*mut dyn Debug> = vec![rust_kDebuggable1, rust_kDebuggable2]; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.