about summary refs log tree commit diff
path: root/src/test/ui/consts
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-10-11 17:12:14 +0000
committerbors <bors@rust-lang.org>2021-10-11 17:12:14 +0000
commit5b210643ebf2485aafdf2494de8cf41941a64e95 (patch)
tree60ecf0b4cd6f526c9e5d02474b2c7e82ac233760 /src/test/ui/consts
parent1067e2ca5e9cfe5c79f956e49ffc684c5142d49b (diff)
parentf4836768be12a0cd3a6bd8afc551ae836a87d973 (diff)
downloadrust-5b210643ebf2485aafdf2494de8cf41941a64e95.tar.gz
rust-5b210643ebf2485aafdf2494de8cf41941a64e95.zip
Auto merge of #83908 - Flying-Toast:master, r=davidtwco
Add enum_intrinsics_non_enums lint

There is a clippy lint to prevent calling [`mem::discriminant`](https://doc.rust-lang.org/std/mem/fn.discriminant.html) with a non-enum type. I think the lint is worthy of being included in rustc, given that `discriminant::<T>()` where `T` is a non-enum has an unspecified return value, and there are no valid use cases where you'd actually want this.

I've also made the lint check [variant_count](https://doc.rust-lang.org/core/mem/fn.variant_count.html) (#73662).

closes #83899
Diffstat (limited to 'src/test/ui/consts')
-rw-r--r--src/test/ui/consts/const-variant-count.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/ui/consts/const-variant-count.rs b/src/test/ui/consts/const-variant-count.rs
index 455419d2c7f..50eaeeb4685 100644
--- a/src/test/ui/consts/const-variant-count.rs
+++ b/src/test/ui/consts/const-variant-count.rs
@@ -1,5 +1,5 @@
 // run-pass
-#![allow(dead_code)]
+#![allow(dead_code, enum_intrinsics_non_enums)]
 #![feature(variant_count)]
 #![feature(never_type)]