<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/source/rss.xsl.xml"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Changes in module.rs</title>
    <description></description>
    <language>en</language>
    <copyright>Copyright 2015</copyright>
    <generator>Java</generator><item>
        <title>d24f5cdbeff8b6a063fca92d0a1f94122a799b59 - Merge tag &apos;rust-7.3&apos; of git://git.kernel.org/pub/scm/linux/kernel/git/ojeda/linux</title>
        <link>http://kernelsources.org:8080/source/history/linux/rust/kernel/module.rs#d24f5cdbeff8b6a063fca92d0a1f94122a799b59</link>
        <description>Merge tag &apos;rust-7.3&apos; of git://git.kernel.org/pub/scm/linux/kernel/git/ojeda/linuxPull Rust updates from Miguel Ojeda: &quot;Toolchain and infrastructure:   - Warn when using &apos;bindgen&apos; &lt; 0.72.1 with &apos;libclang&apos; &gt;= 22, since     that combination may fail to build. It includes a probe for the bug     in case &apos;bindgen&apos; happens to be patched, and tests     In parallel, Nathan updated the instructions for the kernel.org     LLVM+Rust toolchains so that the latest version of &apos;bindgen&apos; is     installed, which should avoid some of these situations   - Support testing &apos;rust_is_available.sh&apos; with &apos;bash&apos; as &apos;/bin/sh&apos;   - Fix an objtool warning by adding one more &apos;noreturn&apos; function for     Rust 1.99.0 (expected 2026-10-01)   - Fix build error in the &apos;rusttest&apos; target due to ambiguity when the     &apos;rustc-dev&apos; component is installed, which was uncovered by the work     to support Rust&apos;s GCC backend (&apos;rustc_codegen_gcc&apos;)   - Fix future Clang warnings in the upcoming powerpc support due to     macro redefinitions in the UAPI helper header by including the     arch-aware &apos;ioctl.h&apos; header  &apos;kernel&apos; crate:   - Rework module ownership support:       - Move the module-related types into a new &apos;module&apos; module and         make the &apos;THIS_MODULE&apos; pointer a constant of &apos;ModuleMetadata&apos;         so that modules can provide the pointer in const contexts, and         add a &apos;this_module&apos; &apos;const fn&apos; to retrieve it         This was enabled by upstream Rust&apos;s work on the &apos;const_mut_refs&apos;         and &apos;const_refs_to_static&apos; features which were stabilized back         in Rust 1.83.0       - Teach &apos;#[vtable]&apos; to associate implementations with their         owning module, defaulting to the local one, including fallbacks         for doctests, uses within the &apos;kernel&apos; crate (like upcoming         KUnit &apos;#[test]&apos;s for DRM) and &apos;rusttest&apos;       - Set &apos;fops.owner&apos; from the module pointer for DRM and         miscdevice       - Migrate Rust Binder and configfs away from the old         &apos;THIS_MODULE&apos; &apos;static&apos; and finally remove it from the &apos;module!&apos;         macro   - &apos;num&apos; module:       - Add the new &apos;casts&apos; module for lossless integer conversions         Rust&apos;s &apos;core&apos; library&apos;s &apos;From&apos; implementations do not cover         conversions that are not portable or future-proof. However, the         kernel supports a narrower set of architectures, which makes it         helpful to provide more infallible conversions, instead of         having developers use &apos;as&apos; casts, which carry the risk of         silently losing data         This goes along with previous work we did to avoid casts in         Rust kernel code since they are more powerful than needed         Thus, provide safe &apos;const&apos; conversion functions (e.g.         &apos;usize_as_u64&apos; and &apos;u64_into_u8&apos;), as well as the         &apos;FromSafeCast&apos; and &apos;IntoSafeCast&apos; extension traits that provide         conversions that are known to be lossless in the kernel, and an         &apos;arch&apos; submodule defining conversions that are known to be         lossless on particular architectures (e.g. 64-bit platforms).         For instance:             // Conversion in const context.             const USIZED_CONST: usize = u8_as_usize(255u8);             // Non-const conversions.             let a = u64::from_safe_cast(4096usize);             let b: u64 = 4096usize.into_safe_cast();       - Add &apos;Bounded::shr_exact&apos; method in the vein of &apos;try_shrink&apos;         which shifts a bounded right only if it loses no set bits       - Fix unsoundness issue in the &apos;Bounded::shr&apos; method by         rejecting, at compile-time, shifts of at least the type&apos;s bit         width   - &apos;fmt&apos; module:       - Route &apos;{:p}&apos; raw pointer formatting through the kernel&apos;s hashed         &apos;%p&apos; format to prevent address leaks, including support for         width and padding. Include tests for both &apos;no_hash_pointers&apos;         case and the default (hashed) one       - Fix the &apos;{:p}&apos; forwarding implementation, which could print the         address of a temporary stack variable   - &apos;time&apos; module:       - Make &apos;Delta&apos; generic over its time unit, with a default unit of         nanoseconds (&apos;Nsec&apos;), preserving the existing behavior. Then,         add a &apos;Jiffy&apos; time unit       - Add the &apos;Delta::as_millis_ceil()&apos; method       - Fix &apos;as_micros_ceil()&apos; rounding near &apos;i64::MAX&apos;, which could         yield a result one microsecond too small   - &apos;sync&apos; module:       - Implement &apos;ForeignOwnable&apos; for &apos;ARef&lt;T&gt;&apos;, allowing C code to         own an &apos;ARef&lt;T&gt;&apos;       - Add a safe abstraction for &apos;rcu_barrier()&apos;   - &apos;error&apos; module: add all of the remaining error codes, except the     deprecated compatibility aliases   - &apos;bug&apos; module:       - Fix build error on UML in &apos;warn_on!&apos; for callers from within         the &apos;kernel&apos; crate       - Fix future &apos;dead_code&apos; warning on arm and loongarch64 and under         &apos;CONFIG_BUG=n&apos; in &apos;warn_on!&apos;, which would trigger with the         upcoming SRCU abstractions       - Fix future build error in &apos;rusttest&apos; on cross-compilation         cases, which would trigger when &apos;warn_on!&apos; has callers inside         the &apos;kernel&apos; crate   - &apos;bitfield&apos; module: fix build error for the upcoming support for     Rust&apos;s GCC backend (&apos;rustc_codegen_gcc&apos;) by always inlining a     couple conversions used in tests  &apos;pin-init&apos; crate:   - User-visible changes:       - Merge the &apos;__pinned_init&apos; and &apos;__init&apos; methods and make &apos;Init&apos;         a marker trait       - Introduce public APIs &apos;raw_init&apos; and &apos;raw_try_init&apos; to prevent         users from needing to invoke the internal &apos;__pinned_init&apos; and         &apos;__init&apos; methods       - Emit errors for duplicate &apos;#[pin]&apos; attributes       - Link &apos;Zeroable::zeroed&apos; and &apos;pin_init::zeroed&apos; in documentation   - Other changes:       - Fix unwind safety issues       - Clean up lint &apos;allow&apos; and &apos;expect&apos;s       - Overhaul &apos;#[cfg]&apos; handling to pave the way for tuple structs         and self-referential structs       - Mark many functions as &apos;#[inline]&apos; for better codegen with &apos;-C         opt-level=s&apos; (&apos;CC_OPTIMIZE_FOR_SIZE&apos;)  &apos;MAINTAINERS&apos;:   - Update &apos;MODULE SUPPORT&apos; to cover the new &apos;module&apos; module  And some other fixes, cleanups and improvements&quot;* tag &apos;rust-7.3&apos; of git://git.kernel.org/pub/scm/linux/kernel/git/ojeda/linux: (54 commits)  rust: add functions and traits for lossless integer conversions  rust: kernel: add `LocalModule` fallback for `#[vtable]` `impl`s  rust: fmt: route {:p} through HashedPtr to prevent address leaks  rust: fmt: fix {:p} printing stack addresses  rust: module: update MAINTAINERS to cover module.rs  rust: macros: remove `THIS_MODULE` static from `module!`  rust_binder: use `LocalModule` for `THIS_MODULE`  rust: configfs: use `LocalModule` for `THIS_MODULE`  rust: miscdevice: set fops.owner from driver module pointer  rust: drm: set fops.owner from driver module pointer  rust: macros: auto-insert OwnerModule in #[vtable]  rust: doctest: add LocalModule fallback for #[vtable] ThisModule  rust: module: add `THIS_MODULE` const to `ModuleMetadata` trait  rust: module: move module types into `module.rs`  rust: num: add Bounded::shr_exact  rust: num: reject Bounded::shr overshifts at build time  rust: num: use const_assert! in Bounded  rust: uapi: replace direct asm-generic/ioctl.h include with linux/ioctl.h  rust: time: add Delta::as_millis_ceil()  rust: time: add jiffies time unit for Delta  ...

            List of files:
            /linux/rust/kernel/module.rs</description>
        <pubDate>Tue, 18 Aug 2026 20:25:09 +0200</pubDate>
        <dc:creator>Linus Torvalds &lt;torvalds@linux-foundation.org&gt;</dc:creator>
    </item>
<item>
        <title>54f846db7b35069959833d2f6ace998c2e11c908 - rust: module: add `THIS_MODULE` const to `ModuleMetadata` trait</title>
        <link>http://kernelsources.org:8080/source/history/linux/rust/kernel/module.rs#54f846db7b35069959833d2f6ace998c2e11c908</link>
        <description>rust: module: add `THIS_MODULE` const to `ModuleMetadata` traitSince `const_refs_to_static` has been stable as of the MSRV bump, a`ThisModule` pointer can now be used in const contexts.Add a `THIS_MODULE` const to the `ModuleMetadata` trait so that modulescan provide their `ThisModule` pointer in const contexts such as static`file_operations`.Add a `this_module()` helper to retrieve the `THIS_MODULE` pointer of agiven module type, and update `__init` to use it instead of the`THIS_MODULE` static generated by the `module!` macro.The `static THIS_MODULE` generated by the `module!` macro is retainedfor backwards compatibility with existing users and removed in a laterpatch once all references have been migrated.Assisted-by: opencode:glm-5.2Reviewed-by: Andreas Hindborg &lt;a.hindborg@kernel.org&gt;Reviewed-by: Gary Guo &lt;gary@garyguo.net&gt;Acked-by: Danilo Krummrich &lt;dakr@kernel.org&gt;Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;Acked-by: Petr Pavlu &lt;petr.pavlu@suse.com&gt;Signed-off-by: Alvin Sun &lt;alvin.sun@linux.dev&gt;Link: https://patch.msgid.link/20260811-fix-fops-owner-v10-2-7e71776f9dbe@linux.devSigned-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;

            List of files:
            /linux/rust/kernel/module.rs</description>
        <pubDate>Tue, 11 Aug 2026 08:39:44 +0200</pubDate>
        <dc:creator>Alvin Sun &lt;alvin.sun@linux.dev&gt;</dc:creator>
    </item>
<item>
        <title>0752a2e96e131ef1dff9740e1d4eb4a960778edb - rust: module: move module types into `module.rs`</title>
        <link>http://kernelsources.org:8080/source/history/linux/rust/kernel/module.rs#0752a2e96e131ef1dff9740e1d4eb4a960778edb</link>
        <description>rust: module: move module types into `module.rs`Move `Module`, `InPlaceModule`, `ModuleMetadata` and `ThisModule` from`lib.rs` into a new `rust/kernel/module.rs`. Re-export them from `lib.rs`to avoid tree-wide changes.Switch six bus driver registrations from `module.0` to the public`ThisModule::as_ptr()` accessor, since the field is no longer visibleoutside the new `module` submodule.No functional change.Assisted-by: opencode:glm-5.2Suggested-by: Gary Guo &lt;gary@garyguo.net&gt;Link: https://lore.kernel.org/all/DJFIQPLOVO4T.1K8T0VZM30LDA@garyguo.net/Reviewed-by: Gary Guo &lt;gary@garyguo.net&gt;Acked-by: Danilo Krummrich &lt;dakr@kernel.org&gt;Reviewed-by: Alice Ryhl &lt;aliceryhl@google.com&gt;Acked-by: Petr Pavlu &lt;petr.pavlu@suse.com&gt;Signed-off-by: Alvin Sun &lt;alvin.sun@linux.dev&gt;Link: https://patch.msgid.link/20260811-fix-fops-owner-v10-1-7e71776f9dbe@linux.devSigned-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;

            List of files:
            /linux/rust/kernel/module.rs</description>
        <pubDate>Tue, 11 Aug 2026 08:39:43 +0200</pubDate>
        <dc:creator>Alvin Sun &lt;alvin.sun@linux.dev&gt;</dc:creator>
    </item>
</channel>
</rss>
