Skip to content

Commit 46f8578

Browse files
authored
Fix --no-default-features (#1360)
Fix --no-default-features Co-authored-by: igor.unanua <igor.unanua@datadoghq.com>
1 parent 8e56742 commit 46f8578

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

libdd-crashtracker/src/bin/crashtracker_receiver.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
fn main() {}
66

77
#[cfg(unix)]
8+
#[cfg(feature = "receiver")]
89
fn main() -> anyhow::Result<()> {
910
libdd_crashtracker::receiver_entry_point_stdin()
1011
}

libdd-crashtracker/src/crash_info/stacktrace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ mod tests {
394394
}
395395

396396
// Tests are disabled on macos because we cannot generate the libs
397-
#[cfg(all(unix, not(target_os = "macos")))]
397+
#[cfg(all(unix, not(target_os = "macos"), feature = "generate-unit-test-files"))]
398398
#[cfg(test)]
399399
mod unix_test {
400400
use super::*;

libdd-crashtracker/src/runtime_callback.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,6 @@ unsafe fn emit_frame_as_json(
326326
#[cfg(all(test, unix))]
327327
mod tests {
328328
use super::*;
329-
use std::ffi::CString;
330329
use std::sync::Mutex;
331330

332331
// So we don't have race conditions with global static variable
@@ -350,10 +349,11 @@ mod tests {
350349
emit_frame(&frame);
351350
}
352351

352+
#[cfg(feature = "collector")]
353353
unsafe extern "C" fn test_emit_stacktrace_string_callback(
354354
emit_stacktrace_string: unsafe extern "C" fn(*const c_char),
355355
) {
356-
let stacktrace_string = CString::new("test_stacktrace_string").unwrap();
356+
let stacktrace_string = std::ffi::CString::new("test_stacktrace_string").unwrap();
357357

358358
emit_stacktrace_string(stacktrace_string.as_ptr());
359359
}
@@ -383,6 +383,7 @@ mod tests {
383383

384384
#[test]
385385
#[cfg_attr(miri, ignore)]
386+
#[cfg(feature = "collector")]
386387
fn test_frame_collection() {
387388
let _guard = TEST_MUTEX.lock().unwrap();
388389
ensure_callback_cleared();
@@ -438,6 +439,7 @@ mod tests {
438439

439440
#[test]
440441
#[cfg_attr(miri, ignore)]
442+
#[cfg(feature = "collector")]
441443
fn test_stacktrace_string_collection() {
442444
let _guard = TEST_MUTEX.lock().unwrap();
443445
ensure_callback_cleared();
@@ -462,6 +464,7 @@ mod tests {
462464
}
463465

464466
#[test]
467+
#[cfg(feature = "collector")]
465468
fn test_no_callback_registered() {
466469
let _guard = TEST_MUTEX.lock().unwrap();
467470
ensure_callback_cleared();
@@ -484,6 +487,7 @@ mod tests {
484487

485488
#[test]
486489
#[cfg_attr(miri, ignore)]
490+
#[cfg(feature = "collector")]
487491
fn test_direct_pipe_writing() {
488492
let _guard = TEST_MUTEX.lock().unwrap();
489493
ensure_callback_cleared();

0 commit comments

Comments
 (0)