Skip to content

Commit 20b2a7a

Browse files
committed
---
yaml --- r: 219611 b: refs/heads/snap-stage3 c: d3c03d0 h: refs/heads/master i: 219609: 817ac9a 219607: 328ab66 v: v3
1 parent f848518 commit 20b2a7a

File tree

29 files changed

+222
-151
lines changed

29 files changed

+222
-151
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: c044791d80ea0dc5c4b57b6030a67b69f8510239
3-
refs/heads/snap-stage3: 759a7f1f66490191a6f809c9709151d6d27cea87
3+
refs/heads/snap-stage3: d3c03d098747be06286f2aebc1e76f8c08352fdf
44
refs/heads/try: b53c0f93eedcdedd4fd89bccc5a3a09d1c5cd23e
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/snap-stage3/RELEASES.md

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,28 @@ Version 1.1.0 (June 2015)
66
Highlights
77
----------
88

9-
* The [`std::fs` module has been expanded][fs-expand] to expand the set of
9+
* The [`std::fs` module has been expanded][fs] to expand the set of
1010
functionality exposed:
1111
* `DirEntry` now supports optimizations like `file_type` and `metadata` which
1212
don't incur a syscall on some platforms.
1313
* A `symlink_metadata` function has been added.
1414
* The `fs::Metadata` structure now lowers to its OS counterpart, providing
1515
access to all underlying information.
16-
* The compiler contains extended explanations of many errors. When it
17-
emits such an error it also suggests using the `--explain` flag to
18-
read the extended explanations, which are also [cataloged on the web
19-
site][err].
16+
* The compiler now contains extended explanations of many errors. When an error
17+
with an explanation occurs the compiler suggests using the `--explain` flag
18+
to read the explanation. Error explanations are also [available online][err-index].
2019
* Thanks to multiple [improvements][sk] to [type checking][pre], as
2120
well as other work, the time to bootstrap the compiler decreased by
2221
32%.
2322

2423
Libraries
2524
---------
2625

27-
* The `str::split_whitespace` method splits a string on unicode
26+
* The [`str::split_whitespace`] method splits a string on unicode
2827
whitespace boundaries.
2928
* On both Windows and Unix, new extension traits provide conversion of
3029
I/O types to and from the underlying system handles. On Unix, these
31-
traits are [`FrowRawFd`] and [`AsRawFd`], on Windows `FromRawHandle`
30+
traits are [`FromRawFd`] and [`AsRawFd`], on Windows `FromRawHandle`
3231
and `AsRawHandle`. These are implemented for `File`, `TcpStream`,
3332
`TcpListener`, and `UpdSocket`. Further implementations for
3433
`std::process` will be stabilized later.
@@ -80,15 +79,14 @@ Misc
8079
* [The `drop_with_repr_extern` lint warns about mixing `repr(C)`
8180
with `Drop`][drop].
8281

83-
[`split_whitespace`]: http://doc.rust-lang.org/nightly/std/primitive.str.html#method.split_whitespace
84-
[`Iterator::cloned`]: http://doc.rust-lang.org/nightly/core/iter/trait.Iterator.html#method.cloned
82+
[`str::split_whitespace`]: http://doc.rust-lang.org/nightly/std/primitive.str.html#method.split_whitespace
8583
[`FromRawFd`]: http://doc.rust-lang.org/nightly/std/os/unix/io/trait.FromRawFd.html
8684
[`AsRawFd`]: http://doc.rust-lang.org/nightly/std/os/unix/io/trait.AsRawFd.html
8785
[`std::os::unix::symlink`]: http://doc.rust-lang.org/nightly/std/os/unix/fs/fn.symlink.html
8886
[`IntoIterator`]: http://doc.rust-lang.org/nightly/std/iter/trait.IntoIterator.html
8987
[`From`]: http://doc.rust-lang.org/nightly/std/convert/trait.From.html
9088
[rf]: https://github.com/rust-lang/rust/pull/24491
91-
[err]: http://doc.rust-lang.org/error-index.html
89+
[err-index]: http://doc.rust-lang.org/error-index.html
9290
[sk]: https://github.com/rust-lang/rust/pull/24615
9391
[pre]: https://github.com/rust-lang/rust/pull/25323
9492
[file]: https://github.com/rust-lang/rust/pull/24598
@@ -251,7 +249,6 @@ Misc
251249
[sw]: https://github.com/rust-lang/rfcs/blob/master/text/1054-str-words.md
252250
[th]: https://github.com/rust-lang/rfcs/blob/master/text/0909-move-thread-local-to-std-thread.md
253251
[send-rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0458-send-improvements.md
254-
[scoped]: http://static.rust-lang.org/doc/master/std/thread/fn.scoped.html
255252
[moar-ufcs]: https://github.com/rust-lang/rust/pull/22172
256253
[prim-inherent]: https://github.com/rust-lang/rust/pull/23104
257254
[overflow]: https://github.com/rust-lang/rfcs/blob/master/text/0560-integer-overflow.md
@@ -261,12 +258,10 @@ Misc
261258
[string-pattern]: https://github.com/rust-lang/rust/pull/22466
262259
[oibit-final]: https://github.com/rust-lang/rust/pull/21689
263260
[reflect]: https://github.com/rust-lang/rust/pull/23712
264-
[debug-builder]: https://github.com/rust-lang/rfcs/blob/master/text/0640-debug-improvements.md
265261
[conversion]: https://github.com/rust-lang/rfcs/pull/529
266262
[num-traits]: https://github.com/rust-lang/rust/pull/23549
267263
[index-value]: https://github.com/rust-lang/rust/pull/23601
268264
[dropck]: https://github.com/rust-lang/rfcs/pull/769
269-
[fundamental]: https://github.com/rust-lang/rfcs/pull/1023
270265
[ci-compare]: https://gist.github.com/brson/a30a77836fbec057cbee
271266
[fn-inherit]: https://github.com/rust-lang/rust/pull/23282
272267
[fn-blanket]: https://github.com/rust-lang/rust/pull/23895
@@ -369,7 +364,6 @@ Version 1.0.0-alpha.2 (February 2015)
369364
[osstr]: https://github.com/rust-lang/rust/pull/21488
370365
[osstr-rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0517-io-os-reform.md
371366
[Self]: https://github.com/rust-lang/rust/pull/22158
372-
[ufcs]: https://github.com/rust-lang/rust/pull/21077
373367
[ufcs-rfc]: https://github.com/rust-lang/rfcs/blob/master/text/0132-ufcs.md
374368
[un]: https://github.com/rust-lang/rust/pull/22256
375369

branches/snap-stage3/src/doc/trpl/ffi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,8 @@ and invokes callbacks from there.
309309
In these cases access to Rust data structures inside the callbacks is
310310
especially unsafe and proper synchronization mechanisms must be used.
311311
Besides classical synchronization mechanisms like mutexes, one possibility in
312-
Rust is to use channels (in `std::comm`) to forward data from the C thread
313-
that invoked the callback into a Rust thread.
312+
Rust is to use channels (in `std::sync::mpsc`) to forward data from the C
313+
thread that invoked the callback into a Rust thread.
314314
315315
If an asynchronous callback targets a special object in the Rust address space
316316
it is also absolutely necessary that no more callbacks are performed by the

branches/snap-stage3/src/liballoc/arc.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ use core::atomic;
7777
use core::atomic::Ordering::{Relaxed, Release, Acquire, SeqCst};
7878
use core::fmt;
7979
use core::cmp::Ordering;
80-
use core::mem::{min_align_of_val, size_of_val};
80+
use core::mem::{align_of_val, size_of_val};
8181
use core::intrinsics::drop_in_place;
8282
use core::mem;
8383
use core::nonzero::NonZero;
@@ -241,7 +241,7 @@ impl<T: ?Sized> Arc<T> {
241241

242242
if self.inner().weak.fetch_sub(1, Release) == 1 {
243243
atomic::fence(Acquire);
244-
deallocate(ptr as *mut u8, size_of_val(&*ptr), min_align_of_val(&*ptr))
244+
deallocate(ptr as *mut u8, size_of_val(&*ptr), align_of_val(&*ptr))
245245
}
246246
}
247247
}
@@ -565,7 +565,7 @@ impl<T: ?Sized> Drop for Weak<T> {
565565
atomic::fence(Acquire);
566566
unsafe { deallocate(ptr as *mut u8,
567567
size_of_val(&*ptr),
568-
min_align_of_val(&*ptr)) }
568+
align_of_val(&*ptr)) }
569569
}
570570
}
571571
}

branches/snap-stage3/src/liballoc/boxed.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ impl<T : ?Sized> Box<T> {
116116
/// of `T` and releases memory. Since the way `Box` allocates and
117117
/// releases memory is unspecified, the only valid pointer to pass
118118
/// to this function is the one taken from another `Box` with
119-
/// `boxed::into_raw` function.
119+
/// `Box::into_raw` function.
120120
///
121121
/// Function is unsafe, because improper use of this function may
122122
/// lead to memory problems like double-free, for example if the
@@ -140,10 +140,8 @@ impl<T : ?Sized> Box<T> {
140140
/// # Examples
141141
/// ```
142142
/// # #![feature(box_raw)]
143-
/// use std::boxed;
144-
///
145143
/// let seventeen = Box::new(17u32);
146-
/// let raw = boxed::into_raw(seventeen);
144+
/// let raw = Box::into_raw(seventeen);
147145
/// let boxed_again = unsafe { Box::from_raw(raw) };
148146
/// ```
149147
#[unstable(feature = "box_raw", reason = "may be renamed")]

branches/snap-stage3/src/liballoc/boxed_test.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ fn deref() {
7676

7777
#[test]
7878
fn raw_sized() {
79+
let x = Box::new(17);
80+
let p = Box::into_raw(x);
7981
unsafe {
80-
let x = Box::new(17);
81-
let p = boxed::into_raw(x);
8282
assert_eq!(17, *p);
8383
*p = 19;
8484
let y = Box::from_raw(p);
@@ -105,9 +105,9 @@ fn raw_trait() {
105105
}
106106
}
107107

108+
let x: Box<Foo> = Box::new(Bar(17));
109+
let p = Box::into_raw(x);
108110
unsafe {
109-
let x: Box<Foo> = Box::new(Bar(17));
110-
let p = boxed::into_raw(x);
111111
assert_eq!(17, (*p).get());
112112
(*p).set(19);
113113
let y: Box<Foo> = Box::from_raw(p);

branches/snap-stage3/src/liballoc/rc.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ use core::fmt;
162162
use core::hash::{Hasher, Hash};
163163
use core::intrinsics::{assume, drop_in_place};
164164
use core::marker::{self, Unsize};
165-
use core::mem::{self, min_align_of, size_of, min_align_of_val, size_of_val, forget};
165+
use core::mem::{self, align_of, size_of, align_of_val, size_of_val, forget};
166166
use core::nonzero::NonZero;
167167
use core::ops::{CoerceUnsized, Deref};
168168
use core::ptr;
@@ -246,7 +246,7 @@ impl<T> Rc<T> {
246246
// destruct the box and skip our Drop
247247
// we can ignore the refcounts because we know we're unique
248248
deallocate(*rc._ptr as *mut u8, size_of::<RcBox<T>>(),
249-
min_align_of::<RcBox<T>>());
249+
align_of::<RcBox<T>>());
250250
forget(rc);
251251
Ok(val)
252252
}
@@ -496,7 +496,7 @@ impl<T: ?Sized> Drop for Rc<T> {
496496
if self.weak() == 0 {
497497
deallocate(ptr as *mut u8,
498498
size_of_val(&*ptr),
499-
min_align_of_val(&*ptr))
499+
align_of_val(&*ptr))
500500
}
501501
}
502502
}
@@ -805,7 +805,7 @@ impl<T: ?Sized> Drop for Weak<T> {
805805
// the strong pointers have disappeared.
806806
if self.weak() == 0 {
807807
deallocate(ptr as *mut u8, size_of_val(&*ptr),
808-
min_align_of_val(&*ptr))
808+
align_of_val(&*ptr))
809809
}
810810
}
811811
}

branches/snap-stage3/src/libarena/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ impl<'longer_than_self> Arena<'longer_than_self> {
244244
fn alloc_copy<T, F>(&self, op: F) -> &mut T where F: FnOnce() -> T {
245245
unsafe {
246246
let ptr = self.alloc_copy_inner(mem::size_of::<T>(),
247-
mem::min_align_of::<T>());
247+
mem::align_of::<T>());
248248
let ptr = ptr as *mut T;
249249
ptr::write(&mut (*ptr), op());
250250
return &mut *ptr;
@@ -300,7 +300,7 @@ impl<'longer_than_self> Arena<'longer_than_self> {
300300
let tydesc = get_tydesc::<T>();
301301
let (ty_ptr, ptr) =
302302
self.alloc_noncopy_inner(mem::size_of::<T>(),
303-
mem::min_align_of::<T>());
303+
mem::align_of::<T>());
304304
let ty_ptr = ty_ptr as *mut usize;
305305
let ptr = ptr as *mut T;
306306
// Write in our tydesc along with a bit indicating that it
@@ -393,7 +393,7 @@ struct TypedArenaChunk<T> {
393393

394394
fn calculate_size<T>(capacity: usize) -> usize {
395395
let mut size = mem::size_of::<TypedArenaChunk<T>>();
396-
size = round_up(size, mem::min_align_of::<T>());
396+
size = round_up(size, mem::align_of::<T>());
397397
let elem_size = mem::size_of::<T>();
398398
let elems_size = elem_size.checked_mul(capacity).unwrap();
399399
size = size.checked_add(elems_size).unwrap();
@@ -405,7 +405,7 @@ impl<T> TypedArenaChunk<T> {
405405
unsafe fn new(next: *mut TypedArenaChunk<T>, capacity: usize)
406406
-> *mut TypedArenaChunk<T> {
407407
let size = calculate_size::<T>(capacity);
408-
let chunk = allocate(size, mem::min_align_of::<TypedArenaChunk<T>>())
408+
let chunk = allocate(size, mem::align_of::<TypedArenaChunk<T>>())
409409
as *mut TypedArenaChunk<T>;
410410
if chunk.is_null() { alloc::oom() }
411411
(*chunk).next = next;
@@ -431,7 +431,7 @@ impl<T> TypedArenaChunk<T> {
431431
let size = calculate_size::<T>(self.capacity);
432432
let self_ptr: *mut TypedArenaChunk<T> = self;
433433
deallocate(self_ptr as *mut u8, size,
434-
mem::min_align_of::<TypedArenaChunk<T>>());
434+
mem::align_of::<TypedArenaChunk<T>>());
435435
if !next.is_null() {
436436
let capacity = (*next).capacity;
437437
(*next).destroy(capacity);
@@ -444,7 +444,7 @@ impl<T> TypedArenaChunk<T> {
444444
let this: *const TypedArenaChunk<T> = self;
445445
unsafe {
446446
mem::transmute(round_up(this.offset(1) as usize,
447-
mem::min_align_of::<T>()))
447+
mem::align_of::<T>()))
448448
}
449449
}
450450

branches/snap-stage3/src/libcollections/btree/node.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,12 @@ fn test_offset_calculation() {
163163
}
164164

165165
fn calculate_allocation_generic<K, V>(capacity: usize, is_leaf: bool) -> (usize, usize) {
166-
let (keys_size, keys_align) = (capacity * mem::size_of::<K>(), mem::min_align_of::<K>());
167-
let (vals_size, vals_align) = (capacity * mem::size_of::<V>(), mem::min_align_of::<V>());
166+
let (keys_size, keys_align) = (capacity * mem::size_of::<K>(), mem::align_of::<K>());
167+
let (vals_size, vals_align) = (capacity * mem::size_of::<V>(), mem::align_of::<V>());
168168
let (edges_size, edges_align) = if is_leaf {
169169
(0, 1)
170170
} else {
171-
((capacity + 1) * mem::size_of::<Node<K, V>>(), mem::min_align_of::<Node<K, V>>())
171+
((capacity + 1) * mem::size_of::<Node<K, V>>(), mem::align_of::<Node<K, V>>())
172172
};
173173

174174
calculate_allocation(
@@ -181,11 +181,11 @@ fn calculate_allocation_generic<K, V>(capacity: usize, is_leaf: bool) -> (usize,
181181
fn calculate_offsets_generic<K, V>(capacity: usize, is_leaf: bool) -> (usize, usize) {
182182
let keys_size = capacity * mem::size_of::<K>();
183183
let vals_size = capacity * mem::size_of::<V>();
184-
let vals_align = mem::min_align_of::<V>();
184+
let vals_align = mem::align_of::<V>();
185185
let edges_align = if is_leaf {
186186
1
187187
} else {
188-
mem::min_align_of::<Node<K, V>>()
188+
mem::align_of::<Node<K, V>>()
189189
};
190190

191191
calculate_offsets(

branches/snap-stage3/src/libcollections/vec.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ impl<T> Vec<T> {
219219
} else {
220220
let size = capacity.checked_mul(mem::size_of::<T>())
221221
.expect("capacity overflow");
222-
let ptr = unsafe { allocate(size, mem::min_align_of::<T>()) };
222+
let ptr = unsafe { allocate(size, mem::align_of::<T>()) };
223223
if ptr.is_null() { ::alloc::oom() }
224224
unsafe { Vec::from_raw_parts(ptr as *mut T, 0, capacity) }
225225
}
@@ -393,7 +393,7 @@ impl<T> Vec<T> {
393393
let ptr = reallocate(*self.ptr as *mut u8,
394394
self.cap * mem::size_of::<T>(),
395395
self.len * mem::size_of::<T>(),
396-
mem::min_align_of::<T>()) as *mut T;
396+
mem::align_of::<T>()) as *mut T;
397397
if ptr.is_null() { ::alloc::oom() }
398398
self.ptr = Unique::new(ptr);
399399
}
@@ -866,9 +866,9 @@ impl<T> Vec<T> {
866866
// FIXME: Assert statically that the types `T` and `U` have the
867867
// same minimal alignment in case they are not zero-sized.
868868

869-
// These asserts are necessary because the `min_align_of` of the
869+
// These asserts are necessary because the `align_of` of the
870870
// types are passed to the allocator by `Vec`.
871-
assert!(mem::min_align_of::<T>() == mem::min_align_of::<U>());
871+
assert!(mem::align_of::<T>() == mem::align_of::<U>());
872872

873873
// This `as isize` cast is safe, because the size of the elements of the
874874
// vector is not 0, and:
@@ -1269,9 +1269,9 @@ impl<T> Vec<T> {
12691269
#[inline(never)]
12701270
unsafe fn alloc_or_realloc<T>(ptr: *mut T, old_size: usize, size: usize) -> *mut T {
12711271
if old_size == 0 {
1272-
allocate(size, mem::min_align_of::<T>()) as *mut T
1272+
allocate(size, mem::align_of::<T>()) as *mut T
12731273
} else {
1274-
reallocate(ptr as *mut u8, old_size, size, mem::min_align_of::<T>()) as *mut T
1274+
reallocate(ptr as *mut u8, old_size, size, mem::align_of::<T>()) as *mut T
12751275
}
12761276
}
12771277

@@ -1280,7 +1280,7 @@ unsafe fn dealloc<T>(ptr: *mut T, len: usize) {
12801280
if mem::size_of::<T>() != 0 {
12811281
deallocate(ptr as *mut u8,
12821282
len * mem::size_of::<T>(),
1283-
mem::min_align_of::<T>())
1283+
mem::align_of::<T>())
12841284
}
12851285
}
12861286

branches/snap-stage3/src/libcollections/vec_deque.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl<T> Drop for VecDeque<T> {
6767
if mem::size_of::<T>() != 0 {
6868
heap::deallocate(*self.ptr as *mut u8,
6969
self.cap * mem::size_of::<T>(),
70-
mem::min_align_of::<T>())
70+
mem::align_of::<T>())
7171
}
7272
}
7373
}
@@ -172,7 +172,7 @@ impl<T> VecDeque<T> {
172172

173173
let ptr = unsafe {
174174
if mem::size_of::<T>() != 0 {
175-
let ptr = heap::allocate(size, mem::min_align_of::<T>()) as *mut T;;
175+
let ptr = heap::allocate(size, mem::align_of::<T>()) as *mut T;;
176176
if ptr.is_null() { ::alloc::oom() }
177177
Unique::new(ptr)
178178
} else {
@@ -340,7 +340,7 @@ impl<T> VecDeque<T> {
340340
let ptr = heap::reallocate(*self.ptr as *mut u8,
341341
old,
342342
new,
343-
mem::min_align_of::<T>()) as *mut T;
343+
mem::align_of::<T>()) as *mut T;
344344
if ptr.is_null() { ::alloc::oom() }
345345
self.ptr = Unique::new(ptr);
346346
}
@@ -460,7 +460,7 @@ impl<T> VecDeque<T> {
460460
let ptr = heap::reallocate(*self.ptr as *mut u8,
461461
old,
462462
new_size,
463-
mem::min_align_of::<T>()) as *mut T;
463+
mem::align_of::<T>()) as *mut T;
464464
if ptr.is_null() { ::alloc::oom() }
465465
self.ptr = Unique::new(ptr);
466466
}

0 commit comments

Comments
 (0)