Skip to content

🧹 Remove dead_code allow from Rust layout probes - #329

Open
undivisible wants to merge 1 commit into
masterfrom
health/remove-dead-code-allow-probes-15037892467529915069
Open

🧹 Remove dead_code allow from Rust layout probes#329
undivisible wants to merge 1 commit into
masterfrom
health/remove-dead-code-allow-probes-15037892467529915069

Conversation

@undivisible

@undivisible undivisible commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

🎯 What: Removed the #![allow(dead_code)] attribute from the generated Rust layout probes in in-cli/src/boundary_emit/probes.rs and replaced it with making the generated structs and their fields pub.

💡 Why: Using #![allow(dead_code)] in generated files can obscure actual unused code. By making the types pub, we inform the Rust compiler that these types are part of a public API interface, which properly suppresses dead_code warnings for types that are only instantiated or used for size and alignment checks, without broadly disabling the lint.

Verification:

  • Modified emit_rust_abi_types and emit_rust_layout to emit pub struct and pub fields.
  • Updated the test fixture in probes.rs to expect the pub keyword.
  • Ran cd in-cli && cargo test boundary_emit and confirmed the tests passed.
  • Compiled an example script natively with -D dead_code to verify that pub types bypass the dead code lint.
  • Ran the full test suite (cargo test) and the integration tests (./install.sh && ~/.local/bin/in test), ensuring no regressions were introduced.

Result: The codebase is cleaner and adheres to better code health practices by avoiding broad lint allowances in favor of idiomatic access modifiers.


PR created automatically by Jules for task 15037892467529915069 started by @undivisible


Note

Low Risk
Codegen-only change to generated probe snippets and matching tests; no runtime or boundary ABI behavior change.

Overview
Generated Rust layout probe output no longer starts with #![allow(dead_code)]. Instead, emitted ABI helper types (InSliceU8, InBufU8, etc.) and per-layout structs use pub struct and pub fields so compile-time size/alignment checks stay clean under -D dead_code without a crate-wide lint suppression.

Unit expectations in test_emit_rust_layout_success were updated to match the new pub struct/field text.

Reviewed by Cursor Bugbot for commit db23a24. Configure here.

Removed the crate/file-level `#![allow(dead_code)]` attribute from the generated Rust layout probes in `in-cli/src/boundary_emit/probes.rs`. To prevent actual dead code warnings on the structs generated strictly for assertion checks (`size_of`, `align_of`, `offset_of`), the emitted types and their fields were changed to `pub`.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@cursor

cursor Bot commented Sep 10, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_0c2c33c5-1de5-4227-9e82-59bd5274a306)

@mergify

mergify Bot commented Sep 10, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

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.

1 participant