]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #22696 - stepancheg:use-box, r=alexcrichton
authorManish Goregaokar <manishsmail@gmail.com>
Mon, 23 Feb 2015 09:18:54 +0000 (14:48 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Mon, 23 Feb 2015 17:58:49 +0000 (23:28 +0530)
commitdb04229d23119e76f52408b61d960e1bcc52af7a
tree0ea536aed48e5e6f97b607725575309102f60eca
parentb2302a50ed534ed671d87835f435af4034705cbe
parent26d9f0ab1aeb3d7b440911104cf17741f83aa0f5
Rollup merge of #22696 - stepancheg:use-box, r=alexcrichton

 e. g.

```
let b: Box<Foo> = Box::from_raw(p);
```

instead of

```
let b: Box<Foo> = mem::transmute(p);
```

Patch also changes closure release code in `src/libstd/sys/unix/thread.rs`
when `pthread_create` failed. Raw pointer was transmuted to box of
`FnOnce()` instead of `Thunk`. This code was probably never executed,
because `pthread_create` rarely fails.

(And there are two more patches in PR: fix typo in doc and mark `from_raw` and `into_raw` functions inline.)
src/liblog/lib.rs