Skip to content

Commit b728e93

Browse files
committed
---
yaml --- r: 162292 b: refs/heads/auto c: 84a7615 h: refs/heads/master v: v3
1 parent 80a9073 commit b728e93

File tree

301 files changed

+5700
-5067
lines changed

Some content is hidden

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

301 files changed

+5700
-5067
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: e20ea0b67dbd5428bc3d355862692f1efecd378c
13+
refs/heads/auto: 84a7615418749d663d54dd9223a15098b834e2a0
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/compiletest/compiletest.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,9 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
286286
test_shard: config.test_shard.clone(),
287287
nocapture: false,
288288
color: test::AutoColor,
289+
show_boxplot: false,
290+
boxplot_width: 50,
291+
show_all_stats: false,
289292
}
290293
}
291294

@@ -343,7 +346,7 @@ pub fn make_test(config: &Config, testfile: &Path, f: || -> test::TestFn)
343346
desc: test::TestDesc {
344347
name: make_test_name(config, testfile),
345348
ignore: header::is_test_ignored(config, testfile),
346-
should_fail: false
349+
should_fail: test::ShouldFail::No,
347350
},
348351
testfn: f(),
349352
}

branches/auto/src/doc/guide-testing.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,21 @@ fn test_out_of_bounds_failure() {
8989
}
9090
~~~
9191

92+
`#[should_fail]` tests can be fragile as it's hard to guarantee that the test
93+
didn't fail for an unexpected reason. To help with this, an optional `expected`
94+
parameter can be added to the `should_fail` attribute. The test harness will
95+
make sure that the failure message contains the provided text. A safer version
96+
of the example above would be:
97+
98+
~~~test_harness
99+
#[test]
100+
#[should_fail(expected = "index out of bounds")]
101+
fn test_out_of_bounds_failure() {
102+
let v: &[int] = &[];
103+
v[0];
104+
}
105+
~~~
106+
92107
A test runner built with the `--test` flag supports a limited set of
93108
arguments to control which tests are run:
94109

branches/auto/src/doc/guide.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ $ editor main.rs
140140
```
141141

142142
Rust files always end in a `.rs` extension. If you're using more than one word
143-
in your file name, use an underscore. `hello_world.rs` rather than
143+
in your filename, use an underscore. `hello_world.rs` rather than
144144
`helloworld.rs`.
145145

146146
Now that you've got your file open, type this in:
@@ -200,7 +200,7 @@ about this difference. Just know that sometimes, you'll see a `!`, and that
200200
means that you're calling a macro instead of a normal function. Rust implements
201201
`println!` as a macro rather than a function for good reasons, but that's a
202202
very advanced topic. You'll learn more when we talk about macros later. One
203-
last thing to mention: Rust's macros are significantly different than C macros,
203+
last thing to mention: Rust's macros are significantly different from C macros,
204204
if you've used those. Don't be scared of using macros. We'll get to the details
205205
eventually, you'll just have to trust us for now.
206206

@@ -595,8 +595,8 @@ let y = if x == 5i { 10i } else { 15i };
595595
```
596596

597597
This reveals two interesting things about Rust: it is an expression-based
598-
language, and semicolons are different than in other 'curly brace and
599-
semicolon'-based languages. These two things are related.
598+
language, and semicolons are different from semicolons in other 'curly brace
599+
and semicolon'-based languages. These two things are related.
600600

601601
## Expressions vs. Statements
602602

@@ -1454,7 +1454,7 @@ Both `continue` and `break` are valid in both kinds of loops.
14541454
# Strings
14551455

14561456
Strings are an important concept for any programmer to master. Rust's string
1457-
handling system is a bit different than in other languages, due to its systems
1457+
handling system is a bit different from other languages, due to its systems
14581458
focus. Any time you have a data structure of variable size, things can get
14591459
tricky, and strings are a re-sizable data structure. That said, Rust's strings
14601460
also work differently than in some other systems languages, such as C.
@@ -2064,8 +2064,8 @@ Great! Next up: let's compare our guess to the secret guess.
20642064
## Comparing guesses
20652065

20662066
If you remember, earlier in the guide, we made a `cmp` function that compared
2067-
two numbers. Let's add that in, along with a `match` statement to compare the
2068-
guess to the secret guess:
2067+
two numbers. Let's add that in, along with a `match` statement to compare our
2068+
guess to the secret number:
20692069

20702070
```{rust,ignore}
20712071
use std::io;
@@ -2861,7 +2861,7 @@ parts of your library. The six levels are:
28612861
* experimental: This item was only recently introduced or is otherwise in a
28622862
state of flux. It may change significantly, or even be removed. No guarantee
28632863
of backwards-compatibility.
2864-
* unstable: This item is still under development, but requires more testing to
2864+
* unstable: This item is still under development and requires more testing to
28652865
be considered stable. No guarantee of backwards-compatibility.
28662866
* stable: This item is considered stable, and will not change significantly.
28672867
Guarantee of backwards-compatibility.
@@ -5174,12 +5174,12 @@ processor. Rust's semantics lend themselves very nicely to solving a number of
51745174
issues that programmers have with concurrency. Many concurrency errors that are
51755175
runtime errors in other languages are compile-time errors in Rust.
51765176

5177-
Rust's concurrency primitive is called a **task**. Tasks are lightweight, and
5178-
do not share memory in an unsafe manner, preferring message passing to
5179-
communicate. It's worth noting that tasks are implemented as a library, and
5180-
not part of the language. This means that in the future, other concurrency
5181-
libraries can be written for Rust to help in specific scenarios. Here's an
5182-
example of creating a task:
5177+
Rust's concurrency primitive is called a **task**. Tasks are similar to
5178+
threads, and do not share memory in an unsafe manner, preferring message
5179+
passing to communicate. It's worth noting that tasks are implemented as a
5180+
library, and not part of the language. This means that in the future, other
5181+
concurrency libraries can be written for Rust to help in specific scenarios.
5182+
Here's an example of creating a task:
51835183

51845184
```{rust}
51855185
spawn(proc() {

branches/auto/src/doc/reference.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ The two values of the boolean type are written `true` and `false`.
522522
### Symbols
523523

524524
```{.ebnf .gram}
525-
symbol : "::" "->"
525+
symbol : "::" | "->"
526526
| '#' | '[' | ']' | '(' | ')' | '{' | '}'
527527
| ',' | ';' ;
528528
```
@@ -994,7 +994,7 @@ An example of `use` declarations:
994994

995995
```
996996
use std::iter::range_step;
997-
use std::option::{Some, None};
997+
use std::option::Option::{Some, None};
998998
use std::collections::hash_map::{mod, HashMap};
999999
10001000
fn foo<T>(_: T){}
@@ -1004,8 +1004,8 @@ fn main() {
10041004
// Equivalent to 'std::iter::range_step(0u, 10u, 2u);'
10051005
range_step(0u, 10u, 2u);
10061006
1007-
// Equivalent to 'foo(vec![std::option::Some(1.0f64),
1008-
// std::option::None]);'
1007+
// Equivalent to 'foo(vec![std::option::Option::Some(1.0f64),
1008+
// std::option::Option::None]);'
10091009
foo(vec![Some(1.0f64), None]);
10101010
10111011
// Both `hash_map` and `HashMap` are in scope.

branches/auto/src/etc/gdb_rust_pretty_printing.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,27 @@ def rust_pretty_printer_lookup_function(val):
5454
return RustStructPrinter(val, false)
5555

5656
if enum_member_count == 1:
57-
if enum_members[0].name == None:
57+
first_variant_name = enum_members[0].name
58+
if first_variant_name == None:
5859
# This is a singleton enum
5960
return rust_pretty_printer_lookup_function(val[enum_members[0]])
6061
else:
61-
assert enum_members[0].name.startswith("RUST$ENCODED$ENUM$")
62+
assert first_variant_name.startswith("RUST$ENCODED$ENUM$")
6263
# This is a space-optimized enum
63-
last_separator_index = enum_members[0].name.rfind("$")
64+
last_separator_index = first_variant_name.rfind("$")
6465
second_last_separator_index = first_variant_name.rfind("$", 0, last_separator_index)
6566
disr_field_index = first_variant_name[second_last_separator_index + 1 :
6667
last_separator_index]
6768
disr_field_index = int(disr_field_index)
6869

6970
sole_variant_val = val[enum_members[0]]
7071
disr_field = get_field_at_index(sole_variant_val, disr_field_index)
71-
discriminant = int(sole_variant_val[disr_field])
72+
discriminant = sole_variant_val[disr_field]
73+
74+
# If the discriminant field is a fat pointer we have to consider the
75+
# first word as the true discriminant
76+
if discriminant.type.code == gdb.TYPE_CODE_STRUCT:
77+
discriminant = discriminant[get_field_at_index(discriminant, 0)]
7278

7379
if discriminant == 0:
7480
null_variant_name = first_variant_name[last_separator_index + 1:]
@@ -173,7 +179,7 @@ def to_string(self):
173179

174180
class IdentityPrinter:
175181
def __init__(self, string):
176-
self.string
182+
self.string = string
177183

178184
def to_string(self):
179185
return self.string

branches/auto/src/etc/licenseck.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@
3838
"rt/isaac/randport.cpp", # public domain
3939
"rt/isaac/rand.h", # public domain
4040
"rt/isaac/standard.h", # public domain
41-
"libstd/sync/mpsc_queue.rs", # BSD
42-
"libstd/sync/spsc_queue.rs", # BSD
43-
"libstd/sync/mpmc_bounded_queue.rs", # BSD
41+
"libstd/comm/mpsc_queue.rs", # BSD
42+
"libstd/comm/spsc_queue.rs", # BSD
4443
"test/bench/shootout-binarytrees.rs", # BSD
4544
"test/bench/shootout-chameneos-redux.rs", # BSD
4645
"test/bench/shootout-fannkuch-redux.rs", # BSD

branches/auto/src/etc/lldb_rust_formatters.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,14 @@ def print_enum_val(val, internal_dict):
138138
return "<invalid enum encoding: %s>" % first_variant_name
139139

140140
# Read the discriminant
141-
disr_val = val.GetChildAtIndex(0).GetChildAtIndex(disr_field_index).GetValueAsUnsigned()
141+
disr_val = val.GetChildAtIndex(0).GetChildAtIndex(disr_field_index)
142142

143-
if disr_val == 0:
143+
# If the discriminant field is a fat pointer we have to consider the
144+
# first word as the true discriminant
145+
if disr_val.GetType().GetTypeClass() == lldb.eTypeClassStruct:
146+
disr_val = disr_val.GetChildAtIndex(0)
147+
148+
if disr_val.GetValueAsUnsigned() == 0:
144149
# Null case: Print the name of the null-variant
145150
null_variant_name = first_variant_name[last_separator_index + 1:]
146151
return null_variant_name

branches/auto/src/etc/unicode.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ def escape_char(c):
292292
def emit_bsearch_range_table(f):
293293
f.write("""
294294
fn bsearch_range_table(c: char, r: &'static [(char,char)]) -> bool {
295-
use core::cmp::{Equal, Less, Greater};
295+
use core::cmp::Ordering::{Equal, Less, Greater};
296296
use core::slice::SlicePrelude;
297297
r.binary_search(|&(lo,hi)| {
298298
if lo <= c && c <= hi { Equal }
@@ -350,10 +350,11 @@ def emit_regex_module(f, cats, w_data):
350350
def emit_conversions_module(f, lowerupper, upperlower):
351351
f.write("pub mod conversions {")
352352
f.write("""
353-
use core::cmp::{Equal, Less, Greater};
353+
use core::cmp::Ordering::{Equal, Less, Greater};
354354
use core::slice::SlicePrelude;
355355
use core::tuple::Tuple2;
356-
use core::option::{Option, Some, None};
356+
use core::option::Option;
357+
use core::option::Option::{Some, None};
357358
use core::slice;
358359
359360
pub fn to_lower(c: char) -> char {
@@ -403,7 +404,7 @@ def emit_grapheme_module(f, grapheme_table, grapheme_cats):
403404
f.write(""" }
404405
405406
fn bsearch_range_value_table(c: char, r: &'static [(char, char, GraphemeCat)]) -> GraphemeCat {
406-
use core::cmp::{Equal, Less, Greater};
407+
use core::cmp::Ordering::{Equal, Less, Greater};
407408
match r.binary_search(|&(lo, hi, _)| {
408409
if lo <= c && c <= hi { Equal }
409410
else if hi < c { Less }
@@ -430,12 +431,13 @@ def emit_grapheme_module(f, grapheme_table, grapheme_cats):
430431

431432
def emit_charwidth_module(f, width_table):
432433
f.write("pub mod charwidth {\n")
433-
f.write(" use core::option::{Option, Some, None};\n")
434+
f.write(" use core::option::Option;\n")
435+
f.write(" use core::option::Option::{Some, None};\n")
434436
f.write(" use core::slice::SlicePrelude;\n")
435437
f.write(" use core::slice;\n")
436438
f.write("""
437439
fn bsearch_range_value_table(c: char, is_cjk: bool, r: &'static [(char, char, u8, u8)]) -> u8 {
438-
use core::cmp::{Equal, Less, Greater};
440+
use core::cmp::Ordering::{Equal, Less, Greater};
439441
match r.binary_search(|&(lo, hi, _, _)| {
440442
if lo <= c && c <= hi { Equal }
441443
else if hi < c { Less }
@@ -530,7 +532,7 @@ def comp_pfun(char):
530532

531533
f.write("""
532534
fn bsearch_range_value_table(c: char, r: &'static [(char, char, u8)]) -> u8 {
533-
use core::cmp::{Equal, Less, Greater};
535+
use core::cmp::Ordering::{Equal, Less, Greater};
534536
use core::slice::SlicePrelude;
535537
use core::slice;
536538
match r.binary_search(|&(lo, hi, _)| {

branches/auto/src/liballoc/arc.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ use core::kinds::{Sync, Send};
2222
use core::mem::{min_align_of, size_of, drop};
2323
use core::mem;
2424
use core::ops::{Drop, Deref};
25-
use core::option::{Some, None, Option};
25+
use core::option::Option;
26+
use core::option::Option::{Some, None};
2627
use core::ptr::RawPtr;
2728
use core::ptr;
2829
use heap::deallocate;
@@ -326,7 +327,8 @@ mod tests {
326327
use std::comm::channel;
327328
use std::mem::drop;
328329
use std::ops::Drop;
329-
use std::option::{Option, Some, None};
330+
use std::option::Option;
331+
use std::option::Option::{Some, None};
330332
use std::str::Str;
331333
use std::sync::atomic;
332334
use std::task;
@@ -521,7 +523,7 @@ mod tests {
521523
#[test]
522524
fn show_arc() {
523525
let a = Arc::new(5u32);
524-
assert!(format!("{}", a).as_slice() == "5")
526+
assert!(format!("{}", a) == "5")
525527
}
526528

527529
// Make sure deriving works with Arc<T>

branches/auto/src/liballoc/boxed.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ use core::kinds::Sized;
1919
use core::mem;
2020
use core::option::Option;
2121
use core::raw::TraitObject;
22-
use core::result::{Ok, Err, Result};
22+
use core::result::Result;
23+
use core::result::Result::{Ok, Err};
2324

2425
/// A value that represents the global exchange heap. This is the default
2526
/// place that the `box` keyword allocates into when no place is supplied.
@@ -169,14 +170,14 @@ mod test {
169170
let b = box Test as Box<Any>;
170171
let a_str = a.to_str();
171172
let b_str = b.to_str();
172-
assert_eq!(a_str.as_slice(), "Box<Any>");
173-
assert_eq!(b_str.as_slice(), "Box<Any>");
173+
assert_eq!(a_str, "Box<Any>");
174+
assert_eq!(b_str, "Box<Any>");
174175

175176
let a = &8u as &Any;
176177
let b = &Test as &Any;
177178
let s = format!("{}", a);
178-
assert_eq!(s.as_slice(), "&Any");
179+
assert_eq!(s, "&Any");
179180
let s = format!("{}", b);
180-
assert_eq!(s.as_slice(), "&Any");
181+
assert_eq!(s, "&Any");
181182
}
182183
}

0 commit comments

Comments
 (0)