Skip to content

Commit cf7bef6

Browse files
---
yaml --- r: 227829 b: refs/heads/try c: 47c3dc2 h: refs/heads/master i: 227827: c63f2c2 v: v3
1 parent 29838fd commit cf7bef6

File tree

33 files changed

+688
-328
lines changed

33 files changed

+688
-328
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: cfb77788ce2a38b90162113611262dc0ed0af1b9
4+
refs/heads/try: 47c3dc2e7eda06c5637685597359bb23939cbfe4
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

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: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,13 @@ we could have added more explanation in a new paragraph.
101101

102102
#### Special sections
103103

104+
```rust
105+
/// # Examples
106+
# fn foo() {}
107+
```
108+
104109
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,
110+
are three kinds of headers that are commonly used. They aren't special syntax,
106111
just convention, for now.
107112

108113
```rust
@@ -144,7 +149,7 @@ responsible for upholding.
144149
# fn foo() {}
145150
```
146151

147-
Fourth, `Examples`. Include one or more examples of using your function or
152+
Third, `Examples`. Include one or more examples of using your function or
148153
method, and your users will love you for it. These examples go inside of
149154
code block annotations, which we'll talk about in a moment, and can have
150155
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/libcollections/vec.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1482,7 +1482,7 @@ impl<T> FromIterator<T> for Vec<T> {
14821482
None => return Vec::new(),
14831483
Some(element) => {
14841484
let (lower, _) = iterator.size_hint();
1485-
let mut vector = Vec::with_capacity(lower.saturating_add(1));
1485+
let mut vector = Vec::with_capacity(1 + lower);
14861486
unsafe {
14871487
ptr::write(vector.get_unchecked_mut(0), element);
14881488
vector.set_len(1);
@@ -1570,11 +1570,10 @@ impl<T> Vec<T> {
15701570
let len = self.len();
15711571
if len == self.capacity() {
15721572
let (lower, _) = iterator.size_hint();
1573-
self.reserve(lower.saturating_add(1));
1573+
self.reserve(lower + 1);
15741574
}
15751575
unsafe {
15761576
ptr::write(self.get_unchecked_mut(len), element);
1577-
// NB can't overflow since we would have had to alloc the address space
15781577
self.set_len(len + 1);
15791578
}
15801579
}

branches/try/src/libcollectionstest/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
#![feature(append)]
12+
#![feature(bit_vec_append_split_off)]
1213
#![feature(bitset)]
1314
#![feature(bitvec)]
1415
#![feature(box_syntax)]

branches/try/src/libcoretest/char.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,29 @@ fn test_to_uppercase() {
102102
assert_eq!(upper('ᾀ'), ['Ἀ', 'Ι']);
103103
}
104104

105+
#[test]
106+
fn test_to_titlecase() {
107+
fn title(c: char) -> Vec<char> {
108+
c.to_titlecase().collect()
109+
}
110+
assert_eq!(title('a'), ['A']);
111+
assert_eq!(title('ö'), ['Ö']);
112+
assert_eq!(title('ß'), ['S', 's']); // not ẞ: Latin capital letter sharp s
113+
assert_eq!(title('ü'), ['Ü']);
114+
assert_eq!(title('💩'), ['💩']);
115+
116+
assert_eq!(title('σ'), ['Σ']);
117+
assert_eq!(title('τ'), ['Τ']);
118+
assert_eq!(title('ι'), ['Ι']);
119+
assert_eq!(title('γ'), ['Γ']);
120+
assert_eq!(title('μ'), ['Μ']);
121+
assert_eq!(title('α'), ['Α']);
122+
assert_eq!(title('ς'), ['Σ']);
123+
assert_eq!(title('DŽ'), ['Dž']);
124+
assert_eq!(title('fi'), ['F', 'i']);
125+
assert_eq!(title('ᾀ'), ['ᾈ']);
126+
}
127+
105128
#[test]
106129
fn test_is_control() {
107130
assert!('\u{0}'.is_control());

branches/try/src/liblibc/lib.rs

Lines changed: 8 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -441,12 +441,12 @@ pub mod types {
441441
pub type intmax_t = i64;
442442
pub type uintmax_t = u64;
443443
}
444-
#[cfg(any(target_arch = "mips",
444+
#[cfg(any(target_arch = "x86",
445+
target_arch = "mips",
445446
target_arch = "mipsel",
446447
target_arch = "powerpc",
447448
target_arch = "le32",
448-
all(any(target_arch = "arm", target_arch = "x86"),
449-
not(target_os = "android"))))]
449+
all(target_arch = "arm", not(target_os = "android"))))]
450450
pub mod posix88 {
451451
pub type off_t = i32;
452452
pub type dev_t = u64;
@@ -458,8 +458,7 @@ pub mod types {
458458
pub type mode_t = u32;
459459
pub type ssize_t = i32;
460460
}
461-
#[cfg(all(any(target_arch = "arm", target_arch = "x86"),
462-
target_os = "android"))]
461+
#[cfg(all(target_arch = "arm", target_os = "android"))]
463462
pub mod posix88 {
464463
pub type off_t = i32;
465464
pub type dev_t = u32;
@@ -474,8 +473,7 @@ pub mod types {
474473
#[cfg(any(target_arch = "x86",
475474
target_arch = "le32",
476475
target_arch = "powerpc",
477-
all(any(target_arch = "arm", target_arch = "x86"),
478-
not(target_os = "android"))))]
476+
all(target_arch = "arm", not(target_os = "android"))))]
479477
pub mod posix01 {
480478
use types::os::arch::c95::{c_short, c_long, time_t};
481479
use types::os::arch::posix88::{dev_t, gid_t, ino_t};
@@ -521,8 +519,7 @@ pub mod types {
521519
pub __size: [u32; 9]
522520
}
523521
}
524-
#[cfg(all(any(target_arch = "arm", target_arch = "x86"),
525-
target_os = "android"))]
522+
#[cfg(all(target_arch = "arm", target_os = "android"))]
526523
pub mod posix01 {
527524
use types::os::arch::c95::{c_uchar, c_uint, c_ulong, time_t};
528525
use types::os::arch::c99::{c_longlong, c_ulonglong};
@@ -3600,11 +3597,6 @@ pub mod consts {
36003597
pub const SHUT_RD: c_int = 0;
36013598
pub const SHUT_WR: c_int = 1;
36023599
pub const SHUT_RDWR: c_int = 2;
3603-
3604-
pub const LOCK_SH: c_int = 1;
3605-
pub const LOCK_EX: c_int = 2;
3606-
pub const LOCK_NB: c_int = 4;
3607-
pub const LOCK_UN: c_int = 8;
36083600
}
36093601
#[cfg(any(target_arch = "mips",
36103602
target_arch = "mipsel"))]
@@ -3689,11 +3681,6 @@ pub mod consts {
36893681
pub const SHUT_RD: c_int = 0;
36903682
pub const SHUT_WR: c_int = 1;
36913683
pub const SHUT_RDWR: c_int = 2;
3692-
3693-
pub const LOCK_SH: c_int = 1;
3694-
pub const LOCK_EX: c_int = 2;
3695-
pub const LOCK_NB: c_int = 4;
3696-
pub const LOCK_UN: c_int = 8;
36973684
}
36983685
#[cfg(any(target_arch = "x86",
36993686
target_arch = "x86_64",
@@ -4237,11 +4224,6 @@ pub mod consts {
42374224
pub const SHUT_RD: c_int = 0;
42384225
pub const SHUT_WR: c_int = 1;
42394226
pub const SHUT_RDWR: c_int = 2;
4240-
4241-
pub const LOCK_SH: c_int = 1;
4242-
pub const LOCK_EX: c_int = 2;
4243-
pub const LOCK_NB: c_int = 4;
4244-
pub const LOCK_UN: c_int = 8;
42454227
}
42464228
pub mod extra {
42474229
use types::os::arch::c95::c_int;
@@ -4666,11 +4648,6 @@ pub mod consts {
46664648
pub const SHUT_RD: c_int = 0;
46674649
pub const SHUT_WR: c_int = 1;
46684650
pub const SHUT_RDWR: c_int = 2;
4669-
4670-
pub const LOCK_SH: c_int = 1;
4671-
pub const LOCK_EX: c_int = 2;
4672-
pub const LOCK_NB: c_int = 4;
4673-
pub const LOCK_UN: c_int = 8;
46744651
}
46754652
pub mod extra {
46764653
use types::os::arch::c95::c_int;
@@ -5112,11 +5089,6 @@ pub mod consts {
51125089
pub const SHUT_RD: c_int = 0;
51135090
pub const SHUT_WR: c_int = 1;
51145091
pub const SHUT_RDWR: c_int = 2;
5115-
5116-
pub const LOCK_SH: c_int = 1;
5117-
pub const LOCK_EX: c_int = 2;
5118-
pub const LOCK_NB: c_int = 4;
5119-
pub const LOCK_UN: c_int = 8;
51205092
}
51215093
pub mod extra {
51225094
use types::os::arch::c95::c_int;
@@ -5944,15 +5916,13 @@ pub mod funcs {
59445916
use types::os::arch::c95::c_int;
59455917
use types::os::common::posix01::sighandler_t;
59465918

5947-
#[cfg(not(all(target_os = "android", any(target_arch = "arm",
5948-
target_arch = "x86"))))]
5919+
#[cfg(not(all(target_os = "android", target_arch = "arm")))]
59495920
extern {
59505921
pub fn signal(signum: c_int,
59515922
handler: sighandler_t) -> sighandler_t;
59525923
}
59535924

5954-
#[cfg(all(target_os = "android", any(target_arch = "arm",
5955-
target_arch = "x86")))]
5925+
#[cfg(all(target_os = "android", target_arch = "arm"))]
59565926
extern {
59575927
#[link_name = "bsd_signal"]
59585928
pub fn signal(signum: c_int,
@@ -6146,7 +6116,6 @@ pub mod funcs {
61466116
-> c_int;
61476117
pub fn realpath(pathname: *const c_char, resolved: *mut c_char)
61486118
-> *mut c_char;
6149-
pub fn flock(fd: c_int, operation: c_int) -> c_int;
61506119
}
61516120
}
61526121

@@ -6163,7 +6132,6 @@ pub mod funcs {
61636132
-> c_int;
61646133
pub fn mincore(addr: *mut c_void, len: size_t, vec: *mut c_uchar)
61656134
-> c_int;
6166-
pub fn flock(fd: c_int, operation: c_int) -> c_int;
61676135
}
61686136
}
61696137

0 commit comments

Comments
 (0)