Skip to content

Commit d851ac6

Browse files
committed
---
yaml --- r: 234171 b: refs/heads/beta c: d89a10b h: refs/heads/master i: 234169: 4fda4af 234167: 05345f4 v: v3
1 parent ed5d881 commit d851ac6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+3035
-818
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 2662a72537111b4b486813bc284ff560a3ec3bc7
26+
refs/heads/beta: d89a10b0a6ae1763ade69ff2fff04aa84cb766b6
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 370fe2786109360f7c35b8ba552b83b773dd71d6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/configure

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,28 @@ then
885885
CFG_DISABLE_JEMALLOC=1
886886
fi
887887

888+
# default gcc version under OpenBSD maybe too old, try using egcc, which is a
889+
# gcc version from ports
890+
if [ $CFG_OSTYPE = unknown-openbsd ]
891+
then
892+
if [ $("$CFG_GCC" --version 2>&1 | grep -c ' 4\.[0-6]') -ne 0 ]; then
893+
step_msg "older GCC found, try with egcc instead"
894+
895+
# probe again but using egcc
896+
probe CFG_GCC egcc
897+
898+
# and use egcc/eg++ for CC/CXX too if it was found
899+
# (but user setting has priority)
900+
if [ -n "$CFG_GCC" ]; then
901+
CC="${CC:-egcc}"
902+
CXX="${CXX:-eg++}"
903+
fi
904+
fi
905+
906+
step_msg "on OpenBSD, disabling jemalloc"
907+
CFG_DISABLE_JEMALLOC=1
908+
fi
909+
888910
# OS X 10.9, gcc is actually clang. This can cause some confusion in the build
889911
# system, so if we find that gcc is clang, we should just use clang directly.
890912
if [ $CFG_OSTYPE = apple-darwin -a -z "$CFG_ENABLE_CLANG" ]
@@ -956,7 +978,7 @@ then
956978
LLVM_VERSION=$($LLVM_CONFIG --version)
957979

958980
case $LLVM_VERSION in
959-
(3.[5-7]*)
981+
(3.[5-8]*)
960982
msg "found ok version of LLVM: $LLVM_VERSION"
961983
;;
962984
(*)
@@ -1030,7 +1052,7 @@ then
10301052
esac
10311053
else
10321054
case $CFG_CLANG_VERSION in
1033-
(3.2* | 3.3* | 3.4* | 3.5* | 3.6* | 3.7*)
1055+
(3.2* | 3.3* | 3.4* | 3.5* | 3.6* | 3.7* | 3.8*)
10341056
step_msg "found ok version of CLANG: $CFG_CLANG_VERSION"
10351057
;;
10361058
(*)

branches/beta/src/doc/nomicon/destructors.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,16 @@ this is totally fine.
2626
For instance, a custom implementation of `Box` might write `Drop` like this:
2727

2828
```rust
29-
#![feature(heap_api, core_intrinsics, unique)]
29+
#![feature(alloc, heap_api, core_intrinsics, unique)]
30+
31+
extern crate alloc;
3032

31-
use std::rt::heap;
3233
use std::ptr::Unique;
3334
use std::intrinsics::drop_in_place;
3435
use std::mem;
3536

37+
use alloc::heap;
38+
3639
struct Box<T>{ ptr: Unique<T> }
3740

3841
impl<T> Drop for Box<T> {
@@ -45,6 +48,7 @@ impl<T> Drop for Box<T> {
4548
}
4649
}
4750
}
51+
# fn main() {}
4852
```
4953

5054
and this works fine because when Rust goes to drop the `ptr` field it just sees
@@ -54,13 +58,16 @@ use-after-free the `ptr` because when drop exits, it becomes inacessible.
5458
However this wouldn't work:
5559

5660
```rust
57-
#![feature(heap_api, core_intrinsics, unique)]
61+
#![feature(alloc, heap_api, core_intrinsics, unique)]
62+
63+
extern crate alloc;
5864

59-
use std::rt::heap;
6065
use std::ptr::Unique;
6166
use std::intrinsics::drop_in_place;
6267
use std::mem;
6368

69+
use alloc::heap;
70+
6471
struct Box<T>{ ptr: Unique<T> }
6572

6673
impl<T> Drop for Box<T> {
@@ -87,6 +94,7 @@ impl<T> Drop for SuperBox<T> {
8794
}
8895
}
8996
}
97+
# fn main() {}
9098
```
9199

92100
After we deallocate the `box`'s ptr in SuperBox's destructor, Rust will
@@ -129,13 +137,16 @@ The classic safe solution to overriding recursive drop and allowing moving out
129137
of Self during `drop` is to use an Option:
130138

131139
```rust
132-
#![feature(heap_api, core_intrinsics, unique)]
140+
#![feature(alloc, heap_api, core_intrinsics, unique)]
141+
142+
extern crate alloc;
133143

134-
use std::rt::heap;
135144
use std::ptr::Unique;
136145
use std::intrinsics::drop_in_place;
137146
use std::mem;
138147

148+
use alloc::heap;
149+
139150
struct Box<T>{ ptr: Unique<T> }
140151

141152
impl<T> Drop for Box<T> {
@@ -165,6 +176,7 @@ impl<T> Drop for SuperBox<T> {
165176
}
166177
}
167178
}
179+
# fn main() {}
168180
```
169181

170182
However this has fairly odd semantics: you're saying that a field that *should*

branches/beta/src/doc/nomicon/vec-alloc.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This is perfectly fine because we already have `cap == 0` as our sentinel for no
99
allocation. We don't even need to handle it specially in almost any code because
1010
we usually need to check if `cap > len` or `len > 0` anyway. The traditional
1111
Rust value to put here is `0x01`. The standard library actually exposes this
12-
as `std::rt::heap::EMPTY`. There are quite a few places where we'll
12+
as `alloc::heap::EMPTY`. There are quite a few places where we'll
1313
want to use `heap::EMPTY` because there's no real allocation to talk about but
1414
`null` would make the compiler do bad things.
1515

@@ -20,11 +20,12 @@ the `heap` API anyway, so let's just get that dependency over with.
2020
So:
2121

2222
```rust,ignore
23-
#![feature(heap_api)]
23+
#![feature(alloc, heap_api)]
2424
25-
use std::rt::heap::EMPTY;
2625
use std::mem;
2726
27+
use alloc::heap::EMPTY;
28+
2829
impl<T> Vec<T> {
2930
fn new() -> Self {
3031
assert!(mem::size_of::<T>() != 0, "We're not ready to handle ZSTs");

branches/beta/src/doc/nomicon/vec-final.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22

33
```rust
44
#![feature(unique)]
5-
#![feature(heap_api)]
5+
#![feature(alloc, heap_api)]
6+
7+
extern crate alloc;
68

79
use std::ptr::{Unique, self};
8-
use std::rt::heap;
910
use std::mem;
1011
use std::ops::{Deref, DerefMut};
1112
use std::marker::PhantomData;
1213

13-
14-
15-
14+
use alloc::heap;
1615

1716
struct RawVec<T> {
1817
ptr: Unique<T>,

0 commit comments

Comments
 (0)