Much more often than I'd like, I run into a lack of windows_mut on slices. I know this has been a long road and likely requires LendingIterators to be added to stdlib (A `windows_mut` method on slice - #12 by system - libs - Rust Internals), but I've not seen or heard much about this since GATs were first stabilized in 2022!
And then some more issues with the borrow checker downstream.
I suppose I'd just be interesting in being pointed towards some places where this work is being done! I think the new trait solver is coming in the 2024 edition, but I don't have any idea about where work on the borrow checker is currently? Or removing that implied 'static lifetime for GATs? Are LendingIterators in stdlib blocked on those issues?
I'm happy to read up on things on my own, but am drowning horribly in all of the tracking issues, blog posts, etc, and would really appreciate some links from people in the know <3
Relatedly, is any new Polonius-related borrow-checker work going to remove the need for the split_at_mut() trick being needed every time you want mutable references to different elements of a vector? Problem borrowing two elements of vec mutably - #2 by cuviper
For both @cuviper and @quinedot , thank you for those examples! Part of me knew about and completely forgot about slice patterns, and I'm really really excited to see get_disjoint_mut on the way — an excellent use of const generics!
I've also pondered and whilst I know the new borrow checker is supposed to be much better at determining when borrows can be split, with indexing in particular it's pretty easy to imagine a situation in which the index is only known at run-time, so I don't think 100% of cases could be checked by the borrow checker at all there (since the static analysis would have no way of checking they are disjoint).
Thanks for the great info so far! The get_disjoint_mut is a nice example of stdlib getting some functionality enabled by newer language features like const generics, now I'm just keen to see when we'll get some GAT-enabled methods in stdlib!