1
Fork 0

Issue #3511 - Rationalize temporary lifetimes.

Major changes:

- Define temporary scopes in a syntax-based way that basically defaults
  to the innermost statement or conditional block, except for in
  a `let` initializer, where we default to the innermost block. Rules
  are documented in the code, but not in the manual (yet).
  See new test run-pass/cleanup-value-scopes.rs for examples.
- Refactors Datum to better define cleanup roles.
- Refactor cleanup scopes to not be tied to basic blocks, permitting
  us to have a very large number of scopes (one per AST node).
- Introduce nascent documentation in trans/doc.rs covering datums and
  cleanup in a more comprehensive way.
This commit is contained in:
Niko Matsakis 2014-01-15 14:39:08 -05:00
parent 149fc76698
commit 419ac4a1b8
64 changed files with 4826 additions and 3691 deletions

View file

@ -276,7 +276,8 @@ pub fn run(mut crate: clean::Crate, dst: Path) {
write!(w, "var allPaths = \\{");
for (i, (&id, &(ref fqp, short))) in cache.paths.iter().enumerate() {
if i > 0 { write!(w, ","); }
write!(w, "'{}':\\{type:'{}',name:'{}'\\}", id, short, *fqp.last());
write!(w, "'{}':\\{type:'{}',name:'{}'\\}",
id, short, *fqp.last());
}
write!(w, "\\};");
w.flush();