Skip to content

Commit 14666e8

Browse files
committed
---
yaml --- r: 180207 b: refs/heads/master c: f27b3e2 h: refs/heads/master i: 180205: 93203ec 180203: 218c836 180199: f2def3f 180191: 1ac0da9 v: v3
1 parent 92c710d commit 14666e8

File tree

190 files changed

+652
-5995
lines changed

Some content is hidden

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

190 files changed

+652
-5995
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 3ef8ff1f81107b42840a695725e1a0869c163355
2+
refs/heads/master: f27b3e251cc44464564cc02f7fd5b6d3176204cc
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: e29f42025513374f1a88404491d1b40386acf994
55
refs/heads/try: ccf8fedf1cffcb8f6f3581d53d220039e192fe77

trunk/src/compiletest/compiletest.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#![feature(collections)]
1515
#![feature(int_uint)]
1616
#![feature(io)]
17+
#![feature(os)]
1718
#![feature(path)]
1819
#![feature(rustc_private)]
1920
#![feature(slicing_syntax, unboxed_closures)]
@@ -47,7 +48,8 @@ pub mod common;
4748
pub mod errors;
4849

4950
pub fn main() {
50-
let config = parse_config(env::args().collect());
51+
let args = env::args().map(|s| s.into_string().unwrap()).collect();;
52+
let config = parse_config(args);
5153

5254
if config.valgrind_path.is_none() && config.force_valgrind {
5355
panic!("Can't find Valgrind to run Valgrind tests");

trunk/src/compiletest/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub fn make_new_path(path: &str) -> String {
4040

4141
// Windows just uses PATH as the library search path, so we have to
4242
// maintain the current value while adding our own
43-
match env::var(lib_path_env_var()) {
43+
match env::var_string(lib_path_env_var()) {
4444
Ok(curr) => {
4545
format!("{}{}{}", path, path_div(), curr)
4646
}

trunk/src/doc/reference.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3196,7 +3196,6 @@ stands for a *single* data field, whereas a wildcard `..` stands for *all* the
31963196
fields of a particular variant. For example:
31973197

31983198
```
3199-
#![feature(box_patterns)]
32003199
#![feature(box_syntax)]
32013200
enum List<X> { Nil, Cons(X, Box<List<X>>) }
32023201
@@ -3260,7 +3259,6 @@ the inside of the match.
32603259
An example of a `match` expression:
32613260

32623261
```
3263-
#![feature(box_patterns)]
32643262
#![feature(box_syntax)]
32653263
# fn process_pair(a: i32, b: i32) { }
32663264
# fn process_ten() { }
@@ -3296,7 +3294,6 @@ Subpatterns can also be bound to variables by the use of the syntax `variable @
32963294
subpattern`. For example:
32973295

32983296
```
3299-
#![feature(box_patterns)]
33003297
#![feature(box_syntax)]
33013298
33023299
enum List { Nil, Cons(uint, Box<List>) }

trunk/src/liballoc/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@
7171
#![feature(box_syntax)]
7272
#![feature(optin_builtin_traits)]
7373
#![feature(unboxed_closures)]
74-
#![feature(unsafe_no_drop_flag)]
7574
#![feature(core)]
7675
#![feature(hash)]
7776
#![cfg_attr(all(not(feature = "external_funcs"), not(feature = "external_crate")),

trunk/src/libarena/lib.rs

Lines changed: 21 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ use std::cell::{Cell, RefCell};
4242
use std::cmp;
4343
use std::intrinsics::{TyDesc, get_tydesc};
4444
use std::intrinsics;
45-
use std::marker;
4645
use std::mem;
4746
use std::num::{Int, UnsignedInt};
4847
use std::ptr;
@@ -89,29 +88,27 @@ impl Chunk {
8988
/// than objects without destructors. This reduces overhead when initializing
9089
/// plain-old-data (`Copy` types) and means we don't need to waste time running
9190
/// their destructors.
92-
pub struct Arena<'longer_than_self> {
91+
pub struct Arena {
9392
// The head is separated out from the list as a unbenchmarked
9493
// microoptimization, to avoid needing to case on the list to access the
9594
// head.
9695
head: RefCell<Chunk>,
9796
copy_head: RefCell<Chunk>,
9897
chunks: RefCell<Vec<Chunk>>,
99-
_invariant: marker::InvariantLifetime<'longer_than_self>,
10098
}
10199

102-
impl<'a> Arena<'a> {
100+
impl Arena {
103101
/// Allocates a new Arena with 32 bytes preallocated.
104-
pub fn new() -> Arena<'a> {
102+
pub fn new() -> Arena {
105103
Arena::new_with_size(32)
106104
}
107105

108106
/// Allocates a new Arena with `initial_size` bytes preallocated.
109-
pub fn new_with_size(initial_size: usize) -> Arena<'a> {
107+
pub fn new_with_size(initial_size: usize) -> Arena {
110108
Arena {
111109
head: RefCell::new(chunk(initial_size, false)),
112110
copy_head: RefCell::new(chunk(initial_size, true)),
113111
chunks: RefCell::new(Vec::new()),
114-
_invariant: marker::InvariantLifetime,
115112
}
116113
}
117114
}
@@ -125,7 +122,7 @@ fn chunk(size: usize, is_copy: bool) -> Chunk {
125122
}
126123

127124
#[unsafe_destructor]
128-
impl<'longer_than_self> Drop for Arena<'longer_than_self> {
125+
impl Drop for Arena {
129126
fn drop(&mut self) {
130127
unsafe {
131128
destroy_chunk(&*self.head.borrow());
@@ -183,7 +180,7 @@ fn un_bitpack_tydesc_ptr(p: usize) -> (*const TyDesc, bool) {
183180
((p & !1) as *const TyDesc, p & 1 == 1)
184181
}
185182

186-
impl<'longer_than_self> Arena<'longer_than_self> {
183+
impl Arena {
187184
fn chunk_size(&self) -> usize {
188185
self.copy_head.borrow().capacity()
189186
}
@@ -296,7 +293,7 @@ impl<'longer_than_self> Arena<'longer_than_self> {
296293
/// Allocates a new item in the arena, using `op` to initialize the value,
297294
/// and returns a reference to it.
298295
#[inline]
299-
pub fn alloc<T:'longer_than_self, F>(&self, op: F) -> &mut T where F: FnOnce() -> T {
296+
pub fn alloc<T, F>(&self, op: F) -> &mut T where F: FnOnce() -> T {
300297
unsafe {
301298
if intrinsics::needs_drop::<T>() {
302299
self.alloc_noncopy(op)
@@ -320,6 +317,20 @@ fn test_arena_destructors() {
320317
}
321318
}
322319

320+
#[test]
321+
fn test_arena_alloc_nested() {
322+
struct Inner { value: usize }
323+
struct Outer<'a> { inner: &'a Inner }
324+
325+
let arena = Arena::new();
326+
327+
let result = arena.alloc(|| Outer {
328+
inner: arena.alloc(|| Inner { value: 10 })
329+
});
330+
331+
assert_eq!(result.inner.value, 10);
332+
}
333+
323334
#[test]
324335
#[should_fail]
325336
fn test_arena_destructors_fail() {
@@ -354,10 +365,6 @@ pub struct TypedArena<T> {
354365

355366
/// A pointer to the first arena segment.
356367
first: RefCell<*mut TypedArenaChunk<T>>,
357-
358-
/// Marker indicating that dropping the arena causes its owned
359-
/// instances of `T` to be dropped.
360-
_own: marker::PhantomData<T>,
361368
}
362369

363370
struct TypedArenaChunk<T> {
@@ -453,7 +460,6 @@ impl<T> TypedArena<T> {
453460
ptr: Cell::new((*chunk).start() as *const T),
454461
end: Cell::new((*chunk).end() as *const T),
455462
first: RefCell::new(chunk),
456-
_own: marker::PhantomData,
457463
}
458464
}
459465
}
@@ -517,41 +523,6 @@ mod tests {
517523
z: i32,
518524
}
519525

520-
#[test]
521-
fn test_arena_alloc_nested() {
522-
struct Inner { value: u8 }
523-
struct Outer<'a> { inner: &'a Inner }
524-
enum EI<'e> { I(Inner), O(Outer<'e>) }
525-
526-
struct Wrap<'a>(TypedArena<EI<'a>>);
527-
528-
impl<'a> Wrap<'a> {
529-
fn alloc_inner<F:Fn() -> Inner>(&self, f: F) -> &Inner {
530-
let r: &EI = self.0.alloc(EI::I(f()));
531-
if let &EI::I(ref i) = r {
532-
i
533-
} else {
534-
panic!("mismatch");
535-
}
536-
}
537-
fn alloc_outer<F:Fn() -> Outer<'a>>(&self, f: F) -> &Outer {
538-
let r: &EI = self.0.alloc(EI::O(f()));
539-
if let &EI::O(ref o) = r {
540-
o
541-
} else {
542-
panic!("mismatch");
543-
}
544-
}
545-
}
546-
547-
let arena = Wrap(TypedArena::new());
548-
549-
let result = arena.alloc_outer(|| Outer {
550-
inner: arena.alloc_inner(|| Inner { value: 10 }) });
551-
552-
assert_eq!(result.inner.value, 10);
553-
}
554-
555526
#[test]
556527
pub fn test_copy() {
557528
let arena = TypedArena::new();

0 commit comments

Comments
 (0)