From bd928a0b5e144b0fafb2f4659a83aa362de7e3c7 Mon Sep 17 00:00:00 2001 From: Matthew Jasper Date: Fri, 5 May 2023 12:54:58 +0100 Subject: Disallow (min) specialization imps with no items Such implementations are usually mistakes and are not used in the compiler or standard library (after this commit) so forbid them with `min_specialization`. --- compiler/rustc_data_structures/src/owned_slice.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'compiler/rustc_data_structures/src') diff --git a/compiler/rustc_data_structures/src/owned_slice.rs b/compiler/rustc_data_structures/src/owned_slice.rs index 048401f66c2..311a42aa42a 100644 --- a/compiler/rustc_data_structures/src/owned_slice.rs +++ b/compiler/rustc_data_structures/src/owned_slice.rs @@ -109,9 +109,11 @@ impl Borrow<[u8]> for OwnedSlice { } // Safety: `OwnedSlice` is conceptually `(&'self.1 [u8], Box)`, which is `Send` +#[cfg(parallel_compiler)] unsafe impl Send for OwnedSlice {} // Safety: `OwnedSlice` is conceptually `(&'self.1 [u8], Box)`, which is `Sync` +#[cfg(parallel_compiler)] unsafe impl Sync for OwnedSlice {} #[cfg(test)] -- cgit 1.4.1-3-g733a5