3 ms·
In other Rusty news, two phase borrows just got enabled on nightly but stable Rust in the 2015 edition: https://github.com/rust-lang/rust/pull/59114 https://git
by est31 8y ago
In other Rusty news, two phase borrows just got enabled on nightly but stable Rust in the 2015 edition: https://github.com/rust-lang/rust/pull/59114 https://github.com/rust-lang/rust/pull/59114. If not backed out, it will most likely be part of the 1.36 release. This is a milestone of maturity for the new borrow checker: they had a ticket with multiple blocker bugs before they chose to enable it on the 2015 "stability" edition as well: https://github.com/rust-lang/rust/issues/57804 https://github.com/rust-lang/rust/issues/57804
- atombender 8y agoIs there a document anywhere explaining what this change means in practice?
- estebank 8y agohttp://smallcultfollowing.com/babysteps/blog/2016/04/27/non-lexical-lifetimes-introduction/ http://smallcultfollowing.com/babysteps/blog/2016/04/27/non-... https://doc.rust-lang.org/edition-guide/rust-2018/ownership-and-lifetimes/non-lexical-lifetimes.html https://doc.rust-lang.org/edition-guide/rust-2018/ownership-... https://stackoverflow.com/questions/50251487/what-are-non-lexical-lifetimes https://stackoverflow.com/questions/50251487/what-are-non-le... http://smallcultfollowing.com/babysteps/blog/2017/03/01/nested-method-calls-via-two-phase-borrowing/ http://smallcultfollowing.com/babysteps/blog/2017/03/01/nest...
- est31 8y agoThe change was part of the 2018 edition already, so is covered in the 2018 book: https://doc.rust-lang.org/edition-guide/rust-2018/ownership-and-lifetimes/non-lexical-lifetimes.html https://doc.rust-lang.org/edition-guide/rust-2018/ownership-... As an experienced Rust developer I can usually deal with the borrow checker, but sometimes I'm still annoyed by its limitations or hit them without expecting to hit them. Most of the times this happens it's either because I want to partially access a struct in a closure, or do something that's now allowed by NLL. So this is a big deal.
- atoav 8y agoIn a very meta way, this means the programmer can get away with more while the safety guarantees are still upheld.
- CryZe 8y agoUnless I'm wrong, this is NLL, not two phase borrows (which may contain two phase borrows). But considering two phase borrows are still a problem for the memory model, they might actually somewhat unstabilize them to a certain degree again (I haven't checked on what they decided regarding that).
- est31 8y agoNot a borrow checker expert, but this PR was on the blocker list. Maybe it's what you mean? https://github.com/rust-lang/rust/pull/58739 https://github.com/rust-lang/rust/pull/58739
- sanxiyn 8y agoSince the new borrow checker is maturing, people are working on the new new borrow checker: https://github.com/rust-lang/polonius https://github.com/rust-lang/polonius
- kibwen 8y agoFor those wondering, the "new new borrow checker" is similar to its predecessor in that it operates on the compiler's MIR, but is a different and slightly more complete algorithm (it accepts a strict superset of code, thus backwards compatible). This two-step rollout was decided last year due to (at the time) some unacceptable compile-time regressions in the new-new algorithm's implementation. Read about it here: http://smallcultfollowing.com/babysteps/blog/2018/06/15/mir-based-borrow-check-nll-status-update/ http://smallcultfollowing.com/babysteps/blog/2018/06/15/mir-...