|
1 |
| -# Scope and purpose |
| 1 | +# Non-Lexical Lifetimes (NLL) Working Group |
| 2 | +![working group status: winding down][status] |
2 | 3 |
|
3 |
| -The **nll** working group is working towards transitioning the |
4 |
| -compiler use a MIR-based borrow check that implements the initial |
5 |
| -non-lexical lifetimes proposal. |
| 4 | +This working group aims to implement non-lexical lifetimes (NLL), as described in RFC 2094: |
6 | 5 |
|
7 |
| -XXX add links to RFCs etc |
| 6 | +> Extend Rust's borrow system to support non-lexical lifetimes -- these are lifetimes that are |
| 7 | +> based on the control-flow graph, rather than lexical scopes. The RFC describes in detail how |
| 8 | +> to infer these new, more flexible regions, and also describes how to adjust our error messages. |
| 9 | +> The RFC also describes a few other extensions to the borrow checker, the total effect of which is |
| 10 | +> to eliminate many common cases where small, function-local code modifications would be required |
| 11 | +> to pass the borrow check. |
8 | 12 |
|
9 |
| -# Current status |
| 13 | +- **Leads:** [@nikomatsakis][nikomatsakis] and [@pnkfelix][pnkfelix] |
| 14 | +- **Meeting Notes:** [All](NOTES.md) |
10 | 15 |
|
11 |
| -NLL has **landed** in the Rust 2018 edition and is currently in |
12 |
| -**migration** mode. The working group is currently working towards |
13 |
| -enabling NLL by default, for all editions, and in the full, |
14 |
| -non-migration mode. XXX say more here |
| 16 | +[status]: https://img.shields.io/badge/status-winding%20down-orange.svg?style=for-the-badge |
15 | 17 |
|
16 |
| -# How to participate |
| 18 | +## Status |
| 19 | +NLL has **landed** in the Rust 2018 edition and is currently in **migration** mode. The working |
| 20 | +group is currently working towards enabling NLL by default, for all editions, and in the full, |
| 21 | +non-migration mode. |
17 | 22 |
|
18 |
| -## Chat forum |
| 23 | +## What is the goal of this working group? |
| 24 | +This working group aims to accomplish the following: |
19 | 25 |
|
20 |
| -On [the rust-lang Zulip][z], in [the `#t-compiler/wg-nll` stream][s]. |
| 26 | +- Implement a new borrow checker based on the MIR that supports non-lexical lifetimes. |
| 27 | +- Handle the migration from the existing AST-based borrow checker. |
21 | 28 |
|
22 |
| -[z]: https://rust-lang.zulipchat.com/ |
23 |
| -[s]: https://rust-lang.zulipchat.com/#narrow/stream/122657-t-compiler.2Fwg-nll |
| 29 | +# How can I get involved? |
| 30 | +If you are interested in getting involved in this working group, you should try to attend a meeting and |
| 31 | +introduce yourself or send a message in the Zulip stream. You can be added to the GitHub and Zulip |
| 32 | +group for the working group if you are interested in being pinged when there are available tasks. |
24 | 33 |
|
25 |
| -## Weekly triage meeting |
| 34 | +- **Desired experience level:** Any |
| 35 | +- **Relevant repositories:** [`rust-lang/rust`][repo] (specifically `src/librustc_mir/borrow_check`) |
| 36 | +- **Zulip stream:** [`#t-compiler/wg-nll`][zulip] on Zulip |
26 | 37 |
|
27 |
| -There is a weekly triage meeting on Wednesdays at 15:30pm Boston time |
28 |
| -(UTC-05:00 presently). This meeting takes place on [Zulip][z] in a |
29 |
| -dedicated topic of the [the `#t-compiler/wg-nll` stream][s]. |
| 38 | +[repo]: https://github.com/rust-lang/rust |
| 39 | +[zulip]: https://rust-lang.zulipchat.com/#narrow/stream/122657-t-compiler.2Fwg-nll |
| 40 | + |
| 41 | +## What if I don't have much time? |
| 42 | +If you don't have time to contribute code, consider using `#![feature(nll)]` to help find bugs |
| 43 | +with NLL. If you do, we'd love it if you could file an issue. |
| 44 | + |
| 45 | +## Are there any resources so I can get up to speed? |
| 46 | +There are some resources available for those interested in contributing to get some background |
| 47 | +and context: |
| 48 | + |
| 49 | +- MIR is an intermediate representation used within the compiler. NLL is implemented as a new |
| 50 | + borrow checker implemented on the MIR. You can read about the MIR in |
| 51 | + the [relevant rustc-guide chapter](https://rust-lang.github.io/rustc-guide/mir/index.html). |
| 52 | +- You can read about the major phases and internals of the MIR borrow checker in |
| 53 | + it's [rustc-guide chapter](https://rust-lang.github.io/rustc-guide/borrow_check.html). |
| 54 | +- NLL was originally specified |
| 55 | + in [RFC 2094](https://github.com/rust-lang/rfcs/blob/master/text/2094-nll.md). |
| 56 | +- [@nikomatsakis][nikomatsakis]'s blog posts on NLL are also useful for getting familiar with the |
| 57 | + goals of NLL and some initial implementation ideas. |
| 58 | + * [Introduction][introduction], [NLL based on liveness][liveness] and |
| 59 | + [NLL adding the outlives relation][outlives]. |
| 60 | + |
| 61 | +[introduction]: http://smallcultfollowing.com/babysteps/blog/2016/04/27/non-lexical-lifetimes-introduction/ |
| 62 | +[liveness]: http://smallcultfollowing.com/babysteps/blog/2016/05/04/non-lexical-lifetimes-based-on-liveness/ |
| 63 | +[outlives]: http://smallcultfollowing.com/babysteps/blog/2016/05/09/non-lexical-lifetimes-adding-the-outlives-relation/ |
| 64 | + |
| 65 | +## Do I need to attend any meetings? |
| 66 | +The NLL working group meets regularly for triage and discussion of high priority issues - see |
| 67 | +the [compiler team meeting calendar](../README.md#meeting-calendar) for the most up to date |
| 68 | +time. Attendance is not mandatory but recommended as this can be a good opportunity to ask any |
| 69 | +questions and find new issues to work on. |
| 70 | + |
| 71 | +## What do all these NLL labels mean? |
| 72 | +The NLL working group monitors the [**A-NLL**][A-NLL] label for issues relating to NLL. |
| 73 | + |
| 74 | +The follow extra labels are used during the working group's prioritization and triage, in roughly |
| 75 | +priority order: |
| 76 | + |
| 77 | +- [**NLL-sound**][NLL-sound] labels bugs around examples of code that is meant to be rejected by |
| 78 | + NLL. Usually such bugs are either ICE'ing or being erroneously accepted by NLL. *NLL-sound* |
| 79 | + things tend to be higher priority than *NLL-complete* things, at least at the moment. |
| 80 | +- [**NLL-performant**][NLL-performant] is for cases where NLL is causing *slow, slow, slow* |
| 81 | + compile times. |
| 82 | +- [**NLL-complete**][NLL-complete] labels bugs around examples of code that is meant to be |
| 83 | + accepted by NLL. Usually such bugs are either ICE'ing or being erroneously rejected by NLL. |
| 84 | +- [**NLL-reference**][NLL-reference] labels any issues relating to documenting NLL's behaviour |
| 85 | + into the language reference. |
| 86 | +- [**NLL-diagnostics**][NLL-diagnostics] labels cases where the diagnostics emitted by NLL |
| 87 | + specifcally needs improvement. Usually it is/was used for cases where NLL is a regresion |
| 88 | + w.r.t diagnostics when compared to AST-borrowck (but at this point its really more of a |
| 89 | + catch-all for any diagnostic issue originating from the NLL code base). |
| 90 | + |
| 91 | +Other NLL labels also exist: |
| 92 | + |
| 93 | +- [**NLL-fixed-by-NLL**][NLL-fixed-by-NLL] labels bugs that are problems solely with the |
| 94 | + AST-borrowck -- they are bugs that we intend to close once everyone migrates over to NLL. |
| 95 | +- [**NLL-polonius**][NLL-polonius] labels bugs related to the Polonius subproject - see the |
| 96 | + Polonius working group for more information on these. |
| 97 | + |
| 98 | +[A-NLL]: https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3AA-NLL |
| 99 | +[NLL-sound]: https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3ANLL-sound |
| 100 | +[NLL-performant]: https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3ANLL-performant |
| 101 | +[NLL-complete]: https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3ANLL-complete |
| 102 | +[NLL-reference]: https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3ANLL-reference |
| 103 | +[NLL-diagnostics]: https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3ANLL-diagnostics |
| 104 | +[NLL-fixed-by-NLL]: https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3ANLL-fixed-by-NLL |
| 105 | +[NLL-polonius]: https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3ANLL-polonius |
| 106 | + |
| 107 | +[nikomatsakis]: https://github.com/nikomatsakis |
| 108 | +[pnkfelix]: https://github.com/pnkfelix |
0 commit comments