Skip to content

Rolling up PRs in the queue #18017

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 37 commits into from
Oct 14, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
7cf1f55
In sieve example, end iteration sooner
gmfawcett Oct 9, 2014
b2949ae
Fix HTML version of the keyword table.
nodakai Oct 12, 2014
e2fed74
src/doc/README.md: fix a dead link.
nodakai Sep 25, 2014
785ae90
Fix run-pass/lang-item-public test on FreeBSD
ebfe Oct 11, 2014
d7dc97e
fix broken link in guide-strings.md
Behemecoatyl Oct 12, 2014
18e4129
rustc: Warn about dead constants
alexcrichton Oct 10, 2014
67418f5
Guide: remove promise of a counter in the guessing game.
Oct 12, 2014
5b043d7
Fix `find` check for executables
alexcrichton Oct 12, 2014
0460841
Properly visit nested functions and closures in check_rvalues
bkoropoff Oct 12, 2014
1cbce30
Fixes small error on the doc (task part)
Oct 12, 2014
3caecff
Add regression test for issue #17651
bkoropoff Oct 12, 2014
ed7d1be
Guide: specify that both shared and mutable borrows can be re-lent.
Oct 13, 2014
c6f9b8f
Doc: Fix C-Code Example in FFI Docs
redcape Oct 13, 2014
f27ad3d
Clean up rustc warnings.
nodakai Oct 5, 2014
61a8a28
Include the Unicode version used to generate `src/libunicode/tables.rs`.
SimonSapin Oct 13, 2014
fafe136
Emit lifetime end markers for function arguments
dotdash Oct 13, 2014
84d1cbf
Don't ICE on bad extern paths
sfackler Oct 13, 2014
c56c9fc
rustc: Remove the dummy hack from check_match
alexcrichton Oct 10, 2014
b26972e
Make bors check that `compiletest` builds from both stage0 and stage1…
pnkfelix Oct 13, 2014
39749a3
Fix typo in char's from_digit error message
Oct 13, 2014
e9f241b
rollup merge of #17888 : gmfawcett/patch-1
alexcrichton Oct 13, 2014
412f4d1
rollup merge of #17927 : alexcrichton/more-const
alexcrichton Oct 13, 2014
0dd4cd5
rollup merge of #17968 : nodakai/really-fix-kw-table
alexcrichton Oct 13, 2014
986d62e
rollup merge of #17970 : nodakai/cleanup-warnings
alexcrichton Oct 13, 2014
e860437
rollup merge of #17972 : ebfe/rpass-lang-item
alexcrichton Oct 13, 2014
001814f
rollup merge of #17977 : Behemecoatyl/master
alexcrichton Oct 13, 2014
48d0359
rollup merge of #17979 : jkleint/guide-guess-counter
alexcrichton Oct 13, 2014
4509e42
rollup merge of #17980 : alexcrichton/no-more-exes
alexcrichton Oct 13, 2014
02350ac
rollup merge of #17984 : bkoropoff/issue-17651
alexcrichton Oct 13, 2014
ad25e56
rollup merge of #17986 : gamazeps/docissue
alexcrichton Oct 13, 2014
030c79c
rollup merge of #17991 : sfackler/extern-error
alexcrichton Oct 13, 2014
f006e86
rollup merge of #17992 : jkleint/guide-double-borrow
alexcrichton Oct 13, 2014
1263a36
rollup merge of #17993 : redcape/fix-ffi-docs
alexcrichton Oct 13, 2014
0eefca6
rollup merge of #18002 : SimonSapin/unicode-version
alexcrichton Oct 13, 2014
1b19296
rollup merge of #18007 : dotdash/arg_lifetime_end
alexcrichton Oct 13, 2014
724bbab
rollup merge of #18012 : pnkfelix/gate-bors-on-building-compiletest
alexcrichton Oct 13, 2014
2e2d681
rollup merge of #18013 : stefanbucur/patch-1
alexcrichton Oct 13, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 27 additions & 4 deletions mk/tests.mk
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,29 @@ check-docs: cleantestlibs cleantmptestlogs check-stage2-docs

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

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

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

define DEF_CHECK_BUILD_COMPILETEST_FOR_STAGE
check-stage$(1)-build-compiletest: $$(HBIN$(1)_H_$(CFG_BUILD))/compiletest$$(X_$(CFG_BUILD))
endef

$(foreach stage,$(STAGES), \
$(eval $(call DEF_CHECK_BUILD_COMPILETEST_FOR_STAGE,$(stage))))

check-build-compiletest: \
check-stage1-build-compiletest \
check-stage2-build-compiletest

.PHONY: cleantmptestlogs cleantestlibs

cleantmptestlogs:
Expand Down Expand Up @@ -284,7 +299,7 @@ tidy:
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
$(Q)echo $(ALL_HS) \
| xargs -n 10 $(CFG_PYTHON) $(S)src/etc/tidy.py
$(Q)find $(S)src -type f -perm a+x \
$(Q)find $(S)src -type f -perm +a+x \
-not -name '*.rs' -and -not -name '*.py' \
-and -not -name '*.sh' \
| grep '^$(S)src/jemalloc' -v \
Expand Down Expand Up @@ -720,6 +735,13 @@ PRETTY_DEPS_pretty-rpass-full = $(RPASS_FULL_TESTS)
PRETTY_DEPS_pretty-rfail = $(RFAIL_TESTS)
PRETTY_DEPS_pretty-bench = $(BENCH_TESTS)
PRETTY_DEPS_pretty-pretty = $(PRETTY_TESTS)
# The stage- and host-specific dependencies are for e.g. macro_crate_test which pulls in
# external crates.
PRETTY_DEPS$(1)_H_$(3)_pretty-rpass =
PRETTY_DEPS$(1)_H_$(3)_pretty-rpass-full = $$(HLIB$(1)_H_$(3))/stamp.syntax $$(HLIB$(1)_H_$(3))/stamp.rustc
PRETTY_DEPS$(1)_H_$(3)_pretty-rfail =
PRETTY_DEPS$(1)_H_$(3)_pretty-bench =
PRETTY_DEPS$(1)_H_$(3)_pretty-pretty =
PRETTY_DIRNAME_pretty-rpass = run-pass
PRETTY_DIRNAME_pretty-rpass-full = run-pass-fulldeps
PRETTY_DIRNAME_pretty-rfail = run-fail
Expand All @@ -738,7 +760,8 @@ check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4

$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
$$(PRETTY_DEPS_$(4))
$$(PRETTY_DEPS_$(4)) \
$$(PRETTY_DEPS$(1)_H_$(3)_$(4))
@$$(call E, run pretty-rpass [$(2)]: $$<)
$$(Q)$$(call CFG_RUN_CTEST_$(2),$(1),$$<,$(3)) \
$$(PRETTY_ARGS$(1)-T-$(2)-H-$(3)-$(4)) \
Expand Down
28 changes: 11 additions & 17 deletions src/compiletest/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -947,15 +947,12 @@ fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
String::from_chars(c.as_slice())
}

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

#[cfg(any(target_os = "linux",
target_os = "macos",
target_os = "freebsd",
target_os = "dragonfly"))]
#[cfg(unix)]
fn prefix_matches( line : &str, prefix : &str ) -> bool {
line.starts_with( prefix )
}
Expand Down Expand Up @@ -1356,24 +1353,21 @@ fn program_output(config: &Config, testfile: &Path, lib_path: &str, prog: String
}

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

#[cfg(target_os = "windows")]
#[cfg(windows)]
fn make_cmdline(libpath: &str, prog: &str, args: &[String]) -> String {
format!("{} {} {}", lib_path_cmd_prefix(libpath), prog, args.connect(" "))
}

// Build the LD_LIBRARY_PATH variable as it would be seen on the command line
// for diagnostic purposes
#[cfg(target_os = "windows")]
fn lib_path_cmd_prefix(path: &str) -> String {
format!("{}=\"{}\"", util::lib_path_env_var(), util::make_new_path(path))
// Build the LD_LIBRARY_PATH variable as it would be seen on the command line
// for diagnostic purposes
fn lib_path_cmd_prefix(path: &str) -> String {
format!("{}=\"{}\"", util::lib_path_env_var(), util::make_new_path(path))
}

format!("{} {} {}", lib_path_cmd_prefix(libpath), prog, args.connect(" "))
}

fn dump_output(config: &Config, testfile: &Path, out: &str, err: &str) {
Expand Down
32 changes: 18 additions & 14 deletions src/doc/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Dependencies
# Rust documentations

## Dependencies

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

# Building
## Building

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

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

# Additional notes
## Additional notes

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

(reference.md being the Rust Reference Manual.)
(`reference.md` being the Rust Reference Manual.)

The syntax for pandoc flavored markdown can be found at:
http://johnmacfarlane.net/pandoc/README.html#pandocs-markdown

- http://johnmacfarlane.net/pandoc/README.html#pandocs-markdown

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

# Notes for translators
- http://kramdown.gettalong.org/quickref.html

## Notes for translators

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

To start the translation for a new language, see po4a.conf at first.
To start the translation for a new language, see `po4a.conf` at first.

To generate .pot and .po files, do something like:
To generate `.pot` and `.po` files, do something like:

~~~~
po4a --copyright-holder="The Rust Project Developers" \
--package-name="Rust" \
--package-version="0.11.0" \
--package-version="0.13.0" \
-M UTF-8 -L UTF-8 \
src/doc/po4a.conf
~~~~

(the version number must be changed if it is not 0.11.0 now.)
(the version number must be changed if it is not `0.13.0` now.)

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

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

This removes untranslated entries from .po files to save disk space.
This removes untranslated entries from `.po` files to save disk space.
2 changes: 1 addition & 1 deletion src/doc/guide-ffi.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ fn main() {
C code:

~~~~c
typedef void (*rust_callback)(int32_t);
typedef void (*rust_callback)(void*, int32_t);
void* cb_target;
rust_callback cb;

Expand Down
2 changes: 1 addition & 1 deletion src/doc/guide-strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,5 +206,5 @@ Many more bytes than graphemes!

# Other Documentation

* [the `&str` API documentation](/std/str/index.html)
* [the `&str` API documentation](std/str/index.html)
* [the `String` API documentation](std/string/index.html)
12 changes: 5 additions & 7 deletions src/doc/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -1746,8 +1746,7 @@ For our first project, we'll implement a classic beginner programming problem:
the guessing game. Here's how it works: Our program will generate a random
integer between one and a hundred. It will then prompt us to enter a guess.
Upon entering our guess, it will tell us if we're too low or too high. Once we
guess correctly, it will congratulate us, and print the number of guesses we've
taken to the screen. Sound good?
guess correctly, it will congratulate us. Sound good?

## Set up

Expand Down Expand Up @@ -3538,9 +3537,8 @@ restriction:

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

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

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

If tasks were only able to capture these values, they wouldn't be very useful.
Luckily, tasks can communicate with each other through **channel**s. Channels
Expand Down
18 changes: 1 addition & 17 deletions src/doc/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,40 +185,24 @@ grammar as double-quoted strings. Other tokens have exact rules given.

### Keywords

The keywords are the following strings, organized by first letter:
<p id="keyword-table-marker">The keywords are the following strings, organized by first letter:</p>

<div id="keywords">
| | | | |
|----------|--------|--------|-------|
| as | | | |
|----------|--------|--------|-------|
| box | break | | |
|----------|--------|--------|-------|
| continue | crate | | |
|----------|--------|--------|-------|
| else | enum | extern | |
|----------|--------|--------|-------|
| false | fn | for | |
|----------|--------|--------|-------|
| if | impl | in | |
|----------|--------|--------|-------|
| let | loop | | |
|----------|--------|--------|-------|
| match | mod | mut | |
|----------|--------|--------|-------|
| priv | proc | pub | |
|----------|--------|--------|-------|
| ref | return | | |
|----------|--------|--------|-------|
| self | static | struct | super |
|----------|--------|--------|-------|
| trait | true | type | |
|----------|--------|--------|-------|
| unsafe | use | | |
|----------|--------|--------|-------|
| while | | | |
|----------|--------|--------|-------|
</div>

Each of these keywords has special meaning in its grammar, and all of them are
excluded from the `ident` rule.
Expand Down
7 changes: 6 additions & 1 deletion src/doc/rust.css
Original file line number Diff line number Diff line change
Expand Up @@ -393,4 +393,9 @@ pre.rust { position: relative; }
}
}

#keywords table td { border: none; }
#keyword-table-marker + table thead { display: none; }
#keyword-table-marker + table td { border: none; }
#keyword-table-marker + table {
margin-left: 2em;
margin-bottom: 1em;
}
9 changes: 9 additions & 0 deletions src/etc/unicode.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,15 @@ def optimize_width_table(wtable):
rf.write(preamble)

# download and parse all the data
fetch("ReadMe.txt")
with open("ReadMe.txt") as readme:
pattern = "for Version (\d+)\.(\d+)\.(\d+) of the Unicode"
unicode_version = re.search(pattern, readme.read()).groups()
rf.write("""
/// The version of [Unicode](http://www.unicode.org/)
/// that the `UnicodeChar` and `UnicodeStrSlice` traits are based on.
pub const UNICODE_VERSION: (uint, uint, uint) = (%s, %s, %s);
""" % unicode_version)
(canon_decomp, compat_decomp, gencats, combines,
lowerupper, upperlower) = load_unicode_data("UnicodeData.txt")
want_derived = ["XID_Start", "XID_Continue", "Alphabetic", "Lowercase", "Uppercase"]
Expand Down
1 change: 0 additions & 1 deletion src/liballoc/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ impl<T: Sync + Send> Drop for Weak<T> {
#[allow(experimental)]
mod tests {
use std::clone::Clone;
use std::collections::MutableSeq;
use std::comm::channel;
use std::mem::drop;
use std::ops::Drop;
Expand Down
4 changes: 2 additions & 2 deletions src/libcollections/bitv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
//! bv.set(0, false);
//! bv.set(1, false);
//!
//! for i in range(2, max_prime) {
//! for i in iter::range_inclusive(2, (max_prime as f64).sqrt() as uint) {
//! // if i is a prime
//! if bv[i] {
//! // Mark all multiples of i as non-prime (any multiples below i * i
Expand Down Expand Up @@ -2659,7 +2659,7 @@ mod tests {
let mut r = rng();
let mut bitv = Bitv::with_capacity(BENCH_BITS, false);
b.iter(|| {
for i in range(0u, 100) {
for _ in range(0u, 100) {
bitv.set((r.next_u32() as uint) % BENCH_BITS, r.gen());
}
&bitv
Expand Down
8 changes: 4 additions & 4 deletions src/libcollections/dlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -890,13 +890,13 @@ mod tests {
}

let v = vec![1i,2,3,4,5];
let u = vec![9i,8,1,2,3,4,5];
let mut u = vec![9i,8,1,2,3,4,5];
let mut m = list_from(v.as_slice());
m.prepend(list_from(u.as_slice()));
check_links(&m);
let sum = u.append(v.as_slice());
assert_eq!(sum.len(), m.len());
for elt in sum.into_iter() {
u.extend(v.as_slice().iter().map(|&b| b));
assert_eq!(u.len(), m.len());
for elt in u.into_iter() {
assert_eq!(m.pop_front(), Some(elt))
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/libcollections/ringbuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -611,10 +611,10 @@ mod tests {
assert_eq!(deq.len(), 3);
deq.push_front(a.clone());
assert_eq!(deq.len(), 4);
assert_eq!((*deq.get(0)).clone(), a.clone());
assert_eq!((*deq.get(1)).clone(), b.clone());
assert_eq!((*deq.get(2)).clone(), c.clone());
assert_eq!((*deq.get(3)).clone(), d.clone());
assert_eq!(deq[0].clone(), a.clone());
assert_eq!(deq[1].clone(), b.clone());
assert_eq!(deq[2].clone(), c.clone());
assert_eq!(deq[3].clone(), d.clone());
}

#[test]
Expand All @@ -626,7 +626,7 @@ mod tests {
assert_eq!(deq.len(), 66);

for i in range(0u, 66) {
assert_eq!(*deq.get(i), 65 - i);
assert_eq!(deq[i], 65 - i);
}

let mut deq = RingBuf::new();
Expand All @@ -635,7 +635,7 @@ mod tests {
}

for i in range(0u, 66) {
assert_eq!(*deq.get(i), i);
assert_eq!(deq[i], i);
}
}

Expand Down
Loading