Ownership in Rust
Rust has a concept of ownership that is unique among programming languages. It is a key feature of the language that a...
For further actions, you may consider blocking this person and/or reporting abuse
There is a lot wrong with this as written.
Stackis not a type in Rust. The stack is an abstract place, but describing it as a type that can be used is unhelpful.Heap; calling it a type is misleading.Copyobjects can be put on the stack or the heap. For example, an array of 1024u16values can technically be put on the stack, but if you get too many of those, it'll overflow, so it's wiser to use the heap.Moveis not a trait! Moving is what happens whenCopyis not implemented, but moving doesn't have a trait corresponding to it. What would such an implementation even look like? Or, what would happen ifMoveandCopywere implemented?Hi Ray, and thanks for addressing these things. here is my answers to all of them:
The main thing I noticed is that
StackandHeapare given styling as if they're types. The first thing I noticed was actually this quote:In reality, the stack is abstract and does not have methods. For someone who only knows Rust, saying it has methods is probably a bit confusing, but as someone who was taught Java first (which actually does have a
Stacktype) and as someone who knows Rust'sVecDeque(something that haspushandpopas I recall), the way the abstract stack was described seemed extremely close to describing an actual type with no clarification that it isn't.I learn more about Rust with each article, thank you. 😊
you are welcome, @get_pieces