Skip to content

Commit 9ae81a3

Browse files
committed
---
yaml --- r: 188085 b: refs/heads/auto c: 4f1f5eb h: refs/heads/master i: 188083: 457cfce v: v3
1 parent d1236aa commit 9ae81a3

File tree

185 files changed

+3257
-2062
lines changed

Some content is hidden

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

185 files changed

+3257
-2062
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 1d647a0eec0315f95f982af68d0dc75d9e6a9e0c
13+
refs/heads/auto: 4f1f5eb1ab41bdc389913edb822da7be43e9b711
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/configure

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ then
875875
| cut -d ' ' -f 2)
876876

877877
case $CFG_CLANG_VERSION in
878-
(3.0svn | 3.0 | 3.1* | 3.2* | 3.3* | 3.4* | 3.5* | 3.6*)
878+
(3.2* | 3.3* | 3.4* | 3.5* | 3.6*)
879879
step_msg "found ok version of CLANG: $CFG_CLANG_VERSION"
880880
if [ -z "$CC" ]
881881
then

branches/auto/src/compiletest/runtest.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ fn run_rfail_test(config: &Config, props: &TestProps, testfile: &Path) {
127127
};
128128

129129
// The value our Makefile configures valgrind to return on failure
130-
static VALGRIND_ERR: int = 100;
130+
const VALGRIND_ERR: int = 100;
131131
if proc_res.status.matches_exit_status(VALGRIND_ERR) {
132132
fatal_proc_rec("run-fail test isn't valgrind-clean!", &proc_res);
133133
}
@@ -139,7 +139,7 @@ fn run_rfail_test(config: &Config, props: &TestProps, testfile: &Path) {
139139

140140
fn check_correct_failure_status(proc_res: &ProcRes) {
141141
// The value the rust runtime returns on failure
142-
static RUST_ERR: int = 101;
142+
const RUST_ERR: int = 101;
143143
if !proc_res.status.matches_exit_status(RUST_ERR) {
144144
fatal_proc_rec(
145145
&format!("failure produced the wrong error: {:?}",

branches/auto/src/compiletest/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use common::Config;
1414
use std::env;
1515

1616
/// Conversion table from triple OS name to Rust SYSNAME
17-
static OS_TABLE: &'static [(&'static str, &'static str)] = &[
17+
const OS_TABLE: &'static [(&'static str, &'static str)] = &[
1818
("mingw32", "windows"),
1919
("win32", "windows"),
2020
("windows", "windows"),

branches/auto/src/doc/intro.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -510,10 +510,10 @@ numbers[1] is 3
510510
numbers[0] is 2
511511
```
512512
513-
Each time, we can get a slithtly different output because the threads
514-
are not quaranteed to run in any set order. If you get the same order
515-
every time it is because each of these threads are very small and
516-
complete too fast for their indeterminate behavior to surface.
513+
Each time, we can get a slightly different output because the threads are not
514+
guaranteed to run in any set order. If you get the same order every time it is
515+
because each of these threads are very small and complete too fast for their
516+
indeterminate behavior to surface.
517517
518518
The important part here is that the Rust compiler was able to use ownership to
519519
give us assurance _at compile time_ that we weren't doing something incorrect

branches/auto/src/doc/reference.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2495,6 +2495,12 @@ The currently implemented features of the reference compiler are:
24952495

24962496
* `staged_api` - Allows usage of stability markers and `#![staged_api]` in a crate
24972497

2498+
* `static_assert` - The `#[static_assert]` functionality is experimental and
2499+
unstable. The attribute can be attached to a `static` of
2500+
type `bool` and the compiler will error if the `bool` is
2501+
`false` at compile time. This version of this functionality
2502+
is unintuitive and suboptimal.
2503+
24982504
* `start` - Allows use of the `#[start]` attribute, which changes the entry point
24992505
into a Rust program. This capabiilty, especially the signature for the
25002506
annotated function, is subject to change.

branches/auto/src/doc/trpl/guessing-game.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -422,11 +422,11 @@ In this case, we say `x` is a `u32` explicitly, so Rust is able to properly
422422
tell `random()` what to generate. In a similar fashion, both of these work:
423423
424424
```{rust,ignore}
425-
let input_num = "5".parse::<u32>(); // input_num: Option<u32>
426-
let input_num: Result<u32, _> = "5".parse(); // input_num: Result<u32, <u32 as FromStr>::Err>
425+
let input_num_option = "5".parse::<u32>().ok(); // input_num: Option<u32>
426+
let input_num_result: Result<u32, _> = "5".parse(); // input_num: Result<u32, <u32 as FromStr>::Err>
427427
```
428428
429-
Here we're converting the `Result` returned by `parse` to an `Option` by using
429+
Above, we're converting the `Result` returned by `parse` to an `Option` by using
430430
the `ok` method as well. Anyway, with us now converting our input to a number,
431431
our code looks like this:
432432
@@ -470,14 +470,14 @@ Let's try it out!
470470
```bash
471471
$ cargo build
472472
Compiling guessing_game v0.0.1 (file:///home/you/projects/guessing_game)
473-
src/main.rs:22:15: 22:24 error: mismatched types: expected `u32` but found `core::option::Option<u32>` (expected u32 but found enum core::option::Option)
474-
src/main.rs:22 match cmp(input_num, secret_number) {
473+
src/main.rs:21:15: 21:24 error: mismatched types: expected `u32`, found `core::result::Result<u32, core::num::ParseIntError>` (expected u32, found enum `core::result::Result`) [E0308]
474+
src/main.rs:21 match cmp(input_num, secret_number) {
475475
^~~~~~~~~
476476
error: aborting due to previous error
477477
```
478478
479-
Oh yeah! Our `input_num` has the type `Option<u32>`, rather than `u32`. We
480-
need to unwrap the Option. If you remember from before, `match` is a great way
479+
Oh yeah! Our `input_num` has the type `Result<u32, <some error>>`, rather than `u32`. We
480+
need to unwrap the Result. If you remember from before, `match` is a great way
481481
to do that. Try this code:
482482
483483
```{rust,no_run}
@@ -500,7 +500,7 @@ fn main() {
500500
let input_num: Result<u32, _> = input.parse();
501501

502502
let num = match input_num {
503-
Ok(num) => num,
503+
Ok(n) => n,
504504
Err(_) => {
505505
println!("Please input a number!");
506506
return;
@@ -524,7 +524,7 @@ fn cmp(a: u32, b: u32) -> Ordering {
524524
}
525525
```
526526
527-
We use a `match` to either give us the `u32` inside of the `Option`, or else
527+
We use a `match` to either give us the `u32` inside of the `Result`, or else
528528
print an error message and return. Let's give this a shot:
529529
530530
```bash

branches/auto/src/etc/unicode.py

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -290,11 +290,11 @@ def emit_bsearch_range_table(f):
290290
fn bsearch_range_table(c: char, r: &'static [(char,char)]) -> bool {
291291
use core::cmp::Ordering::{Equal, Less, Greater};
292292
use core::slice::SliceExt;
293-
r.binary_search(|&(lo,hi)| {
293+
r.binary_search_by(|&(lo,hi)| {
294294
if lo <= c && c <= hi { Equal }
295295
else if hi < c { Less }
296296
else { Greater }
297-
}).found().is_some()
297+
}).is_ok()
298298
}\n
299299
""")
300300

@@ -303,7 +303,7 @@ def emit_table(f, name, t_data, t_type = "&'static [(char, char)]", is_pub=True,
303303
pub_string = ""
304304
if is_pub:
305305
pub_string = "pub "
306-
f.write(" %sstatic %s: %s = &[\n" % (pub_string, name, t_type))
306+
f.write(" %sconst %s: %s = &[\n" % (pub_string, name, t_type))
307307
data = ""
308308
first = True
309309
for dat in t_data:
@@ -329,14 +329,14 @@ def emit_property_module(f, mod, tbl, emit_fn):
329329
def emit_regex_module(f, cats, w_data):
330330
f.write("pub mod regex {\n")
331331
regex_class = "&'static [(char, char)]"
332-
class_table = "&'static [(&'static str, &'static %s)]" % regex_class
332+
class_table = "&'static [(&'static str, %s)]" % regex_class
333333

334334
emit_table(f, "UNICODE_CLASSES", cats, class_table,
335-
pfun=lambda x: "(\"%s\",&super::%s::%s_table)" % (x[0], x[1], x[0]))
335+
pfun=lambda x: "(\"%s\",super::%s::%s_table)" % (x[0], x[1], x[0]))
336336

337-
f.write(" pub static PERLD: &'static %s = &super::general_category::Nd_table;\n\n"
337+
f.write(" pub const PERLD: %s = super::general_category::Nd_table;\n\n"
338338
% regex_class)
339-
f.write(" pub static PERLS: &'static %s = &super::property::White_Space_table;\n\n"
339+
f.write(" pub const PERLS: %s = super::property::White_Space_table;\n\n"
340340
% regex_class)
341341

342342
emit_table(f, "PERLW", w_data, regex_class)
@@ -350,7 +350,7 @@ def emit_conversions_module(f, lowerupper, upperlower):
350350
use core::slice::SliceExt;
351351
use core::option::Option;
352352
use core::option::Option::{Some, None};
353-
use core::slice;
353+
use core::result::Result::{Ok, Err};
354354
355355
pub fn to_lower(c: char) -> char {
356356
match bsearch_case_table(c, LuLl_table) {
@@ -367,13 +367,13 @@ def emit_conversions_module(f, lowerupper, upperlower):
367367
}
368368
369369
fn bsearch_case_table(c: char, table: &'static [(char, char)]) -> Option<usize> {
370-
match table.binary_search(|&(key, _)| {
370+
match table.binary_search_by(|&(key, _)| {
371371
if c == key { Equal }
372372
else if key < c { Less }
373373
else { Greater }
374374
}) {
375-
slice::BinarySearchResult::Found(i) => Some(i),
376-
slice::BinarySearchResult::NotFound(_) => None,
375+
Ok(i) => Some(i),
376+
Err(_) => None,
377377
}
378378
}
379379
@@ -386,10 +386,9 @@ def emit_conversions_module(f, lowerupper, upperlower):
386386

387387
def emit_grapheme_module(f, grapheme_table, grapheme_cats):
388388
f.write("""pub mod grapheme {
389-
use core::kinds::Copy;
390389
use core::slice::SliceExt;
391390
pub use self::GraphemeCat::*;
392-
use core::slice;
391+
use core::result::Result::{Ok, Err};
393392
394393
#[allow(non_camel_case_types)]
395394
#[derive(Clone, Copy)]
@@ -401,16 +400,16 @@ def emit_grapheme_module(f, grapheme_table, grapheme_cats):
401400
402401
fn bsearch_range_value_table(c: char, r: &'static [(char, char, GraphemeCat)]) -> GraphemeCat {
403402
use core::cmp::Ordering::{Equal, Less, Greater};
404-
match r.binary_search(|&(lo, hi, _)| {
403+
match r.binary_search_by(|&(lo, hi, _)| {
405404
if lo <= c && c <= hi { Equal }
406405
else if hi < c { Less }
407406
else { Greater }
408407
}) {
409-
slice::BinarySearchResult::Found(idx) => {
408+
Ok(idx) => {
410409
let (_, _, cat) = r[idx];
411410
cat
412411
}
413-
slice::BinarySearchResult::NotFound(_) => GC_Any
412+
Err(_) => GC_Any
414413
}
415414
}
416415
@@ -430,20 +429,20 @@ def emit_charwidth_module(f, width_table):
430429
f.write(" use core::option::Option;\n")
431430
f.write(" use core::option::Option::{Some, None};\n")
432431
f.write(" use core::slice::SliceExt;\n")
433-
f.write(" use core::slice;\n")
432+
f.write(" use core::result::Result::{Ok, Err};\n")
434433
f.write("""
435434
fn bsearch_range_value_table(c: char, is_cjk: bool, r: &'static [(char, char, u8, u8)]) -> u8 {
436435
use core::cmp::Ordering::{Equal, Less, Greater};
437-
match r.binary_search(|&(lo, hi, _, _)| {
436+
match r.binary_search_by(|&(lo, hi, _, _)| {
438437
if lo <= c && c <= hi { Equal }
439438
else if hi < c { Less }
440439
else { Greater }
441440
}) {
442-
slice::BinarySearchResult::Found(idx) => {
441+
Ok(idx) => {
443442
let (_, _, r_ncjk, r_cjk) = r[idx];
444443
if is_cjk { r_cjk } else { r_ncjk }
445444
}
446-
slice::BinarySearchResult::NotFound(_) => 1
445+
Err(_) => 1
447446
}
448447
}
449448
""")
@@ -530,17 +529,17 @@ def comp_pfun(char):
530529
fn bsearch_range_value_table(c: char, r: &'static [(char, char, u8)]) -> u8 {
531530
use core::cmp::Ordering::{Equal, Less, Greater};
532531
use core::slice::SliceExt;
533-
use core::slice;
534-
match r.binary_search(|&(lo, hi, _)| {
532+
use core::result::Result::{Ok, Err};
533+
match r.binary_search_by(|&(lo, hi, _)| {
535534
if lo <= c && c <= hi { Equal }
536535
else if hi < c { Less }
537536
else { Greater }
538537
}) {
539-
slice::BinarySearchResult::Found(idx) => {
538+
Ok(idx) => {
540539
let (_, _, result) = r[idx];
541540
result
542541
}
543-
slice::BinarySearchResult::NotFound(_) => 0
542+
Err(_) => 0
544543
}
545544
}\n
546545
""")
@@ -609,7 +608,7 @@ def optimize_width_table(wtable):
609608
unicode_version = re.search(pattern, readme.read()).groups()
610609
rf.write("""
611610
/// The version of [Unicode](http://www.unicode.org/)
612-
/// that the `UnicodeChar` and `UnicodeStrPrelude` traits are based on.
611+
/// that the unicode parts of `CharExt` and `UnicodeStrPrelude` traits are based on.
613612
pub const UNICODE_VERSION: (u64, u64, u64) = (%s, %s, %s);
614613
""" % unicode_version)
615614
(canon_decomp, compat_decomp, gencats, combines,

branches/auto/src/liballoc/arc.rs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,11 @@ impl<T> Arc<T> {
201201
impl<T> Arc<T> {
202202
#[inline]
203203
fn inner(&self) -> &ArcInner<T> {
204-
// This unsafety is ok because while this arc is alive we're guaranteed that the inner
205-
// pointer is valid. Furthermore, we know that the `ArcInner` structure itself is `Sync`
206-
// because the inner data is `Sync` as well, so we're ok loaning out an immutable pointer
207-
// to these contents.
204+
// This unsafety is ok because while this arc is alive we're guaranteed
205+
// that the inner pointer is valid. Furthermore, we know that the
206+
// `ArcInner` structure itself is `Sync` because the inner data is
207+
// `Sync` as well, so we're ok loaning out an immutable pointer to these
208+
// contents.
208209
unsafe { &**self._ptr }
209210
}
210211
}
@@ -236,13 +237,15 @@ impl<T> Clone for Arc<T> {
236237
/// ```
237238
#[inline]
238239
fn clone(&self) -> Arc<T> {
239-
// Using a relaxed ordering is alright here, as knowledge of the original reference
240-
// prevents other threads from erroneously deleting the object.
240+
// Using a relaxed ordering is alright here, as knowledge of the
241+
// original reference prevents other threads from erroneously deleting
242+
// the object.
241243
//
242-
// As explained in the [Boost documentation][1], Increasing the reference counter can
243-
// always be done with memory_order_relaxed: New references to an object can only be formed
244-
// from an existing reference, and passing an existing reference from one thread to another
245-
// must already provide any required synchronization.
244+
// As explained in the [Boost documentation][1], Increasing the
245+
// reference counter can always be done with memory_order_relaxed: New
246+
// references to an object can only be formed from an existing
247+
// reference, and passing an existing reference from one thread to
248+
// another must already provide any required synchronization.
246249
//
247250
// [1]: (www.boost.org/doc/libs/1_55_0/doc/html/atomic/usage_examples.html)
248251
self.inner().strong.fetch_add(1, Relaxed);

0 commit comments

Comments
 (0)