Skip to content

Commit 5253ebd

Browse files
committed
---
yaml --- r: 163135 b: refs/heads/snap-stage3 c: e852419 h: refs/heads/master i: 163133: 6d06c04 163131: efc40ec 163127: af291c6 163119: c45924a 163103: a58a74d 163071: 6e256ff v: v3
1 parent 0fb6b40 commit 5253ebd

File tree

521 files changed

+6130
-8286
lines changed

Some content is hidden

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

521 files changed

+6130
-8286
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: 9146a919b616e39e528e4d7100d16eef52f1f852
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 60f97fc44aa745300ccda73e4f7d3c1827aacda9
4+
refs/heads/snap-stage3: e8524198e3931373f5e097dece21e36d21c4a537
55
refs/heads/try: 20cbbffeefc1f35e2ea63afce7b42fbd79611d42
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/src/compiletest/common.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ pub enum Mode {
2525
Codegen
2626
}
2727

28-
impl Copy for Mode {}
29-
3028
impl FromStr for Mode {
3129
fn from_str(s: &str) -> Option<Mode> {
3230
match s {

branches/snap-stage3/src/compiletest/compiletest.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,6 @@ 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,
292289
}
293290
}
294291

@@ -346,7 +343,7 @@ pub fn make_test(config: &Config, testfile: &Path, f: || -> test::TestFn)
346343
desc: test::TestDesc {
347344
name: make_test_name(config, testfile),
348345
ignore: header::is_test_ignored(config, testfile),
349-
should_fail: test::ShouldFail::No,
346+
should_fail: false
350347
},
351348
testfn: f(),
352349
}

branches/snap-stage3/src/doc/guide-ownership.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ must have a deallocation for each allocation. Rust handles this for you. It
9393
knows that our handle, `x`, is the owning reference to our box. Rust knows that
9494
`x` will go out of scope at the end of the block, and so it inserts a call to
9595
deallocate the memory at the end of the scope. Because the compiler does this
96-
for us, it's impossible to forget. We always have exactly one deallocation paired
96+
for us, it's impossible to forget. We always exaclty one deallocations paired
9797
with each of our allocations.
9898

9999
This is pretty straightforward, but what happens when we want to pass our box
@@ -186,11 +186,11 @@ This function takes ownership, because it takes a `Box`, which owns its
186186
contents. But then we give ownership right back.
187187

188188
In the physical world, you can give one of your possessions to someone for a
189-
short period of time. You still own your possession, you're just letting someone
189+
short period of time. You still own your posession, you're just letting someone
190190
else use it for a while. We call that 'lending' something to someone, and that
191191
person is said to be 'borrowing' that something from you.
192192

193-
Rust's ownership system also allows an owner to lend out a handle for a limited
193+
Rust's ownershp system also allows an owner to lend out a handle for a limited
194194
period. This is also called 'borrowing.' Here's a version of `add_one` which
195195
borrows its argument rather than taking ownership:
196196

@@ -231,7 +231,7 @@ fn add_one(num: &int) -> int {
231231

232232
Rust has a feature called 'lifetime elision,' which allows you to not write
233233
lifetime annotations in certain circumstances. This is one of them. Without
234-
eliding the lifetimes, `add_one` looks like this:
234+
eliding the liftimes, `add_one` looks like this:
235235

236236
```rust
237237
fn add_one<'a>(num: &'a int) -> int {
@@ -254,7 +254,7 @@ This part _declares_ our lifetimes. This says that `add_one` has one lifetime,
254254
fn add_two<'a, 'b>(...)
255255
```
256256

257-
Then in our parameter list, we use the lifetimes we've named:
257+
Then in our parameter list, we use the liftimes we've named:
258258

259259
```{rust,ignore}
260260
...(num: &'a int) -> ...
@@ -279,7 +279,7 @@ fn main() {
279279
}
280280
```
281281

282-
As you can see, `struct`s can also have lifetimes. In a similar way to functions,
282+
As you can see, `struct`s can also have liftimes. In a similar way to functions,
283283

284284
```{rust}
285285
struct Foo<'a> {
@@ -295,7 +295,7 @@ x: &'a int,
295295
# }
296296
```
297297

298-
uses it. So why do we need a lifetime here? We need to ensure that any reference
298+
uses it. So why do we need a liftime here? We need to ensure that any reference
299299
to a `Foo` cannot outlive the reference to an `int` it contains.
300300

301301
## Thinking in scopes

branches/snap-stage3/src/doc/guide-testing.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -89,21 +89,6 @@ 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-
10792
A test runner built with the `--test` flag supports a limited set of
10893
arguments to control which tests are run:
10994

branches/snap-stage3/src/doc/guide-unsafe.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -661,9 +661,6 @@ extern {
661661
fn abort() -> !;
662662
}
663663
664-
#[lang = "owned_box"]
665-
pub struct Box<T>(*mut T);
666-
667664
#[lang="exchange_malloc"]
668665
unsafe fn allocate(size: uint, _align: uint) -> *mut u8 {
669666
let p = libc::malloc(size as libc::size_t) as *mut u8;

branches/snap-stage3/src/doc/guide.md

Lines changed: 16 additions & 16 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 filename, use an underscore. `hello_world.rs` rather than
143+
in your file name, 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 from C macros,
203+
last thing to mention: Rust's macros are significantly different than 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 from semicolons in other 'curly brace
599-
and semicolon'-based languages. These two things are related.
598+
language, and semicolons are different than in other 'curly brace and
599+
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 from other languages, due to its systems
1457+
handling system is a bit different than in 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 our
2068-
guess to the secret number:
2067+
two numbers. Let's add that in, along with a `match` statement to compare the
2068+
guess to the secret guess:
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 and requires more testing to
2864+
* unstable: This item is still under development, but 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.
@@ -3681,8 +3681,8 @@ Here's the second note, which lets us know where the first borrow would be over.
36813681
This is useful, because if we wait to try to borrow `x` after this borrow is
36823682
over, then everything will work.
36833683

3684-
For more advanced patterns, please consult the [Ownership
3685-
Guide](guide-ownership.html). You'll also learn what this type signature with
3684+
For more advanced patterns, please consult the [Lifetime
3685+
Guide](guide-lifetimes.html). You'll also learn what this type signature with
36863686
the `'a` syntax is:
36873687

36883688
```{rust,ignore}
@@ -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 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:
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:
51835183

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

branches/snap-stage3/src/doc/reference.md

Lines changed: 4 additions & 8 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::Option::{Some, None};
997+
use std::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::Option::Some(1.0f64),
1008-
// std::option::Option::None]);'
1007+
// Equivalent to 'foo(vec![std::option::Some(1.0f64),
1008+
// std::option::None]);'
10091009
foo(vec![Some(1.0f64), None]);
10101010
10111011
// Both `hash_map` and `HashMap` are in scope.
@@ -1660,7 +1660,6 @@ Implementations are defined with the keyword `impl`.
16601660

16611661
```
16621662
# struct Point {x: f64, y: f64};
1663-
# impl Copy for Point {}
16641663
# type Surface = int;
16651664
# struct BoundingBox {x: f64, y: f64, width: f64, height: f64};
16661665
# trait Shape { fn draw(&self, Surface); fn bounding_box(&self) -> BoundingBox; }
@@ -1670,8 +1669,6 @@ struct Circle {
16701669
center: Point,
16711670
}
16721671
1673-
impl Copy for Circle {}
1674-
16751672
impl Shape for Circle {
16761673
fn draw(&self, s: Surface) { do_draw_circle(s, *self); }
16771674
fn bounding_box(&self) -> BoundingBox {
@@ -1794,7 +1791,6 @@ default visibility with the `priv` keyword. When an item is declared as `pub`,
17941791
it can be thought of as being accessible to the outside world. For example:
17951792

17961793
```
1797-
# #![allow(missing_copy_implementations)]
17981794
# fn main() {}
17991795
// Declare a private struct
18001796
struct Foo;

branches/snap-stage3/src/etc/gdb_rust_pretty_printing.py

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

5656
if enum_member_count == 1:
57-
first_variant_name = enum_members[0].name
58-
if first_variant_name == None:
57+
if enum_members[0].name == None:
5958
# This is a singleton enum
6059
return rust_pretty_printer_lookup_function(val[enum_members[0]])
6160
else:
62-
assert first_variant_name.startswith("RUST$ENCODED$ENUM$")
61+
assert enum_members[0].name.startswith("RUST$ENCODED$ENUM$")
6362
# This is a space-optimized enum
64-
last_separator_index = first_variant_name.rfind("$")
63+
last_separator_index = enum_members[0].name.rfind("$")
6564
second_last_separator_index = first_variant_name.rfind("$", 0, last_separator_index)
6665
disr_field_index = first_variant_name[second_last_separator_index + 1 :
6766
last_separator_index]
6867
disr_field_index = int(disr_field_index)
6968

7069
sole_variant_val = val[enum_members[0]]
7170
disr_field = get_field_at_index(sole_variant_val, disr_field_index)
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)]
71+
discriminant = int(sole_variant_val[disr_field])
7872

7973
if discriminant == 0:
8074
null_variant_name = first_variant_name[last_separator_index + 1:]
@@ -179,7 +173,7 @@ def to_string(self):
179173

180174
class IdentityPrinter:
181175
def __init__(self, string):
182-
self.string = string
176+
self.string
183177

184178
def to_string(self):
185179
return self.string

branches/snap-stage3/src/etc/licenseck.py

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

branches/snap-stage3/src/etc/lldb_rust_formatters.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,9 @@ 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)
141+
disr_val = val.GetChildAtIndex(0).GetChildAtIndex(disr_field_index).GetValueAsUnsigned()
142142

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:
143+
if disr_val == 0:
149144
# Null case: Print the name of the null-variant
150145
null_variant_name = first_variant_name[last_separator_index + 1:]
151146
return null_variant_name

branches/snap-stage3/src/etc/unicode.py

Lines changed: 7 additions & 9 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::Ordering::{Equal, Less, Greater};
295+
use core::cmp::{Equal, Less, Greater};
296296
use core::slice::SlicePrelude;
297297
r.binary_search(|&(lo,hi)| {
298298
if lo <= c && c <= hi { Equal }
@@ -350,11 +350,10 @@ 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::Ordering::{Equal, Less, Greater};
353+
use core::cmp::{Equal, Less, Greater};
354354
use core::slice::SlicePrelude;
355355
use core::tuple::Tuple2;
356-
use core::option::Option;
357-
use core::option::Option::{Some, None};
356+
use core::option::{Option, Some, None};
358357
use core::slice;
359358
360359
pub fn to_lower(c: char) -> char {
@@ -404,7 +403,7 @@ def emit_grapheme_module(f, grapheme_table, grapheme_cats):
404403
f.write(""" }
405404
406405
fn bsearch_range_value_table(c: char, r: &'static [(char, char, GraphemeCat)]) -> GraphemeCat {
407-
use core::cmp::Ordering::{Equal, Less, Greater};
406+
use core::cmp::{Equal, Less, Greater};
408407
match r.binary_search(|&(lo, hi, _)| {
409408
if lo <= c && c <= hi { Equal }
410409
else if hi < c { Less }
@@ -431,13 +430,12 @@ def emit_grapheme_module(f, grapheme_table, grapheme_cats):
431430

432431
def emit_charwidth_module(f, width_table):
433432
f.write("pub mod charwidth {\n")
434-
f.write(" use core::option::Option;\n")
435-
f.write(" use core::option::Option::{Some, None};\n")
433+
f.write(" use core::option::{Option, Some, None};\n")
436434
f.write(" use core::slice::SlicePrelude;\n")
437435
f.write(" use core::slice;\n")
438436
f.write("""
439437
fn bsearch_range_value_table(c: char, is_cjk: bool, r: &'static [(char, char, u8, u8)]) -> u8 {
440-
use core::cmp::Ordering::{Equal, Less, Greater};
438+
use core::cmp::{Equal, Less, Greater};
441439
match r.binary_search(|&(lo, hi, _, _)| {
442440
if lo <= c && c <= hi { Equal }
443441
else if hi < c { Less }
@@ -532,7 +530,7 @@ def comp_pfun(char):
532530

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

0 commit comments

Comments
 (0)