4 ms·
To reiterate what the OP suggests at the bottom, the new (in-progress) borrow checker (the one designed from the ground-up to support non-lexical lifetimes (NLL
by kibwen 8y ago
To reiterate what the OP suggests at the bottom, the new (in-progress) borrow checker (the one designed from the ground-up to support non-lexical lifetimes (NLL)) suffers from none of the match bugs that have inspired the recent slew of patch releases.
It does indeed appear as though the new match features were designed with the theoretical model of the borrow checker in mind, to which the new borrow checker hews much more strongly than the original (in conversations with Niko Matsakis he suggests that the new borrow checker is implemented in the fashion that he had wanted to implement the original one, but the other machinery in the compiler (e.g. a CFG-aware IR like MIR) wasn't ready at the time, and wouldn't be for some years). Obviously the degree to which the original borrow checker would be deficient in the face of the new match features wasn't fully understood, or else I expect that its stabilization would have been delayed. Fortunately, NLL-aware borrowck is enabled by default in nightly right now (or should be imminently: https://internals.rust-lang.org/t/possible-stabilizations-for-2018-edition-preview-2/7983 https://internals.rust-lang.org/t/possible-stabilizations-fo... ) and hopes to reach the stable channel within a few months. :)
- Animats 8y agoBuzzwords: OP: Original poster NLL: Non-lexical lifetimes. New Rust feature. Actually, they're still lexical, in that they're bound to a specific section of source code. It's just that the lifetime region might be smaller than a block. Variables living too long is a problem in Rust because, if they're borrowing something, they block other uses of the same thing they're borrowing. See [1]. CFG: "Control Flow Guard"? Microsoft feature to prevent overwriting return points on the stack? Not sure about this one. IR: "Intermediate representation", the data format used between compiler passes. Now broken down within Rust to a "high level representation" (HIR), a "medium level representation" (MIR), and a low-level representation. The low level representation is called LLVM, not "LIR", because it's borrowed from the LLVM system. LLVM: Originally "Low Level Virtual Machine", now just an identifier for a a specific compiler optimizer and code generator. [1] http://smallcultfollowing.com/babysteps/blog/2016/04/27/non-lexical-lifetimes-introduction/ http://smallcultfollowing.com/babysteps/blog/2016/04/27/non-...
- muizelaar 8y agoCFG: control flow graph
- tux3 8y agoDon't you mean acronyms :) ? CFG would be Control Flow Graph, a structure compilers use to track all the possible paths through your code.
- phyzome 8y agoOr perhaps initialisms (most of those weren't pronounceable), if we're being picky!
- kzrdude 8y agoLLVM is just a name, now. See http://llvm.org/ http://llvm.org/
- eptcyka 8y agoI was under the impression that the upcoming, shiny, great borrow checker is a tad slow, pathologically so in some cases. https://github.com/rust-lang-nursery/polonius https://github.com/rust-lang-nursery/polonius But I do love the way they're tackling the issue know, as this is a much more generic solution.
- Arnavion 8y agoPolonius is NLLv2. It is not being stabilized for now. http://smallcultfollowing.com/babysteps/blog/2018/06/15/mir-based-borrow-check-nll-status-update/ http://smallcultfollowing.com/babysteps/blog/2018/06/15/mir-...