summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/unnecessary_cast.fixed
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
commitd1b2d29528b7794b41e66fc2136e395a02f8529b (patch)
treea4a17504b260206dec3cf55b2dca82929a348ac2 /src/tools/clippy/tests/ui/unnecessary_cast.fixed
parentReleasing progress-linux version 1.72.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.tar.xz
rustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.zip
Merging upstream version 1.73.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/tools/clippy/tests/ui/unnecessary_cast.fixed')
-rw-r--r--src/tools/clippy/tests/ui/unnecessary_cast.fixed17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/unnecessary_cast.fixed b/src/tools/clippy/tests/ui/unnecessary_cast.fixed
index 8efd44baf..2bf02f134 100644
--- a/src/tools/clippy/tests/ui/unnecessary_cast.fixed
+++ b/src/tools/clippy/tests/ui/unnecessary_cast.fixed
@@ -38,6 +38,16 @@ mod fake_libc {
}
}
+fn aaa() -> ::std::primitive::u32 {
+ 0
+}
+
+use std::primitive::u32 as UnsignedThirtyTwoBitInteger;
+
+fn bbb() -> UnsignedThirtyTwoBitInteger {
+ 0
+}
+
#[rustfmt::skip]
fn main() {
// Test cast_unnecessary
@@ -105,6 +115,13 @@ fn main() {
extern_fake_libc::getpid_SAFE_TRUTH() as i32;
let pid = unsafe { fake_libc::getpid() };
pid as i32;
+ aaa();
+ let x = aaa();
+ aaa();
+ // Will not lint currently.
+ bbb() as u32;
+ let x = bbb();
+ bbb() as u32;
let i8_ptr: *const i8 = &1;
let u8_ptr: *const u8 = &1;