All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] rust: macros: Fix macro referencing core and kernel crates
@ 2025-03-28  0:49 Benno Lossin
  0 siblings, 0 replies; 3+ messages in thread
From: Benno Lossin @ 2025-03-28  0:49 UTC (permalink / raw)
  To: Igor Korotin, linux-kernel; +Cc: rust-for-linux, y86-dev

On Wed Mar 26, 2025 at 7:23 PM CET, Igor Korotin wrote:
> To prevent issues where user-defined modules named `core` or `kernel`
> could be picked up instead of the standard ones, update macros to use
> absolute paths, `::core::...` and `::kernel::...`, for core and kernel
> references.

Please split this sentence up into smaller parts. Also "standard ones"
sounds weird to me, `core` and `kernel` are crates and not modules.

> Suggested-by: y86-dev <y86-dev@protonmail.com>

Please use my real name and other mail address instead:
    
    Benno Lossin <benno.lossin@proton.me>

> Closes: https://github.com/Rust-for-Linux/linux/issues/1150
> Signed-off-by: Igor Korotin <igor.korotin@yahoo.com>
> ---
>  rust/ffi.rs                  | 2 +-
>  rust/kernel/device.rs        | 2 +-
>  rust/kernel/device_id.rs     | 4 ++--
>  rust/kernel/kunit.rs         | 8 ++++----
>  rust/kernel/static_assert.rs | 4 ++--
>  rust/kernel/str.rs           | 4 ++--
>  rust/macros/lib.rs           | 6 +++---
>  scripts/rustdoc_test_gen.rs  | 8 ++++++--
>  8 files changed, 21 insertions(+), 17 deletions(-)

There are also some occurrences of `kernel::` & `core::` in proc macros,
for example:
- rust/macros/kunit.rs:129
- rust/macros/module.rs:347
- ...

Could you also add those to the patch? Thanks!

(line numbers after applying your patch to rust-next)

---
Cheers,
Benno


^ permalink raw reply	[flat|nested] 3+ messages in thread
* Re: [PATCH v2 1/1] rust: macros: Fix macro referencing core and kernel crates v2
@ 2025-03-28 21:50 Benno Lossin
  2025-03-31 10:24 ` [PATCH] rust: macros: Fix macro referencing core and kernel crates Igor Korotin
  0 siblings, 1 reply; 3+ messages in thread
From: Benno Lossin @ 2025-03-28 21:50 UTC (permalink / raw)
  To: Igor Korotin; +Cc: linux-kernel, rust-for-linux

On Fri Mar 28, 2025 at 7:03 PM CET, Igor Korotin wrote:
> Update macros to always use absolute paths for crates `core` and `kernel`.
> This guarantees that macros will not pick up user-defined crates `core`
> or `kernel` by accident.

The crates are not user-defineable. Your initial message was correct in
that the user can define *modules* that have precedence over the crates
`core` and `kernel`.

> Changes since v1:
> - Fixed paths in auto-generated code.

The changelog shouldn't be in the commit message. Instead place it below
the `---`, but before the change stats.

> Suggested-by: Benno Lossin <benno.lossin@proton.me>
> Closes: https://github.com/Rust-for-Linux/linux/issues/1150
> Signed-off-by: Igor Korotin <igor.korotin@yahoo.com>
> ---

(put the changelog here)

---
Cheers,
Benno

>  rust/ffi.rs                     |  2 +-
>  rust/kernel/device.rs           |  2 +-
>  rust/kernel/device_id.rs        |  4 ++--
>  rust/kernel/kunit.rs            |  8 ++++----
>  rust/kernel/static_assert.rs    |  4 ++--
>  rust/kernel/str.rs              |  4 ++--
>  rust/macros/kunit.rs            | 22 +++++++++++-----------
>  rust/macros/lib.rs              |  6 +++---
>  rust/macros/module.rs           | 31 ++++++++++++++++---------------
>  scripts/rustdoc_test_builder.rs |  6 +++---
>  scripts/rustdoc_test_gen.rs     | 16 ++++++++++------
>  11 files changed, 55 insertions(+), 50 deletions(-)


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-03-31 11:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20250326182302.5650-1-igor.korotin.ref@yahoo.com>
2025-03-26 18:23 ` [PATCH] rust: macros: Fix macro referencing core and kernel crates Igor Korotin
2025-03-28  0:49 Benno Lossin
  -- strict thread matches above, loose matches on Subject: below --
2025-03-28 21:50 [PATCH v2 1/1] rust: macros: Fix macro referencing core and kernel crates v2 Benno Lossin
2025-03-31 10:24 ` [PATCH] rust: macros: Fix macro referencing core and kernel crates Igor Korotin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.