From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: rust: doctest: add LocalModule fallback for #[vtable] ThisModule Date: Mon, 25 May 2026 20:45:43 +1000 Message-ID: In-Reply-To: <20260521-fix-fops-owner-v2-3-fd99079c5a04@linux.dev> References: <20260521-fix-fops-owner-v2-0-fd99079c5a04@linux.dev> <20260521-fix-fops-owner-v2-3-fd99079c5a04@linux.dev> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review Adds a dummy `LocalModule` to the doctest harness in `scripts/rustdoc_test_= gen.rs`: ```rust struct LocalModule; use kernel::{ str::CStr, ModuleMetadata, ThisModule, }; use core::ptr::null_mut; impl ModuleMetadata for LocalModule { const NAME: &'static CStr =3D c"rust_doctests_kernel"; const THIS_MODULE: ThisModule =3D unsafe { ThisModule::from_ptr(null_mu= t()) }; } ``` **Observations:** 1. The SAFETY comment is correct =E2=80=94 `try_module_get`/`module_put` ha= ndle null module pointers gracefully (they short-circuit on NULL). This is = the same pattern used for built-in modules (`#[cfg(not(MODULE))]` path). 2. This ensures doctests that exercise `#[vtable]`-annotated traits compile= correctly without a real `module!` invocation. **No issues found.** --- Generated by Claude Code Patch Reviewer