From 58a6c905b7f116570fd6590c3a500c37af5cacc7 Mon Sep 17 00:00:00 2001 From: Kevin Reid Date: Sat, 14 Sep 2024 15:10:47 -0700 Subject: [PATCH] [unstable-rust] Use `feature(negative_impls)`. --- all-is-cubes/src/lib.rs | 1 + all-is-cubes/src/space/space_txn.rs | 2 ++ all-is-cubes/src/transaction/generic.rs | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/all-is-cubes/src/lib.rs b/all-is-cubes/src/lib.rs index 15f04e7db..c56075a50 100644 --- a/all-is-cubes/src/lib.rs +++ b/all-is-cubes/src/lib.rs @@ -3,6 +3,7 @@ #![feature(large_assignments)] #![move_size_limit = "2000"] #![feature(let_chains)] +#![feature(negative_impls)] #![feature(never_type)] #![feature(trait_upcasting)] #![feature(try_blocks)] diff --git a/all-is-cubes/src/space/space_txn.rs b/all-is-cubes/src/space/space_txn.rs index d7d3c6497..90aa29a2a 100644 --- a/all-is-cubes/src/space/space_txn.rs +++ b/all-is-cubes/src/space/space_txn.rs @@ -477,6 +477,8 @@ pub struct CubeTransaction { fluff: Vec, } +impl !Transaction for CubeTransaction {} + impl fmt::Debug for CubeTransaction { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let Self { diff --git a/all-is-cubes/src/transaction/generic.rs b/all-is-cubes/src/transaction/generic.rs index 64f8ba872..7c1304328 100644 --- a/all-is-cubes/src/transaction/generic.rs +++ b/all-is-cubes/src/transaction/generic.rs @@ -50,6 +50,8 @@ impl fmt::Display for MapConflict { } } +impl !Transaction for BTreeMap {} + impl Merge for BTreeMap where K: Clone + Ord + fmt::Debug + 'static, @@ -105,6 +107,8 @@ where macro_rules! hashmap_merge { ($module:ident) => { + impl !Transaction for $module::HashMap {} + impl Merge for $module::HashMap where K: Clone + Eq + Hash + fmt::Debug + 'static,