let zero = Box::<u32>::new_zeroed();
let zero = unsafe { zero.assume_init() };
assert_eq!(*zero, 0)//<<HERE!!!
Why is '*zero' instead of just zero?
If we don't have to have 'zero->assume_init()', note the -> operator for pointers from C/C++, because that's how we access objects via pointer in C/C++, why do we HAVE TO HAVE zero, the '', also known as dereference operator? Especially in view of the fact that rust does have trait defer. For christ sake, to me rust is a language with great intentions but so terribly executed...
Rust is half baked, that's all I can say.
Please study the type system of the language before making strong unfounded assertions. You'll discover pretty quickly why you need a dereference here.
You seem to misunderstood my point. If rust does NOT need '->' operator with usage of pointer why does it needs '*' operator? Please explain that to me.
Typically when I start to have those thoughts about some aspect of Rust I soon discover that I did not understand the situation very well in the first place. That there is a reason why things are as they are and people much smarter than I have thought it through very thoroughly.
I don't understand what you even want in this case? zero and *zero are not even the same type. Deref is a nice convenience, but it's not like it has truly turned a Box<T> into a T
Adding auto-deref to operators is definitely something that could be useful. There was some work on this in the past in issue #44762 and RFC #2147. See those issues for details of some of the changes required and any open questions. It looks like this could maybe use someone interested in completing that work.
However, I must ask you again to not try to argue with every single response to your posts, and to please focus on requesting information about why things are a certain way, rather than simply criticizing. If you continue in this vein, your account will be banned. Thank you.
How can I not argue with every possible person when every possible person doesn't seem to understand the problem I'm presenting. Even your post confirms my feelings towards auto deref, so it is not like I'm trying to start some language war here.
I simply am stating that there are some things in rust that irks me and are half baked. That's all.