News for hackers. Stuff that matters.
Re:The Next Step for Generics by boustrophedon on Tuesday June 16, 2020 @08:29PM (#23546179)
The immutable borrows also help prevent iterator invalidation in single threaded code when using an iterator.
Re:The Next Step for Generics by jolux on Wednesday June 17, 2020 @04:55PM (#23556630)
Yes, exactly. One of my first big fights with the borrow checker was over not realizing I was invalidating an iterator by mutating it by looping over it. Then it clicked for me.