summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/as_underscore.fixed
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/as_underscore.fixed')
-rw-r--r--src/tools/clippy/tests/ui/as_underscore.fixed13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/as_underscore.fixed b/src/tools/clippy/tests/ui/as_underscore.fixed
new file mode 100644
index 000000000..948f6d8e6
--- /dev/null
+++ b/src/tools/clippy/tests/ui/as_underscore.fixed
@@ -0,0 +1,13 @@
+// run-rustfix
+
+#![warn(clippy::as_underscore)]
+
+fn foo(_n: usize) {}
+
+fn main() {
+ let n: u16 = 256;
+ foo(n as usize);
+
+ let n = 0_u128;
+ let _n: u8 = n as u8;
+}