Skip to content

Commit 4293dbf

Browse files
committed
---
yaml --- r: 163151 b: refs/heads/snap-stage3 c: 2171c95 h: refs/heads/master i: 163149: a37a884 163147: d9e9149 163143: 3396fac 163135: 5253ebd v: v3
1 parent 6b66750 commit 4293dbf

File tree

435 files changed

+2444
-4988
lines changed

Some content is hidden

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

435 files changed

+2444
-4988
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: c56344ba310a8996f4975d61a7c5bed115ad4940
4+
refs/heads/snap-stage3: 2171c95553e1cf225e9e6e799ebecfb959ff2277
55
refs/heads/try: 20cbbffeefc1f35e2ea63afce7b42fbd79611d42
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/mk/dist.mk

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,15 @@ PKG_EXE = dist/$(PKG_NAME)-$(CFG_BUILD).exe
123123
$(PKG_EXE): rust.iss modpath.iss upgrade.iss LICENSE.txt rust-logo.ico \
124124
$(CSREQ3_T_$(CFG_BUILD)_H_$(CFG_BUILD)) \
125125
dist-prepare-win
126-
$(Q)rm -rf tmp/dist/win/gcc
127-
$(CFG_PYTHON) $(S)src/etc/make-win-dist.py tmp/dist/win/rust tmp/dist/win/gcc $(CFG_BUILD)
126+
$(CFG_PYTHON) $(S)src/etc/make-win-dist.py tmp/dist/win $(CFG_BUILD)
128127
@$(call E, ISCC: $@)
129128
$(Q)$(CFG_ISCC) $<
130129

131130
$(eval $(call DEF_PREPARE,win))
132131

133132
dist-prepare-win: PREPARE_HOST=$(CFG_BUILD)
134133
dist-prepare-win: PREPARE_TARGETS=$(CFG_BUILD)
135-
dist-prepare-win: PREPARE_DEST_DIR=tmp/dist/win/rust
134+
dist-prepare-win: PREPARE_DEST_DIR=tmp/dist/win
136135
dist-prepare-win: PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD)
137136
dist-prepare-win: PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD)
138137
dist-prepare-win: PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)

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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ pub fn make_test(config: &Config, testfile: &Path, f: || -> test::TestFn)
346346
desc: test::TestDesc {
347347
name: make_test_name(config, testfile),
348348
ignore: header::is_test_ignored(config, testfile),
349-
should_fail: test::ShouldFail::No,
349+
should_fail: false
350350
},
351351
testfn: f(),
352352
}

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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Here's what's in `src/main.rs`:
6464

6565
```{rust}
6666
fn main() {
67-
println!("Hello, world!")
67+
println!("Hello, world!");
6868
}
6969
```
7070

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

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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/make-win-dist.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@
88
# option. This file may not be copied, modified, or distributed
99
# except according to those terms.
1010

11-
# Script parameters:
12-
# argv[1] = rust component root,
13-
# argv[2] = gcc component root,
14-
# argv[3] = target triple
15-
# The first two correspond to the two installable components defined in the setup script.
16-
1711
import sys, os, shutil, subprocess
1812

1913
def find_files(files, path):
@@ -28,7 +22,7 @@ def find_files(files, path):
2822
raise Exception("Could not find '%s' in %s" % (fname, path))
2923
return found
3024

31-
def make_win_dist(rust_root, gcc_root, target_triple):
25+
def make_win_dist(dist_root, target_triple):
3226
# Ask gcc where it keeps its stuff
3327
gcc_out = subprocess.check_output(["gcc.exe", "-print-search-dirs"])
3428
bin_path = os.environ["PATH"].split(os.pathsep)
@@ -96,29 +90,29 @@ def make_win_dist(rust_root, gcc_root, target_triple):
9690
target_libs = find_files(target_libs, lib_path)
9791

9892
# Copy runtime dlls next to rustc.exe
99-
dist_bin_dir = os.path.join(rust_root, "bin")
93+
dist_bin_dir = os.path.join(dist_root, "bin")
10094
for src in rustc_dlls:
10195
shutil.copy(src, dist_bin_dir)
10296

10397
# Copy platform tools to platform-specific bin directory
104-
target_bin_dir = os.path.join(gcc_root, "bin", "rustlib", target_triple, "bin")
98+
target_bin_dir = os.path.join(dist_root, "bin", "rustlib", target_triple, "bin")
10599
if not os.path.exists(target_bin_dir):
106100
os.makedirs(target_bin_dir)
107101
for src in target_tools:
108102
shutil.copy(src, target_bin_dir)
109103

110104
# Copy platform libs to platform-spcific lib directory
111-
target_lib_dir = os.path.join(gcc_root, "bin", "rustlib", target_triple, "lib")
105+
target_lib_dir = os.path.join(dist_root, "bin", "rustlib", target_triple, "lib")
112106
if not os.path.exists(target_lib_dir):
113107
os.makedirs(target_lib_dir)
114108
for src in target_libs:
115109
shutil.copy(src, target_lib_dir)
116110

117111
# Copy license files
118-
lic_dir = os.path.join(rust_root, "bin", "third-party")
112+
lic_dir = os.path.join(dist_root, "bin", "third-party")
119113
if os.path.exists(lic_dir):
120114
shutil.rmtree(lic_dir) # copytree() won't overwrite existing files
121115
shutil.copytree(os.path.join(os.path.dirname(__file__), "third-party"), lic_dir)
122116

123117
if __name__=="__main__":
124-
make_win_dist(sys.argv[1], sys.argv[2], sys.argv[3])
118+
make_win_dist(sys.argv[1], sys.argv[2])

branches/snap-stage3/src/etc/pkg/rust.iss

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ AppPublisherURL=http://www.rust-lang.org
1414
VersionInfoVersion={#CFG_VERSION_WIN}
1515
LicenseFile=LICENSE.txt
1616

17-
PrivilegesRequired=lowest
1817
DisableWelcomePage=true
1918
DisableProgramGroupPage=true
2019
DisableReadyPage=true
@@ -38,13 +37,8 @@ Uninstallable=yes
3837
[Tasks]
3938
Name: modifypath; Description: &Add {app}\bin to your PATH (recommended)
4039

41-
[Components]
42-
Name: rust; Description: "Rust compiler and standard crates"; Types: full compact custom; Flags: fixed
43-
Name: gcc; Description: "Linker and platform libraries"; Types: full
44-
4540
[Files]
46-
Source: "tmp/dist/win/rust/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: rust
47-
Source: "tmp/dist/win/gcc/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: gcc
41+
Source: "tmp/dist/win/*.*" ; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
4842

4943
[Code]
5044
const

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, _)| {

branches/snap-stage3/src/liballoc/arc.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ 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::Option;
26-
use core::option::Option::{Some, None};
25+
use core::option::{Some, None, Option};
2726
use core::ptr::RawPtr;
2827
use core::ptr;
2928
use heap::deallocate;
@@ -327,8 +326,7 @@ mod tests {
327326
use std::comm::channel;
328327
use std::mem::drop;
329328
use std::ops::Drop;
330-
use std::option::Option;
331-
use std::option::Option::{Some, None};
329+
use std::option::{Option, Some, None};
332330
use std::str::Str;
333331
use std::sync::atomic;
334332
use std::task;
@@ -523,7 +521,7 @@ mod tests {
523521
#[test]
524522
fn show_arc() {
525523
let a = Arc::new(5u32);
526-
assert!(format!("{}", a) == "5")
524+
assert!(format!("{}", a).as_slice() == "5")
527525
}
528526

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

branches/snap-stage3/src/liballoc/boxed.rs

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

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

176175
let a = &8u as &Any;
177176
let b = &Test as &Any;
178177
let s = format!("{}", a);
179-
assert_eq!(s, "&Any");
178+
assert_eq!(s.as_slice(), "&Any");
180179
let s = format!("{}", b);
181-
assert_eq!(s, "&Any");
180+
assert_eq!(s.as_slice(), "&Any");
182181
}
183182
}

0 commit comments

Comments
 (0)