🧹 Remove dead_code allow from Rust layout probes - #329
Conversation
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>
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Bugbot couldn't run - usage limit reachedBugbot 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) |
|
Tick the box to add this pull request to the merge queue (same as
|
🎯 What: Removed the
#![allow(dead_code)]attribute from the generated Rust layout probes inin-cli/src/boundary_emit/probes.rsand replaced it with making the generated structs and their fieldspub.💡 Why: Using
#![allow(dead_code)]in generated files can obscure actual unused code. By making the typespub, we inform the Rust compiler that these types are part of a public API interface, which properly suppressesdead_codewarnings for types that are only instantiated or used for size and alignment checks, without broadly disabling the lint.✅ Verification:
emit_rust_abi_typesandemit_rust_layoutto emitpub structandpubfields.probes.rsto expect thepubkeyword.cd in-cli && cargo test boundary_emitand confirmed the tests passed.-D dead_codeto verify thatpubtypes bypass the dead code lint.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 usepub structandpubfields so compile-time size/alignment checks stay clean under-D dead_codewithout a crate-wide lint suppression.Unit expectations in
test_emit_rust_layout_successwere updated to match the newpubstruct/field text.Reviewed by Cursor Bugbot for commit db23a24. Configure here.