Skip to content

Commit 13af372

Browse files
committed
---
yaml --- r: 138131 b: refs/heads/try c: b26972e h: refs/heads/master i: 138129: be9d313 138127: f962789 v: v3
1 parent 1f0af30 commit 13af372

File tree

108 files changed

+557
-806
lines changed

Some content is hidden

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

108 files changed

+557
-806
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: b6e0d3a5bf4c88650a22f605f822e02c6b163580
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
5-
refs/heads/try: 1b1929656791389dcd0fabd7226ca8b2b2a5e8f2
5+
refs/heads/try: b26972e28bfc1b797e2dfa14435b551685cb180b
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ fetch snapshots, and an OS that can execute the available snapshot binaries.
8787

8888
Snapshot binaries are currently built and tested on several platforms:
8989

90-
* Windows (7, 8, Server 2008 R2), x86 and x86-64 (64-bit support added in Rust 0.12.0)
90+
* Windows (7, 8, Server 2008 R2), x86 only
9191
* Linux (2.6.18 or later, various distributions), x86 and x86-64
9292
* OSX 10.7 (Lion) or greater, x86 and x86-64
9393

branches/try/mk/tests.mk

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,29 @@ check-docs: cleantestlibs cleantmptestlogs check-stage2-docs
199199

200200
# Some less critical tests that are not prone to breakage.
201201
# Not run as part of the normal test suite, but tested by bors on checkin.
202-
check-secondary: check-lexer check-pretty
202+
check-secondary: check-build-compiletest check-lexer check-pretty
203203

204204
# check + check-secondary.
205-
check-all: check check-secondary
205+
#
206+
# Issue #17883: build check-secondary first so hidden dependencies in
207+
# e.g. building compiletest are exercised (resolve those by adding
208+
# deps to rules that need them; not by putting `check` first here).
209+
check-all: check-secondary check
206210

207211
# Pretty-printing tests.
208212
check-pretty: check-stage2-T-$(CFG_BUILD)-H-$(CFG_BUILD)-pretty-exec
209213

214+
define DEF_CHECK_BUILD_COMPILETEST_FOR_STAGE
215+
check-stage$(1)-build-compiletest: $$(HBIN$(1)_H_$(CFG_BUILD))/compiletest$$(X_$(CFG_BUILD))
216+
endef
217+
218+
$(foreach stage,$(STAGES), \
219+
$(eval $(call DEF_CHECK_BUILD_COMPILETEST_FOR_STAGE,$(stage))))
220+
221+
check-build-compiletest: \
222+
check-stage1-build-compiletest \
223+
check-stage2-build-compiletest
224+
210225
.PHONY: cleantmptestlogs cleantestlibs
211226

212227
cleantmptestlogs:
@@ -284,7 +299,7 @@ tidy:
284299
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
285300
$(Q)echo $(ALL_HS) \
286301
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
287-
$(Q)find $(S)src -type f -perm +a+x \
302+
$(Q)find $(S)src -type f -perm a+x \
288303
-not -name '*.rs' -and -not -name '*.py' \
289304
-and -not -name '*.sh' \
290305
| grep '^$(S)src/jemalloc' -v \
@@ -720,6 +735,13 @@ PRETTY_DEPS_pretty-rpass-full = $(RPASS_FULL_TESTS)
720735
PRETTY_DEPS_pretty-rfail = $(RFAIL_TESTS)
721736
PRETTY_DEPS_pretty-bench = $(BENCH_TESTS)
722737
PRETTY_DEPS_pretty-pretty = $(PRETTY_TESTS)
738+
# The stage- and host-specific dependencies are for e.g. macro_crate_test which pulls in
739+
# external crates.
740+
PRETTY_DEPS$(1)_H_$(3)_pretty-rpass =
741+
PRETTY_DEPS$(1)_H_$(3)_pretty-rpass-full = $$(HLIB$(1)_H_$(3))/stamp.syntax $$(HLIB$(1)_H_$(3))/stamp.rustc
742+
PRETTY_DEPS$(1)_H_$(3)_pretty-rfail =
743+
PRETTY_DEPS$(1)_H_$(3)_pretty-bench =
744+
PRETTY_DEPS$(1)_H_$(3)_pretty-pretty =
723745
PRETTY_DIRNAME_pretty-rpass = run-pass
724746
PRETTY_DIRNAME_pretty-rpass-full = run-pass-fulldeps
725747
PRETTY_DIRNAME_pretty-rfail = run-fail
@@ -738,7 +760,8 @@ check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4
738760

739761
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
740762
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
741-
$$(PRETTY_DEPS_$(4))
763+
$$(PRETTY_DEPS_$(4)) \
764+
$$(PRETTY_DEPS$(1)_H_$(3)_$(4))
742765
@$$(call E, run pretty-rpass [$(2)]: $$<)
743766
$$(Q)$$(call CFG_RUN_CTEST_$(2),$(1),$$<,$(3)) \
744767
$$(PRETTY_ARGS$(1)-T-$(2)-H-$(3)-$(4)) \

branches/try/src/compiletest/runtest.rs

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -947,12 +947,15 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
947947
String::from_chars(c.as_slice())
948948
}
949949

950-
#[cfg(windows)]
950+
#[cfg(target_os = "windows")]
951951
fn prefix_matches( line : &str, prefix : &str ) -> bool {
952952
to_lower(line).as_slice().starts_with(to_lower(prefix).as_slice())
953953
}
954954

955-
#[cfg(unix)]
955+
#[cfg(any(target_os = "linux",
956+
target_os = "macos",
957+
target_os = "freebsd",
958+
target_os = "dragonfly"))]
956959
fn prefix_matches( line : &str, prefix : &str ) -> bool {
957960
line.starts_with( prefix )
958961
}
@@ -1353,23 +1356,26 @@ fn program_output(config: &Config, testfile: &Path, lib_path: &str, prog: String
13531356
}
13541357

13551358
// Linux and mac don't require adjusting the library search path
1356-
#[cfg(unix)]
1359+
#[cfg(any(target_os = "linux",
1360+
target_os = "macos",
1361+
target_os = "freebsd",
1362+
target_os = "dragonfly"))]
13571363
fn make_cmdline(_libpath: &str, prog: &str, args: &[String]) -> String {
13581364
format!("{} {}", prog, args.connect(" "))
13591365
}
13601366

1361-
#[cfg(windows)]
1367+
#[cfg(target_os = "windows")]
13621368
fn make_cmdline(libpath: &str, prog: &str, args: &[String]) -> String {
1363-
1364-
// Build the LD_LIBRARY_PATH variable as it would be seen on the command line
1365-
// for diagnostic purposes
1366-
fn lib_path_cmd_prefix(path: &str) -> String {
1367-
format!("{}=\"{}\"", util::lib_path_env_var(), util::make_new_path(path))
1368-
}
1369-
13701369
format!("{} {} {}", lib_path_cmd_prefix(libpath), prog, args.connect(" "))
13711370
}
13721371

1372+
// Build the LD_LIBRARY_PATH variable as it would be seen on the command line
1373+
// for diagnostic purposes
1374+
#[cfg(target_os = "windows")]
1375+
fn lib_path_cmd_prefix(path: &str) -> String {
1376+
format!("{}=\"{}\"", util::lib_path_env_var(), util::make_new_path(path))
1377+
}
1378+
13731379
fn dump_output(config: &Config, testfile: &Path, out: &str, err: &str) {
13741380
dump_output_file(config, testfile, out, "out");
13751381
dump_output_file(config, testfile, err, "err");

branches/try/src/doc/README.md

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# Rust documentations
2-
3-
## Dependencies
1+
# Dependencies
42

53
[Pandoc](http://johnmacfarlane.net/pandoc/installing.html), a universal
64
document converter, is required to generate docs as HTML from Rust's
@@ -12,7 +10,7 @@ docs from the master (English) docs.
1210
[GNU gettext](http://www.gnu.org/software/gettext/) is required for managing
1311
the translation data.
1412

15-
## Building
13+
# Building
1614

1715
To generate all the docs, just run `make docs` from the root of the repository.
1816
This will convert the distributed Markdown docs to HTML and generate HTML doc
@@ -26,7 +24,7 @@ rustdoc --output html-doc/ --output-format html ../src/libstd/path.rs
2624

2725
(This, of course, requires a working build of the `rustdoc` tool.)
2826

29-
## Additional notes
27+
# Additional notes
3028

3129
To generate an HTML version of a doc from Markdown manually, you can do
3230
something like:
@@ -35,39 +33,37 @@ something like:
3533
pandoc --from=markdown --to=html5 --number-sections -o reference.html reference.md
3634
~~~~
3735

38-
(`reference.md` being the Rust Reference Manual.)
36+
(reference.md being the Rust Reference Manual.)
3937

4038
The syntax for pandoc flavored markdown can be found at:
41-
42-
- http://johnmacfarlane.net/pandoc/README.html#pandocs-markdown
39+
http://johnmacfarlane.net/pandoc/README.html#pandocs-markdown
4340

4441
A nice quick reference (for non-pandoc markdown) is at:
42+
http://kramdown.rubyforge.org/quickref.html
4543

46-
- http://kramdown.gettalong.org/quickref.html
47-
48-
## Notes for translators
44+
# Notes for translators
4945

5046
Notice: The procedure described below is a work in progress. We are working on
5147
translation system but the procedure contains some manual operations for now.
5248

53-
To start the translation for a new language, see `po4a.conf` at first.
49+
To start the translation for a new language, see po4a.conf at first.
5450

55-
To generate `.pot` and `.po` files, do something like:
51+
To generate .pot and .po files, do something like:
5652

5753
~~~~
5854
po4a --copyright-holder="The Rust Project Developers" \
5955
--package-name="Rust" \
60-
--package-version="0.13.0" \
56+
--package-version="0.11.0" \
6157
-M UTF-8 -L UTF-8 \
6258
src/doc/po4a.conf
6359
~~~~
6460

65-
(the version number must be changed if it is not `0.13.0` now.)
61+
(the version number must be changed if it is not 0.11.0 now.)
6662

67-
Now you can translate documents with `.po` files, commonly used with gettext. If
63+
Now you can translate documents with .po files, commonly used with gettext. If
6864
you are not familiar with gettext-based translation, please read the online
6965
manual linked from http://www.gnu.org/software/gettext/ . We use UTF-8 as the
70-
file encoding of `.po` files.
66+
file encoding of .po files.
7167

7268
When you want to make a commit, do the command below before staging your
7369
change:
@@ -83,4 +79,4 @@ for f in src/doc/po/**/*.po; do
8379
done
8480
~~~~
8581

86-
This removes untranslated entries from `.po` files to save disk space.
82+
This removes untranslated entries from .po files to save disk space.

branches/try/src/doc/guide-ffi.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ fn main() {
298298
C code:
299299

300300
~~~~c
301-
typedef void (*rust_callback)(void*, int32_t);
301+
typedef void (*rust_callback)(int32_t);
302302
void* cb_target;
303303
rust_callback cb;
304304

@@ -475,7 +475,7 @@ conventions. Rust provides a way to tell the compiler which convention to use:
475475
~~~~
476476
extern crate libc;
477477

478-
#[cfg(all(target_os = "win32", target_arch = "x86"))]
478+
#[cfg(target_os = "win32", target_arch = "x86")]
479479
#[link(name = "kernel32")]
480480
#[allow(non_snake_case)]
481481
extern "stdcall" {

branches/try/src/doc/guide-strings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,5 +206,5 @@ Many more bytes than graphemes!
206206

207207
# Other Documentation
208208

209-
* [the `&str` API documentation](std/str/index.html)
209+
* [the `&str` API documentation](/std/str/index.html)
210210
* [the `String` API documentation](std/string/index.html)

branches/try/src/doc/guide-unsafe.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -313,15 +313,17 @@ literal string (i.e `""`)
313313
```
314314
#![feature(asm)]
315315
316-
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
316+
#[cfg(target_arch = "x86")]
317+
#[cfg(target_arch = "x86_64")]
317318
fn foo() {
318319
unsafe {
319320
asm!("NOP");
320321
}
321322
}
322323
323324
// other platforms
324-
#[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
325+
#[cfg(not(target_arch = "x86"),
326+
not(target_arch = "x86_64"))]
325327
fn foo() { /* ... */ }
326328
327329
fn main() {
@@ -338,7 +340,7 @@ but you must add the right number of `:` if you skip them:
338340

339341
```
340342
# #![feature(asm)]
341-
# #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
343+
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
342344
# fn main() { unsafe {
343345
asm!("xor %eax, %eax"
344346
:
@@ -352,7 +354,7 @@ Whitespace also doesn't matter:
352354

353355
```
354356
# #![feature(asm)]
355-
# #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
357+
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
356358
# fn main() { unsafe {
357359
asm!("xor %eax, %eax" ::: "eax");
358360
# } }
@@ -366,7 +368,7 @@ expressions must be mutable lvalues:
366368

367369
```
368370
# #![feature(asm)]
369-
# #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
371+
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
370372
fn add(a: int, b: int) -> int {
371373
let mut c = 0;
372374
unsafe {
@@ -377,7 +379,7 @@ fn add(a: int, b: int) -> int {
377379
}
378380
c
379381
}
380-
# #[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
382+
# #[cfg(not(target_arch = "x86"), not(target_arch = "x86_64"))]
381383
# fn add(a: int, b: int) -> int { a + b }
382384
383385
fn main() {
@@ -394,7 +396,7 @@ stay valid.
394396

395397
```
396398
# #![feature(asm)]
397-
# #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
399+
# #[cfg(target_arch = "x86")] #[cfg(target_arch = "x86_64")]
398400
# fn main() { unsafe {
399401
// Put the value 0x200 in eax
400402
asm!("mov $$0x200, %eax" : /* no outputs */ : /* no inputs */ : "eax");

branches/try/src/doc/guide.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,7 +1746,8 @@ For our first project, we'll implement a classic beginner programming problem:
17461746
the guessing game. Here's how it works: Our program will generate a random
17471747
integer between one and a hundred. It will then prompt us to enter a guess.
17481748
Upon entering our guess, it will tell us if we're too low or too high. Once we
1749-
guess correctly, it will congratulate us. Sound good?
1749+
guess correctly, it will congratulate us, and print the number of guesses we've
1750+
taken to the screen. Sound good?
17501751

17511752
## Set up
17521753

@@ -3537,8 +3538,9 @@ restriction:
35373538

35383539
1. If the borrow is immutable, you may read the data the pointer points to.
35393540
2. If the borrow is mutable, you may read and write the data the pointer points to.
3540-
3. You may lend the pointer to someone else, **BUT**
3541-
4. When you do so, they must return it before you can give your own borrow back.
3541+
3. You may lend the pointer to someone else in an immutable fashion, **BUT**
3542+
4. When you do so, they must return it to you before you must give your own
3543+
borrow back.
35423544

35433545
This last requirement can seem odd, but it also makes sense. If you have to
35443546
return something, and you've lent it to someone, they need to give it back to
@@ -5060,8 +5062,8 @@ println!("The value of x[0] is: {}", x[0]); // error: use of moved value: `x`
50605062
```
50615063

50625064
`x` is now owned by the proc, and so we can't use it anymore. Many other
5063-
languages would let us do this, but it's not safe to do so. Rust's borrow
5064-
checker catches the error.
5065+
languages would let us do this, but it's not safe to do so. Rust's type system
5066+
catches the error.
50655067

50665068
If tasks were only able to capture these values, they wouldn't be very useful.
50675069
Luckily, tasks can communicate with each other through **channel**s. Channels

0 commit comments

Comments
 (0)