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<Fluff>, } +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<K: fmt::Debug, C> fmt::Display for MapConflict<K, C> { } } +impl<K, V> !Transaction for BTreeMap<K, V> {} + impl<K, V> Merge for BTreeMap<K, V> where K: Clone + Ord + fmt::Debug + 'static, @@ -105,6 +107,8 @@ where macro_rules! hashmap_merge { ($module:ident) => { + impl<K, V, S> !Transaction for $module::HashMap<K, V, S> {} + impl<K, V, S> Merge for $module::HashMap<K, V, S> where K: Clone + Eq + Hash + fmt::Debug + 'static,