Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • rust
  • kernel
  • sync.rs
Find file BlameHistoryPermalink
  • Miguel Ojeda's avatar
    rust: sync: implement `Default` for `LockClassKey` · 7c81aa85
    Miguel Ojeda authored Apr 01, 2024
    In the upcoming Rust 1.78.0, Clippy suggests to implement `Default` even
    when `new()` is `const`, since `Default::default()` may call `const`
    functions even if it is not `const` itself [1]:
    
        error: you should consider adding a `Default` implementation for `LockClassKey`
          --> rust/kernel/sync.rs:31:5
           |
        31 | /     pub const fn new() -> Self {
        32 | |         Self(Opaque::uninit())
        33 | |     }
           | |_____^
    
    Thus implement it.
    
    Link: https://github.com/rust-lang/rust-clippy/pull/10903
    
     [1]
    Reviewed-by: default avatarBenno Lossin <benno.lossin@proton.me>
    Reviewed-by: default avatarAlice Ryhl <aliceryhl@google.com>
    Reviewed-by: default avatarBoqun Feng <boqun.feng@gmail.com>
    Link: https://lore.kernel.org/r/20240401212303.537355-2-ojeda@kernel.org
    
    
    Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
    7c81aa85
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7