Skip to content

Commit 11fb1db

Browse files
committed
---
yaml --- r: 163818 b: refs/heads/master c: f07526a h: refs/heads/master v: v3
1 parent 55883a6 commit 11fb1db

File tree

321 files changed

+16846
-11987
lines changed

Some content is hidden

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

321 files changed

+16846
-11987
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: b9c3b5693ad599dafa64559089f92233015dd633
2+
refs/heads/master: f07526a9990ab07983905fb5f383e62ae72242bc
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 8443b09e361b96d1f9b7f45a65ed0d31c0e86e70
55
refs/heads/try: 20cbbffeefc1f35e2ea63afce7b42fbd79611d42

trunk/mk/crates.mk

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ TARGET_CRATES := libc std flate arena term \
5353
serialize getopts collections test time rand \
5454
log regex graphviz core rbml alloc rustrt \
5555
unicode
56-
RUSTC_CRATES := rustc rustc_typeck rustc_driver rustc_trans rustc_back rustc_llvm
56+
RUSTC_CRATES := rustc rustc_typeck rustc_borrowck rustc_driver rustc_trans rustc_back rustc_llvm
5757
HOST_CRATES := syntax $(RUSTC_CRATES) rustdoc regex_macros fmt_macros
5858
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5959
TOOLS := compiletest rustdoc rustc
@@ -67,11 +67,12 @@ DEPS_std := core libc rand alloc collections rustrt unicode \
6767
native:rust_builtin native:backtrace
6868
DEPS_graphviz := std
6969
DEPS_syntax := std term serialize log fmt_macros arena libc
70-
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back \
70+
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \
7171
rustc_typeck log syntax serialize rustc_llvm rustc_trans
7272
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back \
7373
log syntax serialize rustc_llvm
7474
DEPS_rustc_typeck := rustc syntax
75+
DEPS_rustc_borrowck := rustc log graphviz syntax
7576
DEPS_rustc := syntax flate arena serialize getopts rbml \
7677
time log graphviz rustc_llvm rustc_back
7778
DEPS_rustc_llvm := native:rustllvm libc std
@@ -117,9 +118,10 @@ ONLY_RLIB_unicode := 1
117118
DOC_CRATES := $(filter-out rustc, \
118119
$(filter-out rustc_trans, \
119120
$(filter-out rustc_typeck, \
121+
$(filter-out rustc_borrowck, \
120122
$(filter-out rustc_driver, \
121-
$(filter-out syntax, $(CRATES))))))
122-
COMPILER_DOC_CRATES := rustc rustc_trans rustc_typeck rustc_driver syntax
123+
$(filter-out syntax, $(CRATES)))))))
124+
COMPILER_DOC_CRATES := rustc rustc_trans rustc_borrowck rustc_typeck rustc_driver syntax
123125

124126
# This macro creates some simple definitions for each crate being built, just
125127
# some munging of all of the parameters above.

trunk/mk/dist.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ PKG_FILES := \
4848
$(S)configure $(S)Makefile.in \
4949
$(S)man \
5050
$(addprefix $(S)src/, \
51-
README.md \
5251
compiletest \
5352
doc \
5453
driver \
@@ -123,15 +122,16 @@ PKG_EXE = dist/$(PKG_NAME)-$(CFG_BUILD).exe
123122
$(PKG_EXE): rust.iss modpath.iss upgrade.iss LICENSE.txt rust-logo.ico \
124123
$(CSREQ3_T_$(CFG_BUILD)_H_$(CFG_BUILD)) \
125124
dist-prepare-win
126-
$(CFG_PYTHON) $(S)src/etc/make-win-dist.py tmp/dist/win $(CFG_BUILD)
125+
$(Q)rm -rf tmp/dist/win/gcc
126+
$(CFG_PYTHON) $(S)src/etc/make-win-dist.py tmp/dist/win/rust tmp/dist/win/gcc $(CFG_BUILD)
127127
@$(call E, ISCC: $@)
128128
$(Q)$(CFG_ISCC) $<
129129

130130
$(eval $(call DEF_PREPARE,win))
131131

132132
dist-prepare-win: PREPARE_HOST=$(CFG_BUILD)
133133
dist-prepare-win: PREPARE_TARGETS=$(CFG_BUILD)
134-
dist-prepare-win: PREPARE_DEST_DIR=tmp/dist/win
134+
dist-prepare-win: PREPARE_DEST_DIR=tmp/dist/win/rust
135135
dist-prepare-win: PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD)
136136
dist-prepare-win: PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD)
137137
dist-prepare-win: PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)

trunk/mk/tests.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $(eval $(call RUST_CRATE,coretest))
2121

2222
TEST_TARGET_CRATES = $(filter-out core unicode,$(TARGET_CRATES)) coretest
2323
TEST_DOC_CRATES = $(DOC_CRATES)
24-
TEST_HOST_CRATES = $(filter-out rustc_typeck rustc_trans,$(HOST_CRATES))
24+
TEST_HOST_CRATES = $(filter-out rustc_typeck rustc_borrowck rustc_trans,$(HOST_CRATES))
2525
TEST_CRATES = $(TEST_TARGET_CRATES) $(TEST_HOST_CRATES)
2626

2727
######################################################################

trunk/src/README.md

Lines changed: 0 additions & 66 deletions
This file was deleted.

trunk/src/doc/guide-crates.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ two languages for those phrases to be in. We'll use this module layout:
3232
+---------+ | +-----------+
3333
| +---| farewells |
3434
+---------+ | +-----------+
35-
| phrases |---+
35+
| phrases |---+
3636
+---------+ | +-----------+
3737
| +---| greetings |
3838
+----------+ | +-----------+
@@ -219,7 +219,7 @@ Put this in `src/english/greetings.rs`:
219219

220220
fn hello() -> String {
221221
"Hello!".to_string()
222-
}
222+
}
223223
```
224224

225225
Put this in `src/english/farewells.rs`:
@@ -229,7 +229,7 @@ Put this in `src/english/farewells.rs`:
229229

230230
fn goodbye() -> String {
231231
"Goodbye.".to_string()
232-
}
232+
}
233233
```
234234

235235
Put this in `src/japanese/greetings.rs`:
@@ -239,7 +239,7 @@ Put this in `src/japanese/greetings.rs`:
239239

240240
fn hello() -> String {
241241
"こんにちは".to_string()
242-
}
242+
}
243243
```
244244

245245
Of course, you can copy and paste this from this web page, or just type
@@ -253,7 +253,7 @@ Put this in `src/japanese/farewells.rs`:
253253

254254
fn goodbye() -> String {
255255
"さようなら".to_string()
256-
}
256+
}
257257
```
258258

259259
(This is "Sayoonara", if you're curious.)
@@ -381,11 +381,11 @@ $ cargo run
381381
/home/you/projects/phrases/src/japanese/greetings.rs:1:1: 3:2 warning: code is never used: `hello`, #[warn(dead_code)] on by default
382382
/home/you/projects/phrases/src/japanese/greetings.rs:1 fn hello() -> String {
383383
/home/you/projects/phrases/src/japanese/greetings.rs:2 "こんにちは".to_string()
384-
/home/you/projects/phrases/src/japanese/greetings.rs:3 }
384+
/home/you/projects/phrases/src/japanese/greetings.rs:3 }
385385
/home/you/projects/phrases/src/japanese/farewells.rs:1:1: 3:2 warning: code is never used: `goodbye`, #[warn(dead_code)] on by default
386386
/home/you/projects/phrases/src/japanese/farewells.rs:1 fn goodbye() -> String {
387387
/home/you/projects/phrases/src/japanese/farewells.rs:2 "さようなら".to_string()
388-
/home/you/projects/phrases/src/japanese/farewells.rs:3 }
388+
/home/you/projects/phrases/src/japanese/farewells.rs:3 }
389389
Running `target/phrases`
390390
Hello in English: Hello!
391391
Goodbye in English: Goodbye.
@@ -452,7 +452,7 @@ fn main() {
452452
453453
Rust will give us a compile-time error:
454454
455-
```{notrust,ignore}
455+
```{notrust}
456456
Compiling phrases v0.0.1 (file:///home/you/projects/phrases)
457457
/home/you/projects/phrases/src/main.rs:4:5: 4:40 error: a value named `hello` has already been imported in this module
458458
/home/you/projects/phrases/src/main.rs:4 use phrases::japanese::greetings::hello;

trunk/src/doc/guide-error-handling.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> The best-laid plans of mice and men
44
> Often go awry
5-
>
5+
>
66
> "Tae a Moose", Robert Burns
77
88
Sometimes, things just go wrong. It's important to have a plan for when the
@@ -76,7 +76,7 @@ fn main() {
7676

7777
This will give us an error:
7878

79-
```{notrust,ignore}
79+
```{notrust}
8080
error: non-exhaustive patterns: `_` not covered [E0004]
8181
```
8282

@@ -189,7 +189,7 @@ panic!("boom");
189189

190190
gives
191191

192-
```{notrust,ignore}
192+
```{notrust}
193193
task '<main>' panicked at 'boom', hello.rs:2
194194
```
195195

trunk/src/doc/guide-ownership.md

Lines changed: 9 additions & 9 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 exaclty one deallocations paired
96+
for us, it's impossible to forget. We always have exactly one deallocation paired
9797
with each of our allocations.
9898

9999
This is pretty straightforward, but what happens when we want to pass our box
@@ -130,7 +130,7 @@ fn add_one(mut num: Box<int>) {
130130

131131
This does not compile, and gives us an error:
132132

133-
```{notrust,ignore}
133+
```{notrust}
134134
error: use of moved value: `x`
135135
println!("{}", x);
136136
^
@@ -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 posession, you're just letting someone
189+
short period of time. You still own your possession, 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 ownershp system also allows an owner to lend out a handle for a limited
193+
Rust's ownership 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 liftimes, `add_one` looks like this:
234+
eliding the lifetimes, `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 liftimes we've named:
257+
Then in our parameter list, we use the lifetimes 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 liftimes. In a similar way to functions,
282+
As you can see, `struct`s can also have lifetimes. 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 liftime here? We need to ensure that any reference
298+
uses it. So why do we need a lifetime 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
@@ -406,7 +406,7 @@ fn main() {
406406
We try to make four `Wheel`s, each with a `Car` that it's attached to. But the
407407
compiler knows that on the second iteration of the loop, there's a problem:
408408

409-
```{notrust,ignore}
409+
```{notrust}
410410
error: use of moved value: `car`
411411
Wheel { size: 360, owner: car };
412412
^~~

trunk/src/doc/guide-pointers.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ println!("{}", x + z);
8484

8585
This gives us an error:
8686

87-
```{notrust,ignore}
87+
```{notrust}
8888
hello.rs:6:24: 6:25 error: mismatched types: expected `int` but found `&int` (expected int but found &-ptr)
8989
hello.rs:6 println!("{}", x + z);
9090
^
@@ -132,7 +132,7 @@ Pointers are useful in languages that are pass-by-value, rather than
132132
pass-by-reference. Basically, languages can make two choices (this is made
133133
up syntax, it's not Rust):
134134

135-
```{notrust,ignore}
135+
```{ignore}
136136
func foo(x) {
137137
x = 5
138138
}
@@ -152,7 +152,7 @@ and therefore, can change its value. At the comment, `i` will be `5`.
152152
So what do pointers have to do with this? Well, since pointers point to a
153153
location in memory...
154154

155-
```{notrust,ignore}
155+
```{ignore}
156156
func foo(&int x) {
157157
*x = 5
158158
}
@@ -179,7 +179,7 @@ but here are problems with pointers in other languages:
179179
Uninitialized pointers can cause a problem. For example, what does this program
180180
do?
181181

182-
```{notrust,ignore}
182+
```{ignore}
183183
&int x;
184184
*x = 5; // whoops!
185185
```
@@ -191,7 +191,7 @@ knows. This might be harmless, and it might be catastrophic.
191191
When you combine pointers and functions, it's easy to accidentally invalidate
192192
the memory the pointer is pointing to. For example:
193193

194-
```{notrust,ignore}
194+
```{ignore}
195195
func make_pointer(): &int {
196196
x = 5;
197197
@@ -213,7 +213,7 @@ As one last example of a big problem with pointers, **aliasing** can be an
213213
issue. Two pointers are said to alias when they point at the same location
214214
in memory. Like this:
215215

216-
```{notrust,ignore}
216+
```{ignore}
217217
func mutate(&int i, int j) {
218218
*i = j;
219219
}
@@ -398,7 +398,7 @@ fn main() {
398398

399399
It gives this error:
400400

401-
```{notrust,ignore}
401+
```{notrust}
402402
test.rs:5:8: 5:10 error: cannot assign to `*x` because it is borrowed
403403
test.rs:5 *x -= 1;
404404
^~
@@ -522,7 +522,7 @@ boxes, though. As a rough approximation, you can treat this Rust code:
522522

523523
As being similar to this C code:
524524

525-
```{notrust,ignore}
525+
```{ignore}
526526
{
527527
int *x;
528528
x = (int *)malloc(sizeof(int));
@@ -626,7 +626,7 @@ fn main() {
626626

627627
This prints:
628628

629-
```{notrust,ignore}
629+
```{ignore}
630630
Cons(1, box Cons(2, box Cons(3, box Nil)))
631631
```
632632

0 commit comments

Comments
 (0)