Commit a2595ed
rust: kernel: add
Like commit 98f256e ("rust: doctest: add LocalModule fallback
for #[vtable] ThisModule"), add another `LocalModule` struct with a
null-pointer `ModuleMetadata` `impl` for the `kernel` crate, so that
`crate::LocalModule` (auto-inserted by `#[vtable]`) resolves correctly
when there is no `module!` macro.
This will be needed by DRM to use `#[vtable]` `impl` blocks in KUnit
tests within the `kernel` crate [1].
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
Link: https://lore.kernel.org/rust-for-linux/DKNAS52KYWLD.M15VEC6U0F6R@kernel.org/ [1]
[ Created commit out of the diff in the link above. Fixed the
`clippy::undocumented_unsafe_blocks` lint by wrapping with a block
like in the other commit too. Added `#[allow(dead_code)]` until we
actually (and unconditionally, i.e. KUnit tests may be not enabled)
use it. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>LocalModule fallback for #[vtable] impls1 parent 643a7c3 commit a2595ed
1 file changed
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
155 | 169 | | |
156 | 170 | | |
157 | 171 | | |
| |||
0 commit comments