Lot of functions are unsound
Just a few examples I found very quickly.
-
Entity::setseems to be creating a&mut Treference to either uninitialized or zeroed memory (both UB if done for an arbitrary type likeBoxorString) and writes aTto it (which means dropping the "old"Tat that memory location, which never existed in the first place) -
World::getandEntity::getallow to get a&Tto some component, but don't prevent any other method that mutate that component (likeWorld::set,Entity::setorEntity::remove) from running. The methods that mutate or remove the components should likely take a&mut, though that's probably not enough (see the next point). -
EntityisCopy, so the&mut selfrequirement on theget_mutdoesn't really prevent it from being called multiple times on the same entity. Moreover even ifEntitywas notCopy/Cloneyou could still create an aliased one by usingWorld::lookuporWorld::find_entity.
I suspect there are a lot more functions or ways to generate UB in this crate. Ideally most if not all functions would be marked as unsafe, but if this is unwanted for ergonomic reasons at least put a big disclaimer in the README and the documentation that this crate is unsound and can easily run into UB by using safe functions.