style(prof): fix tons of clippy lints#3235
style(prof): fix tons of clippy lints#3235realFlowControl merged 3 commits intoflorian/zts-global-statefrom
Conversation
Also improve documentation in some places.
Benchmarks [ profiler ]Benchmark execution time: 2025-05-07 15:52:19 Comparing candidate commit bf02b95 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 29 metrics, 7 unstable metrics. |
| // todo: this should be feature = "stack_walking_tests" but it seemed to | ||
| // cause a failure in CI to migrate it. | ||
| #[cfg(all(test, stack_walking_tests))] | ||
| mod tests { |
There was a problem hiding this comment.
Example of the error (job):
= note: /mnt/ramdisk/cargo/release/deps/datadog_php_profiling-a15e7ad77c649749.datadog_php_profiling.b94f957b4ddf90d7-cgu.0.rcgu.o: In function `{closure#0}':
/home/circleci/datadog/profiling/src/profiling/stack_walking.rs:263: undefined reference to `zend_flf_functions'
collect2: error: ld returned 1 exit status
= note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
= note: use the `-l` flag to specify native libraries to link
= note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib)
error: could not compile `datadog-php-profiling` (lib test) due to 1 previous error
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## florian/zts-global-state #3235 +/- ##
==============================================================
+ Coverage 79.26% 79.28% +0.01%
Complexity 2948 2948
==============================================================
Files 118 118
Lines 11633 11633
==============================================================
+ Hits 9221 9223 +2
+ Misses 2412 2410 -2
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Co-authored-by: Florian Engelhardt <[email protected]>
afe5209
into
florian/zts-global-state
Description
Many clippy lints have accumulated. This fixes all of the lints on PHP 8.3/8.4 and on Rust 1.78. It also fixes many lints from Rust 1.86 and nightly. Here are some of the things fixed:
c""and converting some engine members from*const u8to*const c_char.core::ptr::eqfor certain pointer comparisons.And some non-clippy items:
/*style comments to//, which is by far more popular.Safety:comments toSAFETY:, which is mostly what we use everywhere else.There were historical reasons for not running clippy in CI. Over time think these have all been fixed, helped by advances in Rust. We should enable clippy soon for profiling. On the versions listed, the only lints on current nightly are unpredictable function pointer comparisons. I'm not sure what to do here, other than maybe allow them. But since this is nightly, it may not land in its current state anyway, so I'm not going to sweat it.
Reviewer checklist