Skip to content

Commit 0c4c4b7

Browse files
committed
---
yaml --- r: 80805 b: refs/heads/try c: 1da4488 h: refs/heads/master i: 80803: b2d62d3 v: v3
1 parent a792723 commit 0c4c4b7

Some content is hidden

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

100 files changed

+1765
-2012
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 4c6bf4872012c010f84dc7fa2cdfe87522533f89
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cbd1eefbd350797b783df119fed7956d7e1c74ad
5-
refs/heads/try: 36872e4180331e4a7f00329abe7972488ce216cf
5+
refs/heads/try: 1da4488d8713a4190f110407470f57ddec42ec62
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/doc/rust.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1717,8 +1717,7 @@ Supported traits for `deriving` are:
17171717
* `Clone` and `DeepClone`, to perform (deep) copies.
17181718
* `IterBytes`, to iterate over the bytes in a data type.
17191719
* `Rand`, to create a random instance of a data type.
1720-
* `Default`, to create an empty instance of a data type.
1721-
* `Zero`, to create an zero instance of a numeric data type.
1720+
* `Zero`, to create an zero (or empty) instance of a data type.
17221721
* `ToStr`, to convert to a string. For a type with this instance,
17231722
`obj.to_str()` has similar output as `fmt!("%?", obj)`, but it differs in that
17241723
each constituent field of the type must also implement `ToStr` and will have

branches/try/doc/rustpkg.md

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,13 @@ A valid workspace must contain each of the following subdirectories:
5252
rustpkg will install libraries for bar to `foo/lib/x86_64-apple-darwin/`.
5353
The libraries will have names of the form `foo/lib/x86_64-apple-darwin/libbar-[hash].dylib`,
5454
where [hash] is a hash of the package ID.
55-
* 'bin/': `rustpkg install` installs executable binaries into this directory.
55+
* 'bin/': `rustpkg install` installs executable binaries into a target-specific subdirectory of this directory.
5656

57-
For example, rustpkg will install executables for `bar` to
58-
`foo/bin`.
59-
The executables will have names of the form `foo/bin/bar`.
57+
For example, on a 64-bit machine running Mac OS X,
58+
if `foo` is a workspace, containing the package `bar`,
59+
rustpkg will install executables for `bar` to
60+
`foo/bin/x86_64-apple-darwin/`.
61+
The executables will have names of the form `foo/bin/x86_64-apple-darwin/bar`.
6062
* 'build/': `rustpkg build` stores temporary build artifacts in a target-specific subdirectory of this directory.
6163

6264
For example, on a 64-bit machine running Mac OS X,
@@ -83,12 +85,6 @@ rustpkg also interprets any dependencies on such a package ID literally
8385
Thus, `github.com/mozilla/rust#5c4cd30f80` is also a valid package ID,
8486
since git can deduce that 5c4cd30f80 refers to a revision of the desired repository.
8587

86-
A package identifier can name a subdirectory of another package.
87-
For example, if `foo` is a workspace, and `foo/src/bar/lib.rs` exists,
88-
as well as `foo/src/bar/extras/baz/lib.rs`,
89-
then both `bar` and `bar/extras/baz` are valid package identifiers
90-
in the workspace `foo`.
91-
9288
## Source files
9389

9490
rustpkg searches for four different fixed filenames in order to determine the crates to build:
@@ -144,11 +140,9 @@ but not in their `lib` or `bin` directories.
144140

145141
## install
146142

147-
`rustpkg install foo` builds the libraries and/or executables that are targets for `foo`.
148-
If `RUST_PATH` is declared as an environment variable, then rustpkg installs the
149-
libraries and executables into the `lib` and `bin` subdirectories
150-
of the first entry in `RUST_PATH`.
151-
Otherwise, it installs them into `foo`'s `lib` and `bin` directories.
143+
`rustpkg install foo` builds the libraries and/or executables that are targets for `foo`,
144+
and then installs them either into `foo`'s `lib` and `bin` directories,
145+
or into the `lib` and `bin` subdirectories of the first entry in `RUST_PATH`.
152146

153147
## test
154148

branches/try/doc/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2249,7 +2249,7 @@ enum ABC { A, B, C }
22492249

22502250
The full list of derivable traits is `Eq`, `TotalEq`, `Ord`,
22512251
`TotalOrd`, `Encodable` `Decodable`, `Clone`, `DeepClone`,
2252-
`IterBytes`, `Rand`, `Default`, `Zero`, and `ToStr`.
2252+
`IterBytes`, `Rand`, `Zero`, and `ToStr`.
22532253

22542254
# Crates and the module system
22552255

branches/try/src/compiletest/compiletest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ pub fn make_test_name(config: &config, testfile: &Path) -> test::TestName {
309309
let filename = path.filename();
310310
let p = path.pop();
311311
let dir = p.filename();
312-
fmt!("%s/%s", dir.unwrap_or(""), filename.unwrap_or(""))
312+
fmt!("%s/%s", dir.unwrap_or_default(""), filename.unwrap_or_default(""))
313313
}
314314

315315
test::DynTestName(fmt!("[%s] %s",

branches/try/src/etc/emacs/README.md

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,27 @@
1-
`rust-mode`: A major Emacs mode for editing Rust source code
2-
============================================================
1+
rust-mode: A major emacs mode for editing Rust source code
2+
==========================================================
33

4-
`rust-mode` makes editing [Rust](http://rust-lang.org) code with Emacs
4+
`rust-mode` makes editing [Rust](http://rust-lang.org) code with emacs
55
enjoyable.
66

77

88
### Manual Installation
99

10-
To install manually, check out this repository and add this to your
11-
`.emacs` file:
10+
To install manually, check out this repository and add this to your .emacs
11+
file:
1212

13-
```lisp
14-
(add-to-list 'load-path "/path/to/rust-mode/")
15-
(require 'rust-mode)
16-
```
13+
(add-to-list 'load-path "/path/to/rust-mode/")
14+
(require 'rust-mode)
1715

18-
`rust-mode` will automatically be associated with `.rs` files. To enable it
19-
explicitly, do <kbd>M-x rust-mode</kbd>.
16+
Rust mode will automatically be associated with .rs files. To enable it
17+
explicitly, do `M-x rust-mode`.
2018

21-
### `package.el` installation via Marmalade or MELPA
19+
### package.el installation via Marmalade or MELPA
2220

2321
It can be more convenient to use Emacs's package manager to handle
2422
installation for you if you use many elisp libraries. If you have
25-
`package.el` but haven't added Marmalade or MELPA, the community
26-
package source, yet, add this to `~/.emacs.d/init.el`:
23+
package.el but haven't added Marmalade or MELPA, the community package source,
24+
yet, add this to ~/.emacs.d/init.el:
2725

2826
Using Marmalade:
2927

@@ -49,33 +47,32 @@ Then do this to load the package listing:
4947
* <kbd>M-x package-refresh-contents</kbd>
5048

5149
If you use a version of Emacs prior to 24 that doesn't include
52-
`package.el`, you can get it from [here](http://bit.ly/pkg-el23).
50+
package.el, you can get it from http://bit.ly/pkg-el23.
5351

54-
If you have an older ELPA `package.el` installed from tromey.com, you
52+
If you have an older ELPA package.el installed from tromey.com, you
5553
should upgrade in order to support installation from multiple sources.
5654
The ELPA archive is deprecated and no longer accepting new packages,
5755
so the version there (1.7.1) is very outdated.
5856

59-
#### Install `rust-mode`
57+
#### Install rust-mode
6058

61-
One you have `package.el`, you can install `rust-mode` or any other
62-
modes by choosing them from a list:
59+
From there you can install rust-mode or any other modes by choosing
60+
them from a list:
6361

6462
* <kbd>M-x package-list-packages</kbd>
6563

66-
Now, to install packages, move your cursor to them and press
67-
<kbd>i</kbd>. This will mark the packages for installation. When
68-
you're done with marking, press <kbd>x</kbd>, and ELPA will install
69-
the packages for you (under `~/.emacs.d/elpa/`).
64+
Now, to install packages, move your cursor to them and press i. This
65+
will mark the packages for installation. When you're done with
66+
marking, press x, and ELPA will install the packages for you (under
67+
~/.emacs.d/elpa/).
7068

71-
* or using <kbd>M-x package-install rust-mode</kbd>
69+
* or using <kbd>M-x package-install rust-mode
7270

7371
### Tests via ERT
7472

75-
The file `rust-mode-tests.el` contains tests that can be run via
76-
[ERT](http://www.gnu.org/software/emacs/manual/html_node/ert/index.html).
77-
You can use `run_rust_emacs_tests.sh` to run them in batch mode, if
78-
Emacs is somewhere in your `$PATH`.
73+
The file `rust-mode-tests.el` contains tests that can be run via ERT. You can
74+
use `run_rust_emacs_tests.sh` to run them in batch mode, if emacs is somewhere
75+
in your `$PATH`.
7976

8077
### Known bugs
8178

branches/try/src/libextra/crypto/md5.rs

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

11-
use std::iter::range_step;
11+
use std::uint;
1212

1313
use cryptoutil::{write_u32_le, read_u32v_le, FixedBuffer, FixedBuffer64, StandardPadding};
1414
use digest::Digest;
@@ -86,42 +86,46 @@ impl Md5State {
8686
read_u32v_le(data, input);
8787

8888
// round 1
89-
for i in range_step(0u, 16, 4) {
89+
do uint::range_step(0, 16, 4) |i| {
9090
a = op_f(a, b, c, d, data[i] + C1[i], 7);
9191
d = op_f(d, a, b, c, data[i + 1] + C1[i + 1], 12);
9292
c = op_f(c, d, a, b, data[i + 2] + C1[i + 2], 17);
9393
b = op_f(b, c, d, a, data[i + 3] + C1[i + 3], 22);
94-
}
94+
true
95+
};
9596

9697
// round 2
9798
let mut t = 1;
98-
for i in range_step(0u, 16, 4) {
99+
do uint::range_step(0, 16, 4) |i| {
99100
a = op_g(a, b, c, d, data[t & 0x0f] + C2[i], 5);
100101
d = op_g(d, a, b, c, data[(t + 5) & 0x0f] + C2[i + 1], 9);
101102
c = op_g(c, d, a, b, data[(t + 10) & 0x0f] + C2[i + 2], 14);
102103
b = op_g(b, c, d, a, data[(t + 15) & 0x0f] + C2[i + 3], 20);
103104
t += 20;
104-
}
105+
true
106+
};
105107

106108
// round 3
107109
t = 5;
108-
for i in range_step(0u, 16, 4) {
110+
do uint::range_step(0, 16, 4) |i| {
109111
a = op_h(a, b, c, d, data[t & 0x0f] + C3[i], 4);
110112
d = op_h(d, a, b, c, data[(t + 3) & 0x0f] + C3[i + 1], 11);
111113
c = op_h(c, d, a, b, data[(t + 6) & 0x0f] + C3[i + 2], 16);
112114
b = op_h(b, c, d, a, data[(t + 9) & 0x0f] + C3[i + 3], 23);
113115
t += 12;
114-
}
116+
true
117+
};
115118

116119
// round 4
117120
t = 0;
118-
for i in range_step(0u, 16, 4) {
121+
do uint::range_step(0, 16, 4) |i| {
119122
a = op_i(a, b, c, d, data[t & 0x0f] + C4[i], 6);
120123
d = op_i(d, a, b, c, data[(t + 7) & 0x0f] + C4[i + 1], 10);
121124
c = op_i(c, d, a, b, data[(t + 14) & 0x0f] + C4[i + 2], 15);
122125
b = op_i(b, c, d, a, data[(t + 21) & 0x0f] + C4[i + 3], 21);
123126
t += 28;
124-
}
127+
true
128+
};
125129

126130
self.s0 += a;
127131
self.s1 += b;

branches/try/src/libextra/crypto/sha2.rs

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

11-
use std::iter::range_step;
11+
use std::uint;
1212

1313
use cryptoutil::{write_u64_be, write_u32_be, read_u64v_be, read_u32v_be, add_bytes_to_bits,
1414
add_bytes_to_bits_tuple, FixedBuffer, FixedBuffer128, FixedBuffer64, StandardPadding};
@@ -111,7 +111,7 @@ impl Engine512State {
111111

112112
// Putting the message schedule inside the same loop as the round calculations allows for
113113
// the compiler to generate better code.
114-
for t in range_step(0u, 64, 8) {
114+
do uint::range_step(0, 64, 8) |t| {
115115
schedule_round!(t + 16);
116116
schedule_round!(t + 17);
117117
schedule_round!(t + 18);
@@ -129,9 +129,10 @@ impl Engine512State {
129129
sha2_round!(d, e, f, g, h, a, b, c, K64, t + 5);
130130
sha2_round!(c, d, e, f, g, h, a, b, K64, t + 6);
131131
sha2_round!(b, c, d, e, f, g, h, a, K64, t + 7);
132-
}
132+
true
133+
};
133134

134-
for t in range_step(64u, 80, 8) {
135+
do uint::range_step(64, 80, 8) |t| {
135136
sha2_round!(a, b, c, d, e, f, g, h, K64, t);
136137
sha2_round!(h, a, b, c, d, e, f, g, K64, t + 1);
137138
sha2_round!(g, h, a, b, c, d, e, f, K64, t + 2);
@@ -140,7 +141,8 @@ impl Engine512State {
140141
sha2_round!(d, e, f, g, h, a, b, c, K64, t + 5);
141142
sha2_round!(c, d, e, f, g, h, a, b, K64, t + 6);
142143
sha2_round!(b, c, d, e, f, g, h, a, K64, t + 7);
143-
}
144+
true
145+
};
144146

145147
self.H0 += a;
146148
self.H1 += b;
@@ -525,7 +527,7 @@ impl Engine256State {
525527

526528
// Putting the message schedule inside the same loop as the round calculations allows for
527529
// the compiler to generate better code.
528-
for t in range_step(0u, 48, 8) {
530+
do uint::range_step(0, 48, 8) |t| {
529531
schedule_round!(t + 16);
530532
schedule_round!(t + 17);
531533
schedule_round!(t + 18);
@@ -543,9 +545,10 @@ impl Engine256State {
543545
sha2_round!(d, e, f, g, h, a, b, c, K32, t + 5);
544546
sha2_round!(c, d, e, f, g, h, a, b, K32, t + 6);
545547
sha2_round!(b, c, d, e, f, g, h, a, K32, t + 7);
546-
}
548+
true
549+
};
547550

548-
for t in range_step(48u, 64, 8) {
551+
do uint::range_step(48, 64, 8) |t| {
549552
sha2_round!(a, b, c, d, e, f, g, h, K32, t);
550553
sha2_round!(h, a, b, c, d, e, f, g, K32, t + 1);
551554
sha2_round!(g, h, a, b, c, d, e, f, K32, t + 2);
@@ -554,7 +557,8 @@ impl Engine256State {
554557
sha2_round!(d, e, f, g, h, a, b, c, K32, t + 5);
555558
sha2_round!(c, d, e, f, g, h, a, b, K32, t + 6);
556559
sha2_round!(b, c, d, e, f, g, h, a, K32, t + 7);
557-
}
560+
true
561+
};
558562

559563
self.H0 += a;
560564
self.H1 += b;

0 commit comments

Comments
 (0)