hmon: global fixes to HMON#108
Merged
pawelrutkaq merged 1 commit intoeclipse-score:mainfrom Mar 6, 2026
Merged
Conversation
License Check Results🚀 The license check job ran with the Bazel command: bazel run //:license-checkStatus: Click to expand output |
There was a problem hiding this comment.
Pull request overview
This PR fixes two correctness issues in the health monitoring library's FFI layer:
#[no_mangle]→#[unsafe(no_mangle)]: Since Rust 1.82,no_manglemust be wrapped inunsafe(...)to acknowledge that exporting an unmangled symbol is an unsafe operation. All 15 occurrences across both FFI files are updated.__drop_by_rust_impl→_drop_by_rust_impl: Names beginning with two underscores are reserved at all scopes in C++, causing undefined behavior. The rename uses a single leading underscore inside class scope, which is valid.
Changes:
- All
#[no_mangle]attributes in the Rust FFI layer updated to#[unsafe(no_mangle)]. - Double-underscore C++ method name
__drop_by_rust_implrenamed to_drop_by_rust_implin both the declaration and the call site.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/health_monitoring_lib/rust/ffi.rs |
Updated 7 #[no_mangle] → #[unsafe(no_mangle)] on all exported C FFI functions |
src/health_monitoring_lib/rust/deadline/ffi.rs |
Updated 8 #[no_mangle] → #[unsafe(no_mangle)] on all exported C FFI functions |
src/health_monitoring_lib/cpp/include/score/hm/deadline/deadline_monitor.h |
Renamed method __drop_by_rust_impl → _drop_by_rust_impl in DeadlineMonitorBuilder |
src/health_monitoring_lib/cpp/include/score/hm/common.h |
Updated the CRTP call site __drop_by_rust_impl() → _drop_by_rust_impl() in RustDroppable |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|
The created documentation from the pull request is available at: docu-html |
- Rename `__drop_by_rust_impl` to `_drop_by_rust_impl`. - Double underscore is reserved in C++. - Rename `#[no_mangle]` to `#[unsafe(no_mangle)]`. - Add const constructors for tags.
b2f276d to
6c3ed43
Compare
pawelrutkaq
approved these changes
Mar 6, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
__drop_by_rust_implto_drop_by_rust_impl.#[no_mangle]to#[unsafe(no_mangle)].