4 ms·
To add, it is trivial to guarantee that Rust code is "zero-copy", so if this is something you care about, Rust allows your program to fail to compile if it trie
by volta83 6y ago
To add, it is trivial to guarantee that Rust code is "zero-copy", so if this is something you care about, Rust allows your program to fail to compile if it tries to make a copy.
- mhh__ 6y agoGodbolt example?
- deleted 6y ago[deleted]
- adwn 6y agoHere you go: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=06d7335eef1551565c449c682b8ef2fe https://play.rust-lang.org/?version=stable&mode=debug&editio... Because the data structure LotsOfData doesn't implement the Clone trait, attempting to create a copy will fail at compile-time.
- mhh__ 6y agoOK. I was curious whether it was part of the type system or one of those #[feature] thingies. https://run.dlang.io/is/jOXfJz https://run.dlang.io/is/jOXfJz is a D equivalent
- deleted 5y ago[deleted]