From a8e7e791010a2ff1fca1b65dce48096419b99638 Mon Sep 17 00:00:00 2001 From: Ryan Mehri Date: Mon, 16 Oct 2023 11:05:04 -0700 Subject: disable missing_copy_implementations lint on non_exhaustive types use is_variant_list_non_exhaustive/is_field_list_non_exhaustive remove unused tcx inline non_exhaustive def/variant check --- compiler/rustc_lint/src/builtin.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'compiler/rustc_lint/src') diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index 536f78a73ed..12e818b81cb 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. -- cgit 1.4.1-3-g733a5