Quite a few of these implicate major additions to the type system (which I would like to see!), rather than just minor niceties. (You're quite likely aware of many of these, but for everyone else reading.)
This needs something like unmoveable types or existential lifetimes (as @Ericson2314 also commented). I haven't begun to think about what the latter would mean.
This needs (ideally) a safe
Transmute trait, which has been proposed several times before, under different names (originally
Cast, ...). Also type-level constants, like the next one, for the
; 3 part.
This would need something like the ability to parameterize generics over type-level constants, which has also been proposed a few times before. This (along with the functionality around
const fn) needs a lot of care and hard thinking to really get it "right", rather than just doing it the "obvious" way and getting a lot of duplication and verbosity, like C++ does.
I'm actually not sure what features these would need... part of me thinks this kind of thing would've been easier if we had gone down the "SST" road rather than "DST5" (see the Thoughts on DST series of posts), though I'm not really certain.
These have been proposed as
&uninit references, and are probably my favorite pet proposed feature. The interesting thing about them is that they need to be truly linear, rather than affine (like all existing Rust types), which puts them into tension with panics and unwinding.
You could write this as a fold:
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15].iter().fold(0, |a, b| max(a, *b)), though I'm not sure what the threshold is where it starts being a win. (Almost surely by 15.)