Skip to content

Commit e9e9027

Browse files
committed
---
yaml --- r: 63247 b: refs/heads/snap-stage3 c: 78cddc8 h: refs/heads/master i: 63245: 0d1a304 63243: d8f9be9 63239: 1aed2aa 63231: ef08c0a v: v3
1 parent 44fe9b7 commit e9e9027

File tree

1,002 files changed

+63123
-15725
lines changed

Some content is hidden

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

1,002 files changed

+63123
-15725
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: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: e7213aa21e9a79db01d2e9d1b76761a420e4c967
4+
refs/heads/snap-stage3: 78cddc83a44f04c7252435c9d6fff01b43cb44b3
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
src/rt/msvc/* -whitespace
88
src/rt/vg/* -whitespace
99
src/rt/linenoise/* -whitespace
10+
src/rt/jemalloc/**/* -whitespace

branches/snap-stage3/.mailmap

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#
2+
# This list is used by git-shortlog to aggregate contributions. It is
3+
# necessary when either the author's full name is not always written
4+
# the same way, and/or the same author contributes from different
5+
# email addresses.
6+
#
7+
8+
Elly Jones <[email protected]>
9+
10+
Junyoung Cho <[email protected]>
11+
Matthijs Hofstra <[email protected]>
12+
Rob Arnold <[email protected]>

branches/snap-stage3/CONTRIBUTING.md

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,42 @@
11
## Pull request procedure
22

3-
Pull requests should be targeted at Rust's `incoming` branch (note that by default Github will aim them at the `master` branch) --
4-
see "Changing The Commit Range and Destination Repository" in Github's documentation on [pull requests](https://help.github.com/articles/using-pull-requests).
5-
Before pushing to your Github repo and issuing the pull request, please do two things:
3+
Pull requests should be targeted at Rust's `incoming` branch (note
4+
that by default Github will aim them at the `master` branch) -- see
5+
"Changing The Commit Range and Destination Repository" in Github's
6+
documentation on [pull
7+
requests](https://help.github.com/articles/using-pull-requests).
8+
Before pushing to your Github repo and issuing the pull request,
9+
please do two things:
610

7-
1. [Rebase](http://git-scm.com/book/en/Git-Branching-Rebasing) your local changes against the `incoming` branch. Resolve any conflicts that arise.
8-
2. Run the full Rust test suite with the `make check` command.
9-
You're not off the hook even if you just stick to documentation; code examples in the docs are tested as well!
11+
1. [Rebase](http://git-scm.com/book/en/Git-Branching-Rebasing) your
12+
local changes against the `incoming` branch. Resolve any conflicts
13+
that arise.
1014

11-
Pull requests will be treated as "review requests",
12-
and we will give feedback we expect to see corrected on [style](https://github.com/mozilla/rust/wiki/Note-style-guide) and substance before pulling.
13-
Changes contributed via pull request should focus on a single issue at a time, like any other.
14-
We will not accept pull-requests that try to "sneak" unrelated changes in.
15+
2. Run the full Rust test suite with the `make check` command. You're
16+
not off the hook even if you just stick to documentation; code
17+
examples in the docs are tested as well!
1518

16-
Normally, all pull requests must include regression tests (see [Note-testsuite](https://github.com/mozilla/rust/wiki/Note-testsuite)) that test your change.
17-
Occasionally, a change will be very difficult to test for.
18-
In those cases, please include a note in your commit message explaining why.
19+
Pull requests will be treated as "review requests", and we will give
20+
feedback we expect to see corrected on
21+
[style](https://github.com/mozilla/rust/wiki/Note-style-guide) and
22+
substance before pulling. Changes contributed via pull request should
23+
focus on a single issue at a time, like any other. We will not accept
24+
pull-requests that try to "sneak" unrelated changes in.
1925

20-
In the licensing header at the beginning of any files you change, please make sure the listed date range includes the current year.
21-
For example, if it's 2013, and you change a Rust file that was created in 2010, it should begin:
26+
Normally, all pull requests must include regression tests (see
27+
[Note-testsuite](https://github.com/mozilla/rust/wiki/Note-testsuite))
28+
that test your change. Occasionally, a change will be very difficult
29+
to test for. In those cases, please include a note in your commit
30+
message explaining why.
31+
32+
In the licensing header at the beginning of any files you change,
33+
please make sure the listed date range includes the current year. For
34+
example, if it's 2013, and you change a Rust file that was created in
35+
2010, it should begin:
2236

2337
```
2438
// Copyright 2010-2013 The Rust Project Developers.
2539
```
2640

27-
For more details, please refer to [Note-development-policy](https://github.com/mozilla/rust/wiki/Note-development-policy).
41+
For more details, please refer to
42+
[Note-development-policy](https://github.com/mozilla/rust/wiki/Note-development-policy).

branches/snap-stage3/Makefile.in

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ ifneq ($(wildcard $(CFG_GIT)),)
146146
ifneq ($(wildcard $(CFG_GIT_DIR)),)
147147
CFG_VERSION += $(shell git --git-dir=$(CFG_GIT_DIR) log -1 \
148148
--pretty=format:'(%h %ci)')
149-
CFG_VER_HASH = $(shell git --git-dir=$(CFG_GIT_DIR) log -1 \
150-
--pretty=format:'%H')
149+
CFG_VER_HASH = $(shell git --git-dir=$(CFG_GIT_DIR) rev-parse HEAD)
151150
endif
152151
endif
153152

branches/snap-stage3/configure

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ validate_opt () {
138138
done
139139
if [ "$arg" = "--help" ]
140140
then
141-
echo ""
141+
echo
142142
echo "No more help available for Configure options,"
143143
echo "check the Uncyclo or join our IRC channel"
144144
break
@@ -349,11 +349,11 @@ if [ "$1" = "--help" ]
349349
then
350350
HELP=1
351351
shift
352-
echo ""
352+
echo
353353
echo "Usage: $CFG_SELF [options]"
354-
echo ""
354+
echo
355355
echo "Options:"
356-
echo ""
356+
echo
357357
else
358358
msg "recreating config.tmp"
359359
echo '' >config.tmp
@@ -394,7 +394,7 @@ validate_opt
394394

395395
if [ $HELP -eq 1 ]
396396
then
397-
echo ""
397+
echo
398398
exit 0
399399
fi
400400

@@ -561,7 +561,7 @@ then
561561
| cut -d ' ' -f 2)
562562

563563
case $CFG_CLANG_VERSION in
564-
(3.0svn | 3.0 | 3.1* | 3.2* | 3.3*)
564+
(3.0svn | 3.0 | 3.1* | 3.2* | 3.3* | 3.4* )
565565
step_msg "found ok version of CLANG: $CFG_CLANG_VERSION"
566566
CFG_C_COMPILER="clang"
567567
;;
@@ -683,7 +683,8 @@ do
683683
for i in \
684684
isaac linenoise sync test \
685685
arch/i386 arch/x86_64 arch/arm arch/mips \
686-
libuv libuv/src/ares libuv/src/eio libuv/src/ev
686+
libuv libuv/src/ares libuv/src/eio libuv/src/ev \
687+
jemalloc
687688
do
688689
make_dir rt/$t/stage$s/$i
689690
done
@@ -970,6 +971,13 @@ then
970971
putvar CFG_CCACHE_CPP2
971972
fi
972973

974+
if [ ! -z "$CFG_ENABLE_CCACHE" ]
975+
then
976+
CFG_CCACHE_BASEDIR=${CFG_SRC_DIR}
977+
putvar CFG_CCACHE_BASEDIR
978+
fi
979+
980+
973981
if [ ! -z $BAD_PANDOC ]
974982
then
975983
CFG_PANDOC=

branches/snap-stage3/doc/rust.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,10 @@ num_lit : nonzero_dec [ dec_digit | '_' ] * num_suffix ?
301301
num_suffix : int_suffix | float_suffix ;
302302
303303
int_suffix : 'u' int_suffix_size ?
304-
| 'i' int_suffix_size ;
304+
| 'i' int_suffix_size ? ;
305305
int_suffix_size : [ '8' | '1' '6' | '3' '2' | '6' '4' ] ;
306306
307-
float_suffix : [ exponent | '.' dec_lit exponent ? ] float_suffix_ty ? ;
307+
float_suffix : [ exponent | '.' dec_lit exponent ? ] ? float_suffix_ty ? ;
308308
float_suffix_ty : 'f' [ '3' '2' | '6' '4' ] ;
309309
exponent : ['E' | 'e'] ['-' | '+' ] ? dec_lit ;
310310
dec_lit : [ dec_digit | '_' ] + ;
@@ -803,19 +803,14 @@ An example of `use` declarations:
803803

804804
~~~~
805805
use std::float::sin;
806-
use std::str::{slice, contains};
807-
use std::option::Some;
806+
use std::option::{Some, None};
808807
809808
fn main() {
810809
// Equivalent to 'info!(std::float::sin(1.0));'
811810
info!(sin(1.0));
812811
813-
// Equivalent to 'info!(std::option::Some(1.0));'
814-
info!(Some(1.0));
815-
816-
// Equivalent to
817-
// 'info!(std::str::contains(std::str::slice("foo", 0, 1), "oo"));'
818-
info!(contains(slice("foo", 0, 1), "oo"));
812+
// Equivalent to 'info!(~[std::option::Some(1.0), std::option::None]);'
813+
info!(~[Some(1.0), None]);
819814
}
820815
~~~~
821816

@@ -1297,7 +1292,7 @@ with matching types and type parameter counts.
12971292

12981293
An implementation can take type parameters,
12991294
which can be different from the type parameters taken by the trait it implements.
1300-
Implementation parameters are written after after the `impl` keyword.
1295+
Implementation parameters are written after the `impl` keyword.
13011296

13021297
~~~~
13031298
# trait Seq<T> { }
@@ -1840,6 +1835,7 @@ is bounds-checked at run-time. When the check fails, it will put the
18401835
task in a _failing state_.
18411836

18421837
~~~~
1838+
# use std::task;
18431839
# do task::spawn_unlinked {
18441840
18451841
([1, 2, 3, 4])[0];
@@ -2032,7 +2028,8 @@ as
20322028
=
20332029
~~~~
20342030

2035-
Operators at the same precedence level are evaluated left-to-right.
2031+
Operators at the same precedence level are evaluated left-to-right. [Unary operators](#unary-operator-expressions)
2032+
have the same precedence level and it is stronger than any of the binary operators'.
20362033

20372034
### Grouped expressions
20382035

@@ -2168,7 +2165,7 @@ fn ten_times(f: &fn(int)) {
21682165
}
21692166
}
21702167
2171-
ten_times(|j| io::println(fmt!("hello, %d", j)));
2168+
ten_times(|j| println(fmt!("hello, %d", j)));
21722169
21732170
~~~~
21742171

@@ -2189,7 +2186,7 @@ An example:
21892186
let mut i = 0;
21902187
21912188
while i < 10 {
2192-
io::println("hello\n");
2189+
println("hello\n");
21932190
i = i + 1;
21942191
}
21952192
~~~~
@@ -2323,7 +2320,9 @@ An example of a for loop over the contents of a vector:
23232320
~~~~
23242321
# type foo = int;
23252322
# fn bar(f: foo) { }
2326-
# let a = 0, b = 0, c = 0;
2323+
# let a = 0;
2324+
# let b = 0;
2325+
# let c = 0;
23272326
23282327
let v: &[foo] = &[a, b, c];
23292328
@@ -2335,6 +2334,7 @@ for v.each |e| {
23352334
An example of a for loop over a series of integers:
23362335

23372336
~~~~
2337+
# use std::uint;
23382338
# fn bar(b:uint) { }
23392339
for uint::range(0, 256) |i| {
23402340
bar(i);
@@ -2798,6 +2798,7 @@ the vtable pointer for the `T` implementation of `R`, and the pointer value of `
27982798
An example of an object type:
27992799

28002800
~~~~~~~~
2801+
# use std::int;
28012802
trait Printable {
28022803
fn to_str(&self) -> ~str;
28032804
}
@@ -2807,7 +2808,7 @@ impl Printable for int {
28072808
}
28082809
28092810
fn print(a: @Printable) {
2810-
io::println(a.to_str());
2811+
println(a.to_str());
28112812
}
28122813
28132814
fn main() {
@@ -2996,7 +2997,7 @@ allocated within the stack's memory. The value is a part of the stack frame.
29962997

29972998
Local variables are immutable unless declared with `let mut`. The
29982999
`mut` keyword applies to all local variables declared within that
2999-
declaration (so `let mut x, y` declares two mutable variables, `x` and
3000+
declaration (so `let mut (x, y) = ...` declares two mutable variables, `x` and
30003001
`y`).
30013002

30023003
Function parameters are immutable unless declared with `mut`. The

branches/snap-stage3/doc/rustpkg.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ or the equivalent on Windows.
3030

3131
Each workspace may contain one or more packages.
3232

33+
When building code that contains one or more directives of the form `extern mod P`,
34+
rustpkg automatically searches for packages named `P` in the `RUST_PATH` (as described above).
35+
It builds those dependencies if necessary.
36+
Thus, when using rustpkg,
37+
there is no need for `-L` flags to tell the linker where to find libraries for external crates.
38+
3339
# Package structure
3440

3541
A valid workspace must contain each of the following subdirectories:
@@ -66,6 +72,10 @@ A package can be stored in a workspace on the local file system,
6672
or on a remote Web server, in which case the package ID resembles a URL.
6773
For example, `github.com/mozilla/rust` is a package ID
6874
that would refer to the git repository browsable at `http://github.com/mozilla/rust`.
75+
A package ID can also specify a version, like:
76+
`github.com/mozilla/rust#0.3`.
77+
In this case, `rustpkg` will check that the repository `github.com/mozilla/rust` has a tag named `0.3`,
78+
and report an error otherwise.
6979

7080
## Source files
7181

@@ -76,6 +86,15 @@ rustpkg searches for four different fixed filenames in order to determine the cr
7686
* `test.rs`: Assumed to contain tests declared with the `#[test]` attribute.
7787
* `bench.rs`: Assumed to contain benchmarks declared with the `#[bench]` attribute.
7888

89+
## Versions
90+
91+
`rustpkg` packages do not need to declare their versions with an attribute inside one of the source files,
92+
because `rustpkg` infers it from the version control system.
93+
When building a package that is in a `git` repository,
94+
`rustpkg` assumes that the most recent tag specifies the current version.
95+
When building a package that is not under version control,
96+
or that has no tags, `rustpkg` assumes the intended version is 0.1.
97+
7998
# Custom build scripts
8099

81100
A file called `pkg.rs` at the root level in a workspace is called a *package script*.

branches/snap-stage3/doc/tutorial-ffi.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,17 +149,18 @@ A type with the same functionality as owned boxes can be implemented by
149149
wrapping `malloc` and `free`:
150150

151151
~~~~
152+
use std::cast;
152153
use std::libc::{c_void, size_t, malloc, free};
154+
use std::ptr;
153155
use std::unstable::intrinsics;
154-
use std::util;
155156
156157
// a wrapper around the handle returned by the foreign code
157158
pub struct Unique<T> {
158159
priv ptr: *mut T
159160
}
160161
161-
pub impl<T: Owned> Unique<T> {
162-
fn new(value: T) -> Unique<T> {
162+
impl<T: Owned> Unique<T> {
163+
pub fn new(value: T) -> Unique<T> {
163164
unsafe {
164165
let ptr = malloc(std::sys::size_of::<T>() as size_t) as *mut T;
165166
assert!(!ptr::is_null(ptr));
@@ -170,12 +171,12 @@ pub impl<T: Owned> Unique<T> {
170171
}
171172
172173
// the 'r lifetime results in the same semantics as `&*x` with ~T
173-
fn borrow<'r>(&'r self) -> &'r T {
174+
pub fn borrow<'r>(&'r self) -> &'r T {
174175
unsafe { cast::copy_lifetime(self, &*self.ptr) }
175176
}
176177
177178
// the 'r lifetime results in the same semantics as `&mut *x` with ~T
178-
fn borrow_mut<'r>(&'r mut self) -> &'r mut T {
179+
pub fn borrow_mut<'r>(&'r mut self) -> &'r mut T {
179180
unsafe { cast::copy_mut_lifetime(self, &mut *self.ptr) }
180181
}
181182
}
@@ -184,9 +185,9 @@ pub impl<T: Owned> Unique<T> {
184185
impl<T: Owned> Drop for Unique<T> {
185186
fn finalize(&self) {
186187
unsafe {
187-
let mut x = intrinsics::init(); // dummy value to swap in
188+
let x = intrinsics::init(); // dummy value to swap in
188189
// moving the object out is needed to call the destructor
189-
util::replace_ptr(self.ptr, x);
190+
ptr::replace_ptr(self.ptr, x);
190191
free(self.ptr as *c_void)
191192
}
192193
}

0 commit comments

Comments
 (0)