mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-04 18:40:57 +03:00
add a preferred fix for cast_possible_wrap description (#14225)
close #9250 changelog: none
This commit is contained in:
@@ -134,8 +134,14 @@
|
||||
///
|
||||
/// ### Example
|
||||
/// ```no_run
|
||||
/// u32::MAX as i32; // will yield a value of `-1`
|
||||
/// let _ = u32::MAX as i32; // will yield a value of `-1`
|
||||
/// ```
|
||||
///
|
||||
/// Use instead:
|
||||
/// ```no_run
|
||||
/// let _ = i32::try_from(u32::MAX).ok();
|
||||
/// ```
|
||||
///
|
||||
#[clippy::version = "pre 1.29.0"]
|
||||
pub CAST_POSSIBLE_WRAP,
|
||||
pedantic,
|
||||
|
||||
Reference in New Issue
Block a user