about summary refs log tree commit diff
path: root/compiler/rustc_lint/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-10-18 11:55:41 +0000
committerbors <bors@rust-lang.org>2023-10-18 11:55:41 +0000
commite1de04ad4e32afc6c82080a0b46408fee31dce88 (patch)
tree7e274be2e3c012b293d6592cf506fd1a606474ef /compiler/rustc_lint/src
parente8b8c78d84572e5b2e69dc4cc378ebfefe38562d (diff)
parent8489bce7f5909b8e28e4094833ef0cca714c680a (diff)
downloadrust-e1de04ad4e32afc6c82080a0b46408fee31dce88.tar.gz
rust-e1de04ad4e32afc6c82080a0b46408fee31dce88.zip
Auto merge of #116885 - aliemjay:rollup-plbeppt, r=aliemjay
Rollup of 5 pull requests

Successful merges:

 - #116812 (Disable missing_copy_implementations lint on non_exhaustive types)
 - #116856 (Disable effects in libcore again)
 - #116865 (Suggest constraining assoc types in more cases)
 - #116870 (Don't compare host param by name)
 - #116879 (revert #114586)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_lint/src')
-rw-r--r--compiler/rustc_lint/src/builtin.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs
index 3e44e168786..f6c7f4071dc 100644
--- a/compiler/rustc_lint/src/builtin.rs
+++ b/compiler/rustc_lint/src/builtin.rs
@@ -677,6 +677,11 @@ impl<'tcx> LateLintPass<'tcx> for MissingCopyImplementations {
         if type_implements_negative_copy_modulo_regions(cx.tcx, ty, param_env) {
             return;
         }
+        if def.is_variant_list_non_exhaustive()
+            || def.variants().iter().any(|variant| variant.is_field_list_non_exhaustive())
+        {
+            return;
+        }
 
         // We shouldn't recommend implementing `Copy` on stateful things,
         // such as iterators.