firecracker-microvm/firecracker

Use `clippy::as_conversions`

Open

#3,161 建立於 2022年10月4日

在 GitHub 查看
 (10 留言) (0 反應) (0 負責人)Rust (34,348 star) (2,393 fork)batch import
Good first issuePriority: LowStatus: ParkedType: Fix

描述

From a discussion https://github.com/firecracker-microvm/firecracker/pull/3156#discussion_r986640407 it was thought utilizing the clippy lint clippy::as_conversions would introduce additional safety.

It would be good to implement this lint, either via #![warn(clippy::as_conversions)] or passed as a command line argument under test_clippy.py.

To break up this work, we can implement the following lints incrementally:

  • #3195
  • #3196
  • #3197
  • #3198
  • #3199
  • #3200
  • #3201
  • #3202
  • #3203
  • In Cargo.toml replace
    ptr_as_ptr = "warn"
    cast_lossless = "warn"
    cast_possible_truncation = "warn"
    cast_possible_wrap = "warn"
    cast_sign_loss = "warn"
    
    with
    as_conversions = "warn"
    
    and fix warnings.

貢獻者指南