diff --git a/rust/kernel/build_assert.rs b/rust/kernel/build_assert.rs index 97098082721437..9e37120bc69c20 100644 --- a/rust/kernel/build_assert.rs +++ b/rust/kernel/build_assert.rs @@ -67,7 +67,8 @@ macro_rules! build_error { /// assert!(n > 1); // Run-time check /// } /// ``` -#[allow(rustdoc::broken_intra_doc_links)] +/// +/// [`static_assert!`]: crate::static_assert! #[macro_export] macro_rules! build_assert { ($cond:expr $(,)?) => {{ diff --git a/rust/kernel/device.rs b/rust/kernel/device.rs index 4b478d12b79aca..fca2bff330b6b7 100644 --- a/rust/kernel/device.rs +++ b/rust/kernel/device.rs @@ -121,7 +121,8 @@ pub unsafe trait RawDevice { /// Prints an emergency-level message (level 0) prefixed with device information. /// /// More details are available from [`dev_emerg`]. - #[allow(rustdoc::broken_intra_doc_links)] + /// + /// [`dev_emerg`]: crate::dev_emerg fn pr_emerg(&self, args: fmt::Arguments<'_>) { // SAFETY: `klevel` is null-terminated, uses one of the kernel constants. unsafe { self.printk(bindings::KERN_EMERG, args) }; @@ -130,7 +131,8 @@ pub unsafe trait RawDevice { /// Prints an alert-level message (level 1) prefixed with device information. /// /// More details are available from [`dev_alert`]. - #[allow(rustdoc::broken_intra_doc_links)] + /// + /// [`dev_alert`]: crate::dev_alert fn pr_alert(&self, args: fmt::Arguments<'_>) { // SAFETY: `klevel` is null-terminated, uses one of the kernel constants. unsafe { self.printk(bindings::KERN_ALERT, args) }; @@ -139,7 +141,8 @@ pub unsafe trait RawDevice { /// Prints a critical-level message (level 2) prefixed with device information. /// /// More details are available from [`dev_crit`]. - #[allow(rustdoc::broken_intra_doc_links)] + /// + /// [`dev_crit`]: crate::dev_crit fn pr_crit(&self, args: fmt::Arguments<'_>) { // SAFETY: `klevel` is null-terminated, uses one of the kernel constants. unsafe { self.printk(bindings::KERN_CRIT, args) }; @@ -148,7 +151,8 @@ pub unsafe trait RawDevice { /// Prints an error-level message (level 3) prefixed with device information. /// /// More details are available from [`dev_err`]. - #[allow(rustdoc::broken_intra_doc_links)] + /// + /// [`dev_err`]: crate::dev_err fn pr_err(&self, args: fmt::Arguments<'_>) { // SAFETY: `klevel` is null-terminated, uses one of the kernel constants. unsafe { self.printk(bindings::KERN_ERR, args) }; @@ -157,7 +161,8 @@ pub unsafe trait RawDevice { /// Prints a warning-level message (level 4) prefixed with device information. /// /// More details are available from [`dev_warn`]. - #[allow(rustdoc::broken_intra_doc_links)] + /// + /// [`dev_warn`]: crate::dev_warn fn pr_warn(&self, args: fmt::Arguments<'_>) { // SAFETY: `klevel` is null-terminated, uses one of the kernel constants. unsafe { self.printk(bindings::KERN_WARNING, args) }; @@ -166,7 +171,8 @@ pub unsafe trait RawDevice { /// Prints a notice-level message (level 5) prefixed with device information. /// /// More details are available from [`dev_notice`]. - #[allow(rustdoc::broken_intra_doc_links)] + /// + /// [`dev_notice`]: crate::dev_notice fn pr_notice(&self, args: fmt::Arguments<'_>) { // SAFETY: `klevel` is null-terminated, uses one of the kernel constants. unsafe { self.printk(bindings::KERN_NOTICE, args) }; @@ -175,7 +181,8 @@ pub unsafe trait RawDevice { /// Prints an info-level message (level 6) prefixed with device information. /// /// More details are available from [`dev_info`]. - #[allow(rustdoc::broken_intra_doc_links)] + /// + /// [`dev_info`]: crate::dev_info fn pr_info(&self, args: fmt::Arguments<'_>) { // SAFETY: `klevel` is null-terminated, uses one of the kernel constants. unsafe { self.printk(bindings::KERN_INFO, args) }; @@ -184,7 +191,8 @@ pub unsafe trait RawDevice { /// Prints a debug-level message (level 7) prefixed with device information. /// /// More details are available from [`dev_dbg`]. - #[allow(rustdoc::broken_intra_doc_links)] + /// + /// [`dev_dbg`]: crate::dev_dbg fn pr_dbg(&self, args: fmt::Arguments<'_>) { if cfg!(debug_assertions) { // SAFETY: `klevel` is null-terminated, uses one of the kernel constants. diff --git a/rust/kernel/fs/param.rs b/rust/kernel/fs/param.rs index 8cc6aa26c5580b..d0c8353e5f1c4f 100644 --- a/rust/kernel/fs/param.rs +++ b/rust/kernel/fs/param.rs @@ -275,7 +275,8 @@ impl SpecArray { /// The type of the elements in `handlers` must be compatible with the types in specs. For /// example, if `specs` declares that the i-th element is a bool then the i-th handler /// should be for a bool. - #[allow(rustdoc::broken_intra_doc_links)] + /// + /// [`define_fs_params`]: crate::define_fs_params pub const unsafe fn new(specs: [Spec; N], handlers: [&'static dyn Handler; N]) -> Self { let mut array = Self { specs: [ZERO_SPEC; N], @@ -314,7 +315,8 @@ impl SpecArray { /// /// Users are encouraged to use the [`define_fs_params`] macro to define the /// [`super::Context::PARAMS`] constant. -#[allow(rustdoc::broken_intra_doc_links)] +/// +/// [`define_fs_params`]: crate::define_fs_params pub struct SpecTable<'a, S: 'static> { pub(super) first: &'a bindings::fs_parameter_spec, pub(super) handlers: &'a [&'static dyn Handler], @@ -343,7 +345,8 @@ impl ConstantArray { /// /// Users are encouraged to use the [`define_fs_params`] macro to define the /// [`super::Context::PARAMS`] constant. - #[allow(rustdoc::broken_intra_doc_links)] + /// + /// [`define_fs_params`]: crate::define_fs_params pub const fn new(consts: [(&'static CStr, u32); N]) -> Self { const ZERO: bindings::constant_table = bindings::constant_table { name: core::ptr::null(), diff --git a/rust/kernel/gpio.rs b/rust/kernel/gpio.rs index 7141291f317a64..307b39ee3cf3c3 100644 --- a/rust/kernel/gpio.rs +++ b/rust/kernel/gpio.rs @@ -120,7 +120,8 @@ impl Registration { /// /// Users are encouraged to use the [`gpio_chip_register`] macro because it automatically /// defines the lock classes and calls the registration function. - #[allow(rustdoc::broken_intra_doc_links)] + /// + /// [`gpio_chip_register`]: crate::gpio_chip_register pub fn register( self: Pin<&mut Self>, gpio_count: u16, @@ -343,7 +344,8 @@ mod irqchip { /// /// Users are encouraged to use the [`gpio_irq_chip_register`] macro because it /// automatically defines the lock classes and calls the registration function. - #[allow(rustdoc::broken_intra_doc_links)] + /// + /// [`gpio_irq_chip_register`]: crate::gpio_irq_chip_register pub fn register>( mut self: Pin<&mut Self>, gpio_count: u16, diff --git a/rust/kernel/std_vendor.rs b/rust/kernel/std_vendor.rs index 2e864354cac1cc..81a4a368ce106b 100644 --- a/rust/kernel/std_vendor.rs +++ b/rust/kernel/std_vendor.rs @@ -135,9 +135,9 @@ /// ``` /// /// [`std::dbg`]: https://doc.rust-lang.org/std/macro.dbg.html +/// [`pr_info`]: crate::pr_info /// [`eprintln`]: https://doc.rust-lang.org/std/macro.eprintln.html /// [`printk`]: https://www.kernel.org/doc/html/latest/core-api/printk-basics.html -#[allow(rustdoc::broken_intra_doc_links)] #[macro_export] macro_rules! dbg { // NOTE: We cannot use `concat!` to make a static string as a format argument