News for hackers. Stuff that matters.
Re:Swift 4.0 Released by leshow on Wednesday September 20, 2017 @10:17AM (#15293957)
Isn't the mutable borrow ended after the end of the x += 1 line? leaving you free to read the contents of the ptr?

I don't know swift at all. but from their document on swapAt() it looks like they are trying to prevent two fn(&p, &p) where func fn(a: inout Type, b: inout Type)

Re:Swift 4.0 Released by hellofunk on Wednesday September 20, 2017 @11:04AM (#15294505)
> Isn't the mutable borrow ended after the end of the x += 1 line?

No, see Mike's comment here.