Skip to content

Conversation

@nickpdemarco
Copy link
Contributor

@nickpdemarco nickpdemarco commented Aug 14, 2025

Currently, it does not seem possible to read the underling value of zngur fields in C++. This PR adds support for converting a Field<T> to a T, and adds corresponding docs and tests.

@nickpdemarco
Copy link
Contributor Author

@HKalbasi it seems Rust 1.91 has started printing thread IDs on panics, which is breaking our diff-based example testing. Any suggestions on how to proceed? I don't see an obvious way to turn off that panic behavior.

@nickpdemarco
Copy link
Contributor Author

Seems we may need #50 before merging this.

@HKalbasi
Copy link
Owner

@HKalbasi it seems Rust 1.91 has started printing thread IDs on panics, which is breaking our diff-based example testing. Any suggestions on how to proceed? I don't see an obvious way to turn off that panic behavior.

Ah, this is rust-lang/rust#115746 . Let's use the stable compiler instead of nightly for now, and hope that they will make an option to disable this behavior before this hits stable. I like to avoid regex if possible, since it will break the ability of auto-fixing the tests.

@nickpdemarco
Copy link
Contributor Author

@HKalbasi I'm trying to figure out why clang++ is not finding ld despite binutils being installed by default on our GH runner. Let me know if you've seen this before or have suggestions.

@HKalbasi
Copy link
Owner

IIRC examples enable lto with clang and use lld. Might be related.

@nickpdemarco
Copy link
Contributor Author

Well, I'm not sure why this PR broke it, but setting CC explicitly and installing lld seemed to do the trick.

These wrappers now act as their underlying type `T` in many contexts:

- `Ref<T>` construction from any `Field*<T, OFFSET>`
- Implicit read via `operator T()` and `.read()` for value-like access
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This .read() is leftover.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good catch! Thanks.

@HKalbasi HKalbasi requested a review from Copilot August 19, 2025 07:39

This comment was marked as spam.

@HKalbasi HKalbasi merged commit 5d7a87c into HKalbasi:main Aug 19, 2025
3 checks passed
@nickpdemarco nickpdemarco deleted the nickpdemarco/fields branch August 19, 2025 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants