Skip to content

Commit 3dcf1ac

Browse files
committed
---
yaml --- r: 227839 b: refs/heads/try c: 225b116 h: refs/heads/master i: 227837: d3dc567 227835: a56914f 227831: fc1254e 227823: 879475c 227807: 7c5a9da 227775: d208b7f 227711: 8160d56 227583: dd48252 227327: bdc63d0 v: v3
1 parent 20f6e4e commit 3dcf1ac

File tree

52 files changed

+739
-565
lines changed

Some content is hidden

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

52 files changed

+739
-565
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: aca2057ed5fb7af3f8905b2bc01f72fa001c35c8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: b70d1c601d2dbbe1901eba2a745c9cbe49bb3ad1
4+
refs/heads/try: 225b116829ef76b72f01c2ebf718259c20aa7e14
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/RELEASES.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ Highlights
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 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].
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].
1920
* Thanks to multiple [improvements][sk] to [type checking][pre], as
2021
well as other work, the time to bootstrap the compiler decreased by
2122
32%.
@@ -87,7 +88,7 @@ Misc
8788
[`IntoIterator`]: http://doc.rust-lang.org/nightly/std/iter/trait.IntoIterator.html
8889
[`From`]: http://doc.rust-lang.org/nightly/std/convert/trait.From.html
8990
[rf]: https://github.com/rust-lang/rust/pull/24491
90-
[err-index]: http://doc.rust-lang.org/error-index.html
91+
[err]: http://doc.rust-lang.org/error-index.html
9192
[sk]: https://github.com/rust-lang/rust/pull/24615
9293
[pre]: https://github.com/rust-lang/rust/pull/25323
9394
[file]: https://github.com/rust-lang/rust/pull/24598

branches/try/configure

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -899,18 +899,6 @@ then
899899
fi
900900
fi
901901

902-
# If the clang isn't already enabled, check for GCC, and if it is missing, turn
903-
# on clang as a backup.
904-
if [ -z "$CFG_ENABLE_CLANG" ]
905-
then
906-
CFG_GCC_VERSION=$("$CFG_GCC" --version 2>&1)
907-
if [ $? -ne 0 ]
908-
then
909-
step_msg "GCC not installed, will try using Clang"
910-
CFG_ENABLE_CLANG=1
911-
fi
912-
fi
913-
914902
# Okay, at this point, we have made up our minds about whether we are
915903
# going to force CFG_ENABLE_CLANG or not; save the setting if so.
916904
if [ ! -z "$CFG_ENABLE_CLANG" ]
@@ -932,7 +920,7 @@ then
932920
LLVM_VERSION=$($LLVM_CONFIG --version)
933921

934922
case $LLVM_VERSION in
935-
(3.[5-7]*)
923+
(3.[5-6]*)
936924
msg "found ok version of LLVM: $LLVM_VERSION"
937925
;;
938926
(*)
@@ -1049,14 +1037,6 @@ for target_file in ${CFG_SRC_DIR}mk/cfg/*.mk; do
10491037
CFG_SUPPORTED_TARGET="${CFG_SUPPORTED_TARGET} $(basename "$target_file" .mk)"
10501038
done
10511039

1052-
# copy build-triples to host-triples so that builds are a subset of hosts
1053-
V_TEMP=""
1054-
for i in $CFG_BUILD $CFG_HOST;
1055-
do
1056-
echo "$V_TEMP" | grep -qF $i || V_TEMP="$V_TEMP${V_TEMP:+ }$i"
1057-
done
1058-
CFG_HOST=$V_TEMP
1059-
10601040
# copy host-triples to target-triples so that hosts are a subset of targets
10611041
V_TEMP=""
10621042
for i in $CFG_HOST $CFG_TARGET;

branches/try/mk/main.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
######################################################################
1414

1515
# The version number
16-
CFG_RELEASE_NUM=1.3.0
16+
CFG_RELEASE_NUM=1.2.0
1717

1818
# An optional number to put after the label, e.g. '.2' -> '-beta.2'
1919
# NB Make sure it starts with a dot to conform to semver pre-release

branches/try/src/doc/style/features/traits/generics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ explicitly implement to be used by this generic function.
2929
explicit conversions or other method calls would usually be necessary. See the
3030
[overloading/implicits use case](#use-case:-limited-overloading-and/or-implicit-conversions)
3131
below.
32-
* _Precise types_. Because generics give a _name_ to the specific type
32+
* _Precise types_. Because generic give a _name_ to the specific type
3333
implementing a trait, it is possible to be precise about places where that
3434
exact type is required or produced. For example, a function
3535

branches/try/src/doc/trpl/academic-research.md

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -42,32 +42,5 @@ Recommended for inspiration and a better understanding of Rust's background.
4242

4343
### Papers *about* Rust
4444

45-
* [GPU Programming in Rust: Implementing High Level Abstractions in a
46-
Systems Level
47-
Language](http://www.cs.indiana.edu/~eholk/papers/hips2013.pdf). Early GPU work by Eric Holk.
48-
* [Parallel closures: a new twist on an old
49-
idea](https://www.usenix.org/conference/hotpar12/parallel-closures-new-twist-old-idea)
50-
- not exactly about rust, but by nmatsakis
51-
* [Patina: A Formalization of the Rust Programming
52-
Language](ftp://ftp.cs.washington.edu/tr/2015/03/UW-CSE-15-03-02.pdf). Early
53-
formalization of a subset of the type system, by Eric Reed.
54-
* [Experience Report: Developing the Servo Web Browser Engine using
55-
Rust](http://arxiv.org/abs/1505.07383). By Lars Bergstrom.
56-
* [Implementing a Generic Radix Trie in
57-
Rust](https://michaelsproul.github.io/rust_radix_paper/rust-radix-sproul.pdf). Undergrad
58-
paper by Michael Sproul.
59-
* [Reenix: Implementing a Unix-Like Operating System in
60-
Rust](http://scialex.github.io/reenix.pdf). Undergrad paper by Alex
61-
Light.
62-
* [Evaluation of performance and productivity metrics of potential
63-
programming languages in the HPC environment](). Bachelor's thesis by
64-
Florian Wilkens. Compares C, Go and Rust.
65-
* [Nom, a byte oriented, streaming, zero copy, parser combinators library
66-
in Rust](http://spw15.langsec.org/papers/couprie-nom.pdf). By
67-
Geoffroy Couprie, research for VLC.
68-
* [Graph-Based Higher-Order Intermediate
69-
Representation](http://compilers.cs.uni-saarland.de/papers/lkh15_cgo.pdf). An
70-
experimental IR implemented in Impala, a Rust-like language.
71-
* [Code Refinement of Stencil
72-
Codes](http://compilers.cs.uni-saarland.de/papers/ppl14_web.pdf). Another
73-
paper using Impala.
45+
* [GPU programming in Rust](http://www.cs.indiana.edu/~eholk/papers/hips2013.pdf)
46+
* [Parallel closures: a new twist on an old idea](https://www.usenix.org/conference/hotpar12/parallel-closures-new-twist-old-idea) - not exactly about rust, but by nmatsakis

branches/try/src/doc/trpl/documentation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ we could have added more explanation in a new paragraph.
102102
#### Special sections
103103

104104
Next, are special sections. These are indicated with a header, `#`. There
105-
are four kinds of headers that are commonly used. They aren't special syntax,
105+
are three kinds of headers that are commonly used. They aren't special syntax,
106106
just convention, for now.
107107

108108
```rust
@@ -144,7 +144,7 @@ responsible for upholding.
144144
# fn foo() {}
145145
```
146146

147-
Fourth, `Examples`. Include one or more examples of using your function or
147+
Third, `Examples`. Include one or more examples of using your function or
148148
method, and your users will love you for it. These examples go inside of
149149
code block annotations, which we'll talk about in a moment, and can have
150150
more than one section:

branches/try/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::sync::mpsc`) to forward data from the C
313-
thread that invoked the callback into a Rust thread.
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.
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/try/src/doc/trpl/installing-rust.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ $ sudo /usr/local/lib/rustlib/uninstall.sh
4141
If you used the Windows installer, just re-run the `.msi` and it will give you
4242
an uninstall option.
4343

44-
## That disclaimer we promised
45-
4644
Some people, and somewhat rightfully so, get very upset when we tell you to
4745
`curl | sh`. Basically, when you do this, you are trusting that the good
4846
people who maintain Rust aren't going to hack your computer and do bad things.
@@ -52,8 +50,6 @@ binary downloads][install-page].
5250

5351
[from-source]: https://github.com/rust-lang/rust#building-from-source
5452

55-
## Platform support
56-
5753
Oh, we should also mention the officially supported platforms:
5854

5955
* Windows (7, 8, Server 2008 R2)
@@ -70,8 +66,6 @@ integrated as the Linux/OS X experience is. We're working on it! If anything
7066
does not work, it is a bug. Please let us know if that happens. Each and every
7167
commit is tested against Windows just like any other platform.
7268

73-
## After installation
74-
7569
If you've got Rust installed, you can open up a shell, and type this:
7670

7771
```bash

branches/try/src/etc/unicode.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,13 @@ def emit_conversions_module(f, to_upper, to_lower, to_title):
372372
}
373373
}
374374
375+
pub fn to_title(c: char) -> [char; 3] {
376+
match bsearch_case_table(c, to_titlecase_table) {
377+
None => [c, '\\0', '\\0'],
378+
Some(index) => to_titlecase_table[index].1
379+
}
380+
}
381+
375382
fn bsearch_case_table(c: char, table: &'static [(char, [char; 3])]) -> Option<usize> {
376383
match table.binary_search_by(|&(key, _)| {
377384
if c == key { Equal }
@@ -393,6 +400,9 @@ def emit_conversions_module(f, to_upper, to_lower, to_title):
393400
emit_table(f, "to_uppercase_table",
394401
sorted(to_upper.iteritems(), key=operator.itemgetter(0)),
395402
is_pub=False, t_type = t_type, pfun=pfun)
403+
emit_table(f, "to_titlecase_table",
404+
sorted(to_title.iteritems(), key=operator.itemgetter(0)),
405+
is_pub=False, t_type = t_type, pfun=pfun)
396406
f.write("}\n\n")
397407

398408
def emit_grapheme_module(f, grapheme_table, grapheme_cats):

branches/try/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/try/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/try/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/try/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(

0 commit comments

Comments
 (0)