about summary refs log tree commit diff
path: root/src/libstd/thread
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-11-12 01:20:33 +0000
committerbors <bors@rust-lang.org>2018-11-12 01:20:33 +0000
commitd8f4c9ffacc0da52db27923aa69dda64e9e14b01 (patch)
tree3374953474bddf401d7b7ef31688ca9aa46598bc /src/libstd/thread
parent775eab58835f9bc0f1f01ccbb79725dce0c73b51 (diff)
parent68e76dca09da9a59d29e27872645ba38222ca98d (diff)
downloadrust-d8f4c9ffacc0da52db27923aa69dda64e9e14b01.tar.gz
rust-d8f4c9ffacc0da52db27923aa69dda64e9e14b01.zip
Auto merge of #55525 - nnethercote:MatcherPos-stack-SmallVec, r=nnethercote
Make `MatcherPos::stack` a `SmallVec`.

This avoids some allocations.

This seems like a trivial change, but the compiler rejects it:
```
   Compiling syntax v0.0.0 (/home/njn/moz/rust1/src/libsyntax)
error[E0597]: `initial` does not live long enough=========>           ] 89/110: syntax
   --> libsyntax/ext/tt/macro_parser.rs:647:57
    |
647 |     let mut cur_items = smallvec![MatcherPosHandle::Ref(&mut initial)];
    |                                                         ^^^^^^^^^^^^ borrowed value does not live long enough
...
762 | }
    | -
    | |
    | `initial` dropped here while still borrowed
    | borrow later used here, when `initial` is dropped

error: aborting due to previous error
```
This is either a compiler bug, or there's some subtle thing I don't understand. The lifetimes sure seem straightforward: `initial` is declared, and then `cur_items` is declared immediately afterward, and it uses a reference to `initial`. The error message makes it sound like the compiler is dropping the variables in the wrong order.

r? @nikomatsakis, any idea what the problem is?
Diffstat (limited to 'src/libstd/thread')
0 files changed, 0 insertions, 0 deletions