Skip to content

Commit 9e41592

Browse files
committed
---
yaml --- r: 227832 b: refs/heads/try c: 70b2f47 h: refs/heads/master v: v3
1 parent fc1254e commit 9e41592

File tree

33 files changed

+328
-636
lines changed

33 files changed

+328
-636
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: 7b4eb1aa90e49f6d068052b6e2baa5f59336ee13
4+
refs/heads/try: 70b2f4789e10e33ed64bb92252809cd50337cbf7
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: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,6 +899,18 @@ 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+
902914
# Okay, at this point, we have made up our minds about whether we are
903915
# going to force CFG_ENABLE_CLANG or not; save the setting if so.
904916
if [ ! -z "$CFG_ENABLE_CLANG" ]
@@ -920,7 +932,7 @@ then
920932
LLVM_VERSION=$($LLVM_CONFIG --version)
921933

922934
case $LLVM_VERSION in
923-
(3.[5-6]*)
935+
(3.[5-7]*)
924936
msg "found ok version of LLVM: $LLVM_VERSION"
925937
;;
926938
(*)
@@ -1037,6 +1049,14 @@ for target_file in ${CFG_SRC_DIR}mk/cfg/*.mk; do
10371049
CFG_SUPPORTED_TARGET="${CFG_SUPPORTED_TARGET} $(basename "$target_file" .mk)"
10381050
done
10391051

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+
10401060
# copy host-triples to target-triples so that hosts are a subset of targets
10411061
V_TEMP=""
10421062
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.2.0
16+
CFG_RELEASE_NUM=1.3.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 generic give a _name_ to the specific type
32+
* _Precise types_. Because generics 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: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,32 @@ Recommended for inspiration and a better understanding of Rust's background.
4242

4343
### Papers *about* Rust
4444

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
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.

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,8 @@ we could have added more explanation in a new paragraph.
101101

102102
#### Special sections
103103

104-
```rust
105-
/// # Examples
106-
# fn foo() {}
107-
```
108-
109104
Next, are special sections. These are indicated with a header, `#`. There
110-
are three kinds of headers that are commonly used. They aren't special syntax,
105+
are four kinds of headers that are commonly used. They aren't special syntax,
111106
just convention, for now.
112107

113108
```rust
@@ -149,7 +144,7 @@ responsible for upholding.
149144
# fn foo() {}
150145
```
151146

152-
Third, `Examples`. Include one or more examples of using your function or
147+
Fourth, `Examples`. Include one or more examples of using your function or
153148
method, and your users will love you for it. These examples go inside of
154149
code block annotations, which we'll talk about in a moment, and can have
155150
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::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/try/src/doc/trpl/installing-rust.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ $ 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+
4446
Some people, and somewhat rightfully so, get very upset when we tell you to
4547
`curl | sh`. Basically, when you do this, you are trusting that the good
4648
people who maintain Rust aren't going to hack your computer and do bad things.
@@ -50,6 +52,8 @@ binary downloads][install-page].
5052

5153
[from-source]: https://github.com/rust-lang/rust#building-from-source
5254

55+
## Platform support
56+
5357
Oh, we should also mention the officially supported platforms:
5458

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

73+
## After installation
74+
6975
If you've got Rust installed, you can open up a shell, and type this:
7076

7177
```bash

branches/try/src/etc/unicode.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -372,13 +372,6 @@ 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-
382375
fn bsearch_case_table(c: char, table: &'static [(char, [char; 3])]) -> Option<usize> {
383376
match table.binary_search_by(|&(key, _)| {
384377
if c == key { Equal }
@@ -400,9 +393,6 @@ def emit_conversions_module(f, to_upper, to_lower, to_title):
400393
emit_table(f, "to_uppercase_table",
401394
sorted(to_upper.iteritems(), key=operator.itemgetter(0)),
402395
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)
406396
f.write("}\n\n")
407397

408398
def emit_grapheme_module(f, grapheme_table, grapheme_cats):

branches/try/src/libcollections/vec.rs

Lines changed: 3 additions & 2 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(1 + lower);
1485+
let mut vector = Vec::with_capacity(lower.saturating_add(1));
14861486
unsafe {
14871487
ptr::write(vector.get_unchecked_mut(0), element);
14881488
vector.set_len(1);
@@ -1570,10 +1570,11 @@ impl<T> Vec<T> {
15701570
let len = self.len();
15711571
if len == self.capacity() {
15721572
let (lower, _) = iterator.size_hint();
1573-
self.reserve(lower + 1);
1573+
self.reserve(lower.saturating_add(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
15771578
self.set_len(len + 1);
15781579
}
15791580
}

branches/try/src/libcollectionstest/lib.rs

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

1111
#![feature(append)]
12-
#![feature(bit_vec_append_split_off)]
1312
#![feature(bitset)]
1413
#![feature(bitvec)]
1514
#![feature(box_syntax)]

branches/try/src/libcoretest/char.rs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -102,29 +102,6 @@ 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-
128105
#[test]
129106
fn test_is_control() {
130107
assert!('\u{0}'.is_control());

branches/try/src/liblibc/lib.rs

Lines changed: 40 additions & 8 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 = "x86",
445-
target_arch = "mips",
444+
#[cfg(any(target_arch = "mips",
446445
target_arch = "mipsel",
447446
target_arch = "powerpc",
448447
target_arch = "le32",
449-
all(target_arch = "arm", not(target_os = "android"))))]
448+
all(any(target_arch = "arm", target_arch = "x86"),
449+
not(target_os = "android"))))]
450450
pub mod posix88 {
451451
pub type off_t = i32;
452452
pub type dev_t = u64;
@@ -458,7 +458,8 @@ pub mod types {
458458
pub type mode_t = u32;
459459
pub type ssize_t = i32;
460460
}
461-
#[cfg(all(target_arch = "arm", target_os = "android"))]
461+
#[cfg(all(any(target_arch = "arm", target_arch = "x86"),
462+
target_os = "android"))]
462463
pub mod posix88 {
463464
pub type off_t = i32;
464465
pub type dev_t = u32;
@@ -473,7 +474,8 @@ pub mod types {
473474
#[cfg(any(target_arch = "x86",
474475
target_arch = "le32",
475476
target_arch = "powerpc",
476-
all(target_arch = "arm", not(target_os = "android"))))]
477+
all(any(target_arch = "arm", target_arch = "x86"),
478+
not(target_os = "android"))))]
477479
pub mod posix01 {
478480
use types::os::arch::c95::{c_short, c_long, time_t};
479481
use types::os::arch::posix88::{dev_t, gid_t, ino_t};
@@ -519,7 +521,8 @@ pub mod types {
519521
pub __size: [u32; 9]
520522
}
521523
}
522-
#[cfg(all(target_arch = "arm", target_os = "android"))]
524+
#[cfg(all(any(target_arch = "arm", target_arch = "x86"),
525+
target_os = "android"))]
523526
pub mod posix01 {
524527
use types::os::arch::c95::{c_uchar, c_uint, c_ulong, time_t};
525528
use types::os::arch::c99::{c_longlong, c_ulonglong};
@@ -3597,6 +3600,11 @@ pub mod consts {
35973600
pub const SHUT_RD: c_int = 0;
35983601
pub const SHUT_WR: c_int = 1;
35993602
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;
36003608
}
36013609
#[cfg(any(target_arch = "mips",
36023610
target_arch = "mipsel"))]
@@ -3681,6 +3689,11 @@ pub mod consts {
36813689
pub const SHUT_RD: c_int = 0;
36823690
pub const SHUT_WR: c_int = 1;
36833691
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;
36843697
}
36853698
#[cfg(any(target_arch = "x86",
36863699
target_arch = "x86_64",
@@ -4224,6 +4237,11 @@ pub mod consts {
42244237
pub const SHUT_RD: c_int = 0;
42254238
pub const SHUT_WR: c_int = 1;
42264239
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;
42274245
}
42284246
pub mod extra {
42294247
use types::os::arch::c95::c_int;
@@ -4648,6 +4666,11 @@ pub mod consts {
46484666
pub const SHUT_RD: c_int = 0;
46494667
pub const SHUT_WR: c_int = 1;
46504668
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;
46514674
}
46524675
pub mod extra {
46534676
use types::os::arch::c95::c_int;
@@ -5089,6 +5112,11 @@ pub mod consts {
50895112
pub const SHUT_RD: c_int = 0;
50905113
pub const SHUT_WR: c_int = 1;
50915114
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;
50925120
}
50935121
pub mod extra {
50945122
use types::os::arch::c95::c_int;
@@ -5916,13 +5944,15 @@ pub mod funcs {
59165944
use types::os::arch::c95::c_int;
59175945
use types::os::common::posix01::sighandler_t;
59185946

5919-
#[cfg(not(all(target_os = "android", target_arch = "arm")))]
5947+
#[cfg(not(all(target_os = "android", any(target_arch = "arm",
5948+
target_arch = "x86"))))]
59205949
extern {
59215950
pub fn signal(signum: c_int,
59225951
handler: sighandler_t) -> sighandler_t;
59235952
}
59245953

5925-
#[cfg(all(target_os = "android", target_arch = "arm"))]
5954+
#[cfg(all(target_os = "android", any(target_arch = "arm",
5955+
target_arch = "x86")))]
59265956
extern {
59275957
#[link_name = "bsd_signal"]
59285958
pub fn signal(signum: c_int,
@@ -6116,6 +6146,7 @@ pub mod funcs {
61166146
-> c_int;
61176147
pub fn realpath(pathname: *const c_char, resolved: *mut c_char)
61186148
-> *mut c_char;
6149+
pub fn flock(fd: c_int, operation: c_int) -> c_int;
61196150
}
61206151
}
61216152

@@ -6132,6 +6163,7 @@ pub mod funcs {
61326163
-> c_int;
61336164
pub fn mincore(addr: *mut c_void, len: size_t, vec: *mut c_uchar)
61346165
-> c_int;
6166+
pub fn flock(fd: c_int, operation: c_int) -> c_int;
61356167
}
61366168
}
61376169

0 commit comments

Comments
 (0)