Commit Graph

43039 Commits

Author SHA1 Message Date
David Campbell
4d90b4d9b8 Update let.md -- follow whitespace style guideline
"Idiomatic code should not use extra whitespace in the middle of a line to provide alignment."
2015-05-29 01:02:24 +02:00
Corey Farwell
06706510cb Make adjancent code examples more similar 2015-05-29 01:02:24 +02:00
David Campbell
19cb2a7707 add newline before list in functions-and-methods
The current version of hoedown treats lists interrupting paragraphs in the Markdown.pl style rather than CommonMark, so a newline is needed for the list to be rendered properly.
2015-05-29 01:02:24 +02:00
bors
efebe45cc0 Auto merge of #25856 - bluss:binary-heap-hole, r=Gankro
collections: Make BinaryHeap panic safe in sift_up / sift_down

Use a struct called Hole that keeps track of an invalid location
in the vector and fills the hole on drop.

I include a run-pass test that the current BinaryHeap fails, and the new
one passes.

NOTE: The BinaryHeap will still be inconsistent after a comparison fails. It will
not have the heap property. What we fix is just that elements will be valid
values.

This is actually a performance win -- the new code does not bother to write in `zeroed()`
values in the holes, it just leaves them as they were.

Net result is something like a 5% decrease in runtime for `BinaryHeap::from_vec`. This
can be further improved by using unchecked indexing (I confirmed it makes a difference,
not a surprise with the non-sequential access going on), but let's leave that for another PR.
Safety first 😉 

Fixes #25842
2015-05-28 20:16:08 +00:00
Ulrik Sverdrup
5249cbb7fa collections: Make BinaryHeap panic safe in sift_up / sift_down
Use a struct called Hole that keeps track of an invalid location
in the vector and fills the hole on drop.

I include a run-pass test that the current BinaryHeap fails, and the new
one passes.

Fixes #25842
2015-05-28 20:24:47 +02:00
bors
621a10e7f3 Auto merge of #25829 - steveklabnik:ioresult_fixes, r=alexcrichton
This is now std::io::Result
2015-05-28 17:34:30 +00:00
Steve Klabnik
16a47c2d91 remove references to IoResult
This is now std::io::Result
2015-05-28 12:51:01 -04:00
bors
9c303944a7 Auto merge of #25835 - steveklabnik:gh25438, r=alexcrichton
Fixes #25438
2015-05-28 15:29:15 +00:00
bors
a5a5fcee38 Auto merge of #25834 - steveklabnik:gh25326, r=alexcrichton
Fixes #25326
2015-05-28 13:57:36 +00:00
bors
4233cbda8a Auto merge of #25849 - reinh:patch-1, r=huonw
Thanks for the awesome book!

r? @steveklabnik
2015-05-28 11:24:38 +00:00
bors
4f66d881a5 Auto merge of #25843 - shepmaster:remove-public-int-and-uint, r=huonw 2015-05-28 09:20:49 +00:00
bors
448ce12bc1 Auto merge of #25783 - nrc:save-api-2, r=@huonw
A little more work on the save-analysis API.

r? @huonw
2015-05-28 06:54:57 +00:00
Rein Henrichs
23ec00751e TRPL: fix typo, borow for borrow 2015-05-27 22:35:46 -07:00
Nick Cameron
b2c8719341 save-analysis: move another couple of things to the API 2015-05-28 17:25:50 +12:00
bors
6a3d55abf0 Auto merge of #25840 - arielb1:ptr-compare-fixes, r=nrc
Fixes #25826.
2015-05-28 03:51:58 +00:00
bors
1a3cffbddf Auto merge of #25824 - alexcrichton:fix-deadlocking-test-on-windows, r=nikomatsakis
Windows tests can often deadlock if a child thread continues after the main
thread and then panics, and a `println!` executed in a child thread after the
main thread has exited is at risk of panicking.
2015-05-28 02:17:48 +00:00
Ariel Ben-Yehuda
080311d1f9 Prevent comparison and dereferencing of raw pointers in constexprs
Fixes #25826.
2015-05-28 03:22:44 +03:00
bors
f76d9bcfc2 Auto merge of #25805 - jooert:colorized_tests, r=alexcrichton
The output of individual tests can be captured now so it's safe to use
colorized output even when running tests in parallel. Closes #782.
2015-05-28 00:15:47 +00:00
Jake Goulding
a959cc435f Remove mentions of int / uint from public documentation 2015-05-27 19:26:18 -04:00
Jake Goulding
875d356245 Remove mentions of int / uint from the isize / usize docs 2015-05-27 19:16:00 -04:00
bors
f3819f063c Auto merge of #25796 - arielb1:default-assoc, r=eddyb
r? @eddyb

Fixes #19476.
2015-05-27 22:05:09 +00:00
bors
47f9e528f1 Auto merge of #25827 - Manishearth:rollup, r=Manishearth
- Successful merges: #25128, #25651, #25668, #25726, #25760, #25792, #25806, #25807
- Failed merges:
2015-05-27 19:42:48 +00:00
Manish Goregaokar
6090d15e93 Rollup merge of #25807 - rillian:manpages, r=alexcrichton
Quick update to fix two manpage issues I noticed in #25689.
2015-05-28 01:12:31 +05:30
Manish Goregaokar
aec0a4ba83 Rollup merge of #25806 - nrc:20184-msg, r=alexcrichton
Closes #20184
2015-05-28 01:12:30 +05:30
Manish Goregaokar
0e1a71c5af Rollup merge of #25792 - koobs:patch-1, r=alexcrichton
Currently, there are two conditional blocks that exist to check for "clang or gcc"

On line 866:

```
if [ -z "$CFG_ENABLE_CLANG" -a -z "$CFG_GCC" ]
then
    err "either clang or gcc is required"
fi
```
and on line 1019:

```
if [ -z "$CC" -a -z "$CFG_ENABLE_CLANG" -a -z "$CFG_GCC" ]
then
    err "either clang or gcc is required"
fi
```

Given the order of the clauses, this results in the "either clang or gcc is required" error from the earlier block, (even) when CC is set.

The expected behaviour is to honour user-flags, in this case CC.

Aside from removing all hand-holdy compiler checks in favour of actual compiler *feature* checks, this change removes the redundant former block in favour of the latter block, which appears designed to allow the expected behaviour.
2015-05-28 01:12:30 +05:30
Manish Goregaokar
db1914ef7e Rollup merge of #25726 - nham:cell_docs, r=alexcrichton
Currently part of the description of the `into_inner` method of `UnsafeCell` seems backwards.
2015-05-28 00:35:20 +05:30
Manish Goregaokar
04016171ca Rollup merge of #25668 - steveklabnik:doc_const, r=alexcrichton 2015-05-28 00:35:20 +05:30
Manish Goregaokar
689e94b422 Rollup merge of #25128 - steveklabnik:gh24816, r=alexcrichton
Fixes #24816

r? @alexcrichton
2015-05-28 00:35:19 +05:30
Steve Klabnik
4db7e56b01 Small wording fix in TRPL: lifetimes
Fixes #25438
2015-05-27 15:02:42 -04:00
Steve Klabnik
62e5dee1c5 fix example for E0018
Fixes #25326
2015-05-27 14:51:58 -04:00
Ariel Ben-Yehuda
699fc80780 Address review comments 2015-05-27 20:42:42 +03:00
Ariel Ben-Yehuda
c68e65251c test fixes 2015-05-27 20:31:56 +03:00
bors
af60248ecf Auto merge of #25799 - alexcrichton:fix-link-in-mk, r=luqmana
The changes scaled back in 4cc025d8 were a little too aggressive and broke a
bunch of cross compilations by not defining the `LINK_$(1)` variable for all
targets. This commit ensures that the variable is defined for all targets by
defaulting it to the normal compiler if it's not already defined (it's only
defined specially for MSVC).

Closes #25723
Closes #25802
2015-05-27 17:25:00 +00:00
Alex Crichton
279ec9b9b8 test: Join child threads on windows in tests
Windows tests can often deadlock if a child thread continues after the main
thread and then panics, and a `println!` executed in a child thread after the
main thread has exited is at risk of panicking.
2015-05-27 09:15:19 -07:00
bors
efcc1d1bcb Auto merge of #25797 - eddyb:const-trait-to-trait, r=luqmana
Fixes #24644.
2015-05-27 12:37:56 +00:00
bors
f56782ab9c Auto merge of #25762 - dotdash:codegen_test, r=alexcrichton
The current codegen tests only compare IR line counts between similar
rust and C programs, the latter getting compiled with clang. That looked
like a good idea back then, but actually things like lifetime intrinsics
mean that less IR isn't always better, so the metric isn't really
helpful.

Instead, we can start doing tests that check specific aspects of the
generated IR, like attributes or metadata. To do that, we can use LLVM's
FileCheck tool which has a number of useful features for such tests.

To start off, I created some tests for a few things that were recently
added and/or broken.
2015-05-27 10:21:11 +00:00
Björn Steinbrink
677367599e Revamp codegen tests to check IR quality instead of quantity
The current codegen tests only compare IR line counts between similar
rust and C programs, the latter getting compiled with clang. That looked
like a good idea back then, but actually things like lifetime intrinsics
mean that less IR isn't always better, so the metric isn't really
helpful.

Instead, we can start doing tests that check specific aspects of the
generated IR, like attributes or metadata. To do that, we can use LLVM's
FileCheck tool which has a number of useful features for such tests.

To start off, I created some tests for a few things that were recently
added and/or broken.
2015-05-27 12:08:31 +02:00
bors
eb16ad6e71 Auto merge of #25790 - eddyb:oh-snap-ctfe-arrived, r=alexcrichton 2015-05-27 08:47:53 +00:00
Eduard Burtescu
377b0900ae Use const fn to abstract away the contents of UnsafeCell & friends. 2015-05-27 11:19:03 +03:00
Eduard Burtescu
6e8e4f847c Remove #[cfg(stage0)] items. 2015-05-27 11:19:02 +03:00
Eduard Burtescu
07503dfb8b Register snapshots (2015-05-24 ba0e1cd). 2015-05-27 11:19:02 +03:00
bors
a2cf2c66e0 Auto merge of #25791 - barosl:use-paths-as-items, r=alexcrichton
Currently, for `use` declarations with multiple paths, only the `use` item itself is saved in the AST map, not the individual path nodes. This can lead to a problem when a span of a specific path node is needed.

For example, #24818 caused an ICE because of this, in `ImportResolver::check_for_conflicting_import()`.

Fixes #25763.
2015-05-27 07:14:45 +00:00
bors
5a2c766cdd Auto merge of #25749 - richo:python3, r=alexcrichton
This is enough to make `make tidy` work if you're using python3

There's definitely more stuff to do, but PR'ing now to avoid bitrot
2015-05-27 05:24:36 +00:00
bors
a97b3ff16f Auto merge of #25741 - richo:backtrace-message, r=alexcrichton
The second commit seems reasonable to me but I can remove if it's contentious. The first is purely cosmetic but has been irking me for ages.
2015-05-27 02:15:44 +00:00
bors
e4c64a1499 Auto merge of #25713 - Stebalien:pattern, r=alexcrichton
Needed to support:

```rust
match X {
  pattern if Y ...
}

for pattern in Y {}
```

IMO, this shouldn't require an RFC because it can't interfere with any future language changes (because `pattern if` and `pattern in` are already legal in rust) and can't cause any ambiguity.
2015-05-27 00:42:55 +00:00
Ralph Giles
bb61b0b8bb Update rustc manpage.
rustc -C target-cpu=help is no longer supported. Recommend the
llc tool intead like 'rustc --help'.
2015-05-26 16:29:32 -07:00
Ralph Giles
ea5c8eb2c9 Bump manpage date and version for 1.2.0-dev.
Estimating August as the release date for 1.2.0.
2015-05-26 16:29:12 -07:00
bors
fe85342ef6 Auto merge of #25688 - nham:E0055_E0192, r=alexcrichton
- Adds explanations for E0055, E0089, E0192, E0261-E0263, E0318
 - Improves explanations for E0250, E0368, E0372.
 - Converts 15 diagnostics to have error codes (E0380-E0394). Adds an explanation for E0380.
 - The E0087-E0090 messages currently look like "expected {} parameter(s) found {} parameter(s)". This changes them to either use "parameter" or "parameters", based on the number.

This is, in part, more progress towards #24407
2015-05-26 23:10:06 +00:00
Steve Klabnik
577bbaceb9 Add note about filesystems to fs::rename
Fixes #24816
2015-05-26 19:02:24 -04:00
Nick Cameron
ff68204880 Add a WONTFIX message to a failing test.
Closes #20184
2015-05-27 10:16:49 +12:00