rust: provide proper code documentation titlesRust 1.82.0's Clippy is introducing [1][2] a new warn-by-default lint,`too_long_first_doc_paragraph` [3], which is intended to catch titlesof code do
rust: provide proper code documentation titlesRust 1.82.0's Clippy is introducing [1][2] a new warn-by-default lint,`too_long_first_doc_paragraph` [3], which is intended to catch titlesof code documentation items that are too long (likely because no titlewas provided and the item documentation starts with a paragraph).This lint does not currently trigger anywhere, but it does detect a couplecases if checking for private items gets enabled (which we will do inthe next commit): error: first doc comment paragraph is too long --> rust/kernel/init/__internal.rs:18:1 | 18 | / /// This is the module-internal type implementing `PinInit` and `Init`. It is unsafe to create this 19 | | /// type, since the closure needs to fulfill the same safety requirement as the 20 | | /// `__pinned_init`/`__init` functions. | |_ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_long_first_doc_paragraph = note: `-D clippy::too-long-first-doc-paragraph` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::too_long_first_doc_paragraph)]` error: first doc comment paragraph is too long --> rust/kernel/sync/arc/std_vendor.rs:3:1 | 3 | / //! The contents of this file come from the Rust standard library, hosted in 4 | | //! the <https://github.com/rust-lang/rust> repository, licensed under 5 | | //! "Apache-2.0 OR MIT" and adapted for kernel use. For copyright details, 6 | | //! see <https://github.com/rust-lang/rust/blob/master/COPYRIGHT>. | |_ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_long_first_doc_paragraphThus clean those two instances.In addition, since we have a second `std_vendor.rs` file with a similarheader, do the same there too (even if that one does not trigger the lint,because it is `doc(hidden)`).Link: https://github.com/rust-lang/rust/pull/129531 [1]Link: https://github.com/rust-lang/rust-clippy/pull/12993 [2]Link: https://rust-lang.github.io/rust-clippy/master/index.html#/too_long_first_doc_paragraph [3]Reviewed-by: Trevor Gross <tmgross@umich.edu>Reviewed-by: Alice Ryhl <aliceryhl@google.com>Tested-by: Gary Guo <gary@garyguo.net>Reviewed-by: Gary Guo <gary@garyguo.net>Link: https://lore.kernel.org/r/20240904204347.168520-15-ojeda@kernel.orgSigned-off-by: Miguel Ojeda <ojeda@kernel.org>
show more ...
rust: sync: arc: Implement Arc<dyn Any + Send + Sync>::downcast()This mirrors the standard library's alloc::sync::Arc::downcast().Based on the Rust standard library implementation, ver 1.62.0,li
rust: sync: arc: Implement Arc<dyn Any + Send + Sync>::downcast()This mirrors the standard library's alloc::sync::Arc::downcast().Based on the Rust standard library implementation, ver 1.62.0,licensed under "Apache-2.0 OR MIT", from: https://github.com/rust-lang/rust/tree/1.62.0/library/alloc/srcFor copyright details, please see: https://github.com/rust-lang/rust/blob/1.62.0/COPYRIGHTReviewed-by: Martin Rodriguez Reboredo <yakoyoku@gmail.com>Reviewed-by: Andreas Hindborg <a.hindborg@samsung.com>Reviewed-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>Reviewed-by: Gary Guo <gary@garyguo.net>Signed-off-by: Asahi Lina <lina@asahilina.net>Link: https://lore.kernel.org/r/20230224-rust-arc-v2-1-5c97a865b276@asahilina.net[ Moved `mod std_vendor;` up. ]Signed-off-by: Miguel Ojeda <ojeda@kernel.org>