]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/cast.rs
When suggesting `from(x)` for lossless casts, strip parens from `x`.
[rust.git] / tests / ui / cast.rs
index fd4c4e91c5dd9188c7e2a53a6bbac2622bdc4b4e..82427c128e4f5683a6f2a5a3523744d9fc7aec16 100644 (file)
@@ -57,6 +57,8 @@ fn main() {
     1u32 as f64;
     // Test cast_lossless with casts from floating-point types
     1.0f32 as f64;
+    // Test cast_lossless with an expression wrapped in parens
+    (1u8 + 1u8) as u16;
     // Test cast_sign_loss
     1i32 as u32;
     1isize as usize;