]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoRemove unzip() SizeHint hack
Oliver Middleton [Tue, 7 Jun 2016 21:32:48 +0000 (22:32 +0100)]
Remove unzip() SizeHint hack

This was using an invalid iterator so is likely to end with buggy
behaviour.

It also doesn't even benefit many type in std including Vec so removing it
shouldn't cause any problems.

8 years agoAuto merge of #34006 - eddyb:mir-const-fixes, r=nikomatsakis
bors [Mon, 6 Jun 2016 12:08:50 +0000 (05:08 -0700)]
Auto merge of #34006 - eddyb:mir-const-fixes, r=nikomatsakis

 [MIR] Fix double-rounding of float constants and ignore NaN sign in tests.

Fixes #32805 by handling f32 and f64 separately in rustc_const_eval.

Also removes `#[rustc_no_mir]` from a couple libstd tests by ignoring NaN sign.
Turns out that runtime evaluation of `0.0 / 0.0` produces a NaN with the sign bit set,
whereas LLVM constant folds it to a NaN with the sign bit unset, which we were testing for.

8 years agoAuto merge of #33920 - cristianoliveira:error-E0174-explanation, r=GuillaumeGomez
bors [Mon, 6 Jun 2016 08:02:22 +0000 (01:02 -0700)]
Auto merge of #33920 - cristianoliveira:error-E0174-explanation, r=GuillaumeGomez

Add error description for E0174

Reference for issue: #32777

r? @GuillaumeGomez

Hey Guillaume, sorry for taking too long to do it. I got some unexpected work during the week.

Waiting for your review :)

8 years agoMerge pull request #34102 from eddyb/rollup
Eduard-Mihai Burtescu [Mon, 6 Jun 2016 08:02:19 +0000 (11:02 +0300)]
Merge pull request #34102 from eddyb/rollup

Rollup of 12 pull requests

8 years agoAdd error description for E0174
Cristian Oliveira [Sat, 28 May 2016 01:38:09 +0000 (22:38 -0300)]
Add error description for E0174

8 years agoRollup merge of #34090 - srinivasreddy:rustfmt_unicode, r=nagisa
Eduard-Mihai Burtescu [Mon, 6 Jun 2016 03:48:33 +0000 (06:48 +0300)]
Rollup merge of #34090 - srinivasreddy:rustfmt_unicode, r=nagisa

run rustfmt on librustc_unicode

8 years agoRollup merge of #34085 - srinivasreddy:rustfmt_libtest, r=eddyb
Eduard-Mihai Burtescu [Mon, 6 Jun 2016 03:48:33 +0000 (06:48 +0300)]
Rollup merge of #34085 - srinivasreddy:rustfmt_libtest, r=eddyb

run rustfmt on libtest folder

8 years agoRollup merge of #34082 - ollie27:rustdoc_css, r=alexcrichton
Eduard-Mihai Burtescu [Mon, 6 Jun 2016 03:48:33 +0000 (06:48 +0300)]
Rollup merge of #34082 - ollie27:rustdoc_css, r=alexcrichton

rustdoc: Fix a few missing colors in the CSS

This adds color to some of the search results and sidebar items which were missing.

8 years agoRollup merge of #34081 - RustOS-Fork-Holding-Ground:no-core-build-script, r=alexcrichton
Eduard-Mihai Burtescu [Mon, 6 Jun 2016 03:48:33 +0000 (06:48 +0300)]
Rollup merge of #34081 - RustOS-Fork-Holding-Ground:no-core-build-script, r=alexcrichton

No build.rs for libcore

I did a grep and there are no longer any mention of "rustbuild" in core, in `cfg`s or otherwise.

8 years agoRollup merge of #34062 - sanxiyn:no-wget, r=nagisa
Eduard-Mihai Burtescu [Mon, 6 Jun 2016 03:48:33 +0000 (06:48 +0300)]
Rollup merge of #34062 - sanxiyn:no-wget, r=nagisa

Unsupport wget

wget support was removed in #32942 (search for wget in diff), but configure wasn't updated. wget support was introduced in #7498 for Windows, but we now use PowerShell on Windows.

8 years agoRollup merge of #34059 - reeze:patch-2, r=GuillaumeGomez
Eduard-Mihai Burtescu [Mon, 6 Jun 2016 03:48:33 +0000 (06:48 +0300)]
Rollup merge of #34059 - reeze:patch-2, r=GuillaumeGomez

Update comment

The path has changed

8 years agoRollup merge of #34052 - jonas-schievink:issue-32829, r=brson
Eduard-Mihai Burtescu [Mon, 6 Jun 2016 03:48:32 +0000 (06:48 +0300)]
Rollup merge of #34052 - jonas-schievink:issue-32829, r=brson

Add regression test for issue #32829

Closes #32829

8 years agoRollup merge of #34048 - shepmaster:corrected-issue-number, r=steveklabnik
Eduard-Mihai Burtescu [Mon, 6 Jun 2016 03:48:32 +0000 (06:48 +0300)]
Rollup merge of #34048 - shepmaster:corrected-issue-number, r=steveklabnik

Correct issue number in test

8 years agoRollup merge of #33955 - zackmdavis:explain_E0429, r=GuillaumeGomez
Eduard-Mihai Burtescu [Mon, 6 Jun 2016 03:48:32 +0000 (06:48 +0300)]
Rollup merge of #33955 - zackmdavis:explain_E0429, r=GuillaumeGomez

add explanation for E0429 (`self` use declaration must use brace syntax)

This is an item under #32777.

r? @GuillaumeGomez

8 years agoRollup merge of #33786 - birkenfeld:make-fix, r=jseyfried
Eduard-Mihai Burtescu [Mon, 6 Jun 2016 03:48:32 +0000 (06:48 +0300)]
Rollup merge of #33786 - birkenfeld:make-fix, r=jseyfried

Makefile.in: dont use unnecessary escapes in echo

I don't know if `echo` allows escapes without `-e` on other systems, but on a GNU userland this outputs literal `\n` on the terminal. In this case there's an easy way to write this without escapes anyway.

r? @GuillaumeGomez

8 years agoAuto merge of #33786 - birkenfeld:make-fix, r=jseyfried
bors [Mon, 6 Jun 2016 01:24:22 +0000 (18:24 -0700)]
Auto merge of #33786 - birkenfeld:make-fix, r=jseyfried

Makefile.in: dont use unnecessary escapes in echo

I don't know if `echo` allows escapes without `-e` on other systems, but on a GNU userland this outputs literal `\n` on the terminal. In this case there's an easy way to write this without escapes anyway.

r? @GuillaumeGomez

8 years agomir: remove unused float support from zero_literal.
Eduard Burtescu [Sun, 5 Jun 2016 19:32:11 +0000 (22:32 +0300)]
mir: remove unused float support from zero_literal.

8 years agorun rustfmt on librustc_unicode
Srinivas Reddy Thatiparthy [Sun, 5 Jun 2016 07:23:08 +0000 (12:53 +0530)]
run rustfmt on librustc_unicode

8 years agorustc_const_eval: work around double rounding.
Eduard Burtescu [Wed, 1 Jun 2016 09:22:07 +0000 (12:22 +0300)]
rustc_const_eval: work around double rounding.

8 years agotest: don't assume anything about the sign of NAN.
Eduard Burtescu [Wed, 1 Jun 2016 06:00:46 +0000 (09:00 +0300)]
test: don't assume anything about the sign of NAN.

8 years agoAuto merge of #34039 - ollie27:linkchecker_dirs, r=alexcrichton
bors [Sun, 5 Jun 2016 16:07:38 +0000 (09:07 -0700)]
Auto merge of #34039 - ollie27:linkchecker_dirs, r=alexcrichton

linkchecker: Treat directory links as errors

Directory links don't work well offline so they should be treated as errors.

All examples of this I know of are fixed in #34021.

8 years agoAuto merge of #33905 - eddyb:mir-overflow, r=nikomatsakis
bors [Sun, 5 Jun 2016 13:08:37 +0000 (06:08 -0700)]
Auto merge of #33905 - eddyb:mir-overflow, r=nikomatsakis

[MIR] Implement overflow checking

The initial set of changes is from @Aatch's #33255 PR, rebased on master, plus:

Added an `Assert` terminator to MIR, to simplify working with overflow and bounds checks.
With this terminator, error cases can be accounted for directly, instead of looking for lang item calls.
It also keeps the MIR slimmer, with no extra explicit blocks for the actual panic calls.

Warnings can be produced when the `Assert` is known to always panic at runtime, e.g.:
```rust
warning: index out of bounds: the len is 1 but the index is 3
 --> <anon>:1:14
1 |> fn main() { &[std::io::stdout()][3]; }
  |>              ^^^^^^^^^^^^^^^^^^^^^^
```

Generalized the `OperandValue::FatPtr` optimization to any aggregate pair of immediates.
This allows us to generate the same IR for overflow checks as old trans, not something worse.
For example, addition on `i16` calls `llvm.sadd.with.overflow.i16`, which returns `{i16, i1}`.
However, the Rust type `(i16, bool)`, has to be `{i16, i8}`, only an immediate `bool` is `i1`.
But if we split the pair into an `i16` and an `i1`, we can pass them around as such for free.

The latest addition is a rebase of #34054, updated to work for pairs too. Closes #34054, fixes #33873.

Last but not least, the `#[rustc_inherit_overflow_checks]` attribute was introduced to control the
overflow checking behavior of generic or `#[inline]` functions, when translated in another crate.

It is **not** intended to be used by crates other than `libcore`, which is in the unusual position of
being distributed as only an optimized build with no checks, even when used from debug mode.
Before MIR-based translation, this worked out fine, as the decision for overflow was made at
translation time, in the crate being compiled, but MIR stored in `rlib` has to contain the checks.

To avoid always generating the checks and slowing everything down, a decision was made to
use an attribute in the few spots of `libcore` that need it (see #33255 for previous discussion):
* `core::ops::{Add, Sub, Mul, Neg, Shl, Shr}` implementations for integers, which have `#[inline]` methods and can be used in generic abstractions from other crates
* `core::ops::{Add, Sub, Mul, Neg, Shl, Shr}Assign` same as above, for augmented assignment
* `pow` and `abs` methods on integers, which intentionally piggy-back on built-in multiplication and negation, respectively, to get overflow checks
* `core::iter::{Iterator, Chain, Peek}::count` and `core::iter::Enumerate::{next, nth}`, also documented as panicking on overflow, from addition, counting elements of an iterator in an `usize`

8 years agotrans: update Luqmana's patch for generalized pair handling.
Eduard Burtescu [Sun, 5 Jun 2016 12:34:13 +0000 (15:34 +0300)]
trans: update Luqmana's patch for generalized pair handling.

8 years ago[MIR] Handle call return values that need to be casted properly.
Luqman Aden [Fri, 3 Jun 2016 01:32:07 +0000 (21:32 -0400)]
[MIR] Handle call return values that need to be casted properly.

8 years agotrans: report as many errors as possible for constants.
Eduard Burtescu [Sun, 5 Jun 2016 11:38:29 +0000 (14:38 +0300)]
trans: report as many errors as possible for constants.

8 years agotrans: implement CheckedBinaryOp in mir::constant.
Eduard Burtescu [Fri, 27 May 2016 11:40:05 +0000 (14:40 +0300)]
trans: implement CheckedBinaryOp in mir::constant.

8 years agotrans: use the same messages for both MIR and old arithmetic checks.
Eduard Burtescu [Thu, 26 May 2016 19:53:27 +0000 (22:53 +0300)]
trans: use the same messages for both MIR and old arithmetic checks.

8 years agorustc_const_eval: track the length and index in IndexOutOfBounds.
Eduard Burtescu [Thu, 26 May 2016 19:09:48 +0000 (22:09 +0300)]
rustc_const_eval: track the length and index in IndexOutOfBounds.

8 years agorustc_const_eval: strings are not indexable in Rust 1.x.
Eduard Burtescu [Thu, 26 May 2016 17:19:45 +0000 (20:19 +0300)]
rustc_const_eval: strings are not indexable in Rust 1.x.

8 years agorustc_const_eval: remove unused arithmetic ErrKind variants.
Eduard Burtescu [Thu, 26 May 2016 17:19:12 +0000 (20:19 +0300)]
rustc_const_eval: remove unused arithmetic ErrKind variants.

8 years agoRespect #[rustc_inherit_overflow_checks] in mir::build and trans.
Eduard Burtescu [Thu, 26 May 2016 17:02:56 +0000 (20:02 +0300)]
Respect #[rustc_inherit_overflow_checks] in mir::build and trans.

8 years agocore: mark relevant functions with #[rustc_inherit_overflow_checks].
Eduard Burtescu [Thu, 26 May 2016 16:02:26 +0000 (19:02 +0300)]
core: mark relevant functions with #[rustc_inherit_overflow_checks].

8 years agomir: report when overflow checks would be missing cross-crate.
Eduard Burtescu [Thu, 26 May 2016 12:42:29 +0000 (15:42 +0300)]
mir: report when overflow checks would be missing cross-crate.

8 years agotrans: support uses of projections of immediate pairs.
Eduard Burtescu [Wed, 25 May 2016 08:58:08 +0000 (11:58 +0300)]
trans: support uses of projections of immediate pairs.

8 years agotrans: generalize OperandValue::FatPtr to all pairs of immediates.
Eduard Burtescu [Wed, 25 May 2016 08:55:44 +0000 (11:55 +0300)]
trans: generalize OperandValue::FatPtr to all pairs of immediates.

8 years agoAdd a new Assert terminator to MIR for bounds & arithmetic checks.
Eduard Burtescu [Wed, 25 May 2016 05:39:32 +0000 (08:39 +0300)]
Add a new Assert terminator to MIR for bounds & arithmetic checks.

8 years agoChange `with_cond` to `build_cond_br`
James Miller [Fri, 29 Apr 2016 02:10:56 +0000 (14:10 +1200)]
Change `with_cond` to `build_cond_br`

This is simpler to work with than `with_cond`.

8 years agoEnable the overflow-related tests for MIR
James Miller [Thu, 28 Apr 2016 12:08:01 +0000 (00:08 +1200)]
Enable the overflow-related tests for MIR

8 years agoAdd a `with_cond` method
James Miller [Thu, 28 Apr 2016 12:04:45 +0000 (00:04 +1200)]
Add a `with_cond` method

Factors out the common pattern across the several places that do
arithmetic checks

8 years agoCheck arithmetic in the MIR
James Miller [Thu, 31 Mar 2016 05:50:07 +0000 (18:50 +1300)]
Check arithmetic in the MIR

Add, Sub, Mul, Shl, and Shr are checked using a new Rvalue:
CheckedBinaryOp, while Div, Rem and Neg are handled with explicit checks
in the MIR.

8 years agoAuto merge of #33999 - scottcarr:master, r=nikomatsakis
bors [Sun, 5 Jun 2016 10:12:38 +0000 (03:12 -0700)]
Auto merge of #33999 - scottcarr:master, r=nikomatsakis

generate fewer basic blocks for variant switches

CC #33567
Adds a new field to TestKind::Switch that tracks the variants that are actually matched against.  The other candidates target a common "otherwise" block.

8 years agorun rustfmt on libtest folder
Srinivas Reddy Thatiparthy [Sun, 5 Jun 2016 06:49:37 +0000 (12:19 +0530)]
run rustfmt on libtest folder

8 years agoAuto merge of #33622 - arielb1:elaborate-drops, r=nikomatsakis
bors [Sun, 5 Jun 2016 06:49:29 +0000 (23:49 -0700)]
Auto merge of #33622 - arielb1:elaborate-drops, r=nikomatsakis

[MIR] non-zeroing drop

This enables non-zeroing drop through stack flags for MIR.

Fixes #30380.
Fixes #5016.

8 years agoUpdate LLVM
Ariel Ben-Yehuda [Sun, 5 Jun 2016 06:45:47 +0000 (09:45 +0300)]
Update LLVM

Picks up the fix for PR28005

8 years agobreak critical edges only when needed
Ariel Ben-Yehuda [Sun, 5 Jun 2016 06:00:17 +0000 (09:00 +0300)]
break critical edges only when needed

the *only* place where critical edges need to be broken is on Call
instructions, so only break them there.

8 years agoAuto merge of #34031 - jseyfried:fix_cfg_bug, r=eddyb
bors [Sat, 4 Jun 2016 23:48:29 +0000 (16:48 -0700)]
Auto merge of #34031 - jseyfried:fix_cfg_bug, r=eddyb

Fix a regression in the configuration folder

This fixes #34028, a regression caused by #33706 in which unconfigured impl items generated by a macro in an impl item position are not removed.
r? @nrc

8 years agorustdoc: Fix a few missing colors in the CSS
Oliver Middleton [Sat, 4 Jun 2016 22:43:24 +0000 (23:43 +0100)]
rustdoc: Fix a few missing colors in the CSS

This adds color to some of the search results and sidebar items which were missing.

8 years agoNo build.rs for libcore
John Ericson [Sat, 4 Jun 2016 21:19:46 +0000 (14:19 -0700)]
No build.rs for libcore

8 years agoAuto merge of #33816 - nikomatsakis:projection-cache-2, r=arielb1
bors [Sat, 4 Jun 2016 17:47:55 +0000 (10:47 -0700)]
Auto merge of #33816 - nikomatsakis:projection-cache-2, r=arielb1

Projection cache and better warnings for #32330

This PR does three things:

- it lays the groundwork for the more precise subtyping rules discussed in #32330, but does not enable them;
- it issues warnings when the result of a leak-check or subtyping check relies on a late-bound region which will late become early-bound when #32330 is fixed;
- it introduces a cache for projection in the inference context.

I'm not 100% happy with the approach taken by the cache here, but it seems like a step in the right direction. It results in big wins on some test cases, but not as big as previous versions -- I think because it is caching the `Vec<Obligation>` (whereas before I just returned the normalized type with an empty vector). However, that change was needed to fix an ICE in @alexcrichton's future-rs module (I haven't fully tracked the cause of that ICE yet). Also, because trans/the collector use a fresh inference context for every call to `fulfill_obligation`, they don't profit nearly as much from this cache as they ought to.

Still, here are the results from the future-rs `retry.rs`:

```
06:26 <nmatsakis> time: 6.246; rss: 44MB  item-bodies checking
06:26 <nmatsakis> time: 54.783; rss: 63MB   translation item collection
06:26 <nmatsakis> time: 140.086; rss: 86MB    translation

06:26 <nmatsakis> time: 0.361; rss: 46MB  item-bodies checking
06:26 <nmatsakis> time: 5.299; rss: 63MB    translation item collection
06:26 <nmatsakis> time: 12.140; rss: 86MB translation
```

~~Another example is the example from #31849. For that, I get 34s to run item-bodies without any cache. The version of the cache included here takes 2s to run item-bodies type-checking. An alternative version which doesn't track nested obligations takes 0.2s, but that version ICEs on @alexcrichton's future-rs (and may well be incorrect, I've not fully convinced myself of that). So, a definite win, but I think there's definitely room for further progress.~~

Pushed a modified version which improves performance of the case from #31849:

```
lunch-box. time rustc --stage0 ~/tmp/issue-31849.rs  -Z no-trans
real    0m33.539s
user    0m32.932s
sys     0m0.570s
lunch-box. time rustc --stage2 ~/tmp/issue-31849.rs  -Z no-trans
real    0m0.195s
user    0m0.154s
sys     0m0.042s
```

Some sort of cache is also needed for unblocking further work on lazy normalization, since that will lean even more heavily on the cache, and will also require cycle detection.

r? @arielb1

8 years agoAuto merge of #33998 - nikomatsakis:incr-comp-dep-node-trait, r=mw
bors [Sat, 4 Jun 2016 13:14:57 +0000 (06:14 -0700)]
Auto merge of #33998 - nikomatsakis:incr-comp-dep-node-trait, r=mw

Incr. comp. dep-node for traits, tests

Introduce new tests and also make dep-node for trait selection a bit more selective.

Fixes #33850

r? @michaelwoerister

8 years agofix fallout in tests
Ariel Ben-Yehuda [Sun, 29 May 2016 20:53:20 +0000 (23:53 +0300)]
fix fallout in tests

8 years agofix translation of terminators in MSVC cleanup blocks
Ariel Ben-Yehuda [Sun, 29 May 2016 19:01:06 +0000 (22:01 +0300)]
fix translation of terminators in MSVC cleanup blocks

MSVC requires unwinding code to be split to a tree of *funclets*, where each funclet
can only branch to itself or to to its parent.

Luckily, the code we generates matches this pattern. Recover that structure in
an analyze pass and translate according to that.

8 years agojump to the cleanup block in the unwind path for open_drop_for_box
Ariel Ben-Yehuda [Fri, 3 Jun 2016 22:49:34 +0000 (01:49 +0300)]
jump to the cleanup block in the unwind path for open_drop_for_box

silly bug. Hopefully the last one.

8 years agoAuto merge of #33991 - alexcrichton:rustbuild-more-clean, r=aturon
bors [Sat, 4 Jun 2016 08:23:02 +0000 (01:23 -0700)]
Auto merge of #33991 - alexcrichton:rustbuild-more-clean, r=aturon

rustbuild: Clean more on `make clean`

Be sure to not use the old build cache for the bootstrap build system nor the
old caches of the compiler/cargo extractions (in case something went wrong).

Closes #33986

8 years agoAuto merge of #33460 - shepmaster:16-bit-pointers, r=Aatch
bors [Sat, 4 Jun 2016 05:32:15 +0000 (22:32 -0700)]
Auto merge of #33460 - shepmaster:16-bit-pointers, r=Aatch

Support 16-bit pointers as well as i/usize

I'm opening this pull request to get some feedback from the community.

Although Rust doesn't support any platforms with a native 16-bit pointer at the moment, the [AVR-Rust][ar] fork is working towards that goal. Keeping this forked logic up-to-date with the changes in master has been onerous so I'd like to merge these changes so that they get carried along when refactoring happens. I do not believe this should increase the maintenance burden.

This is based on the original work of Dylan McKay (@dylanmckay).

[ar]: https://github.com/avr-rust/rust

8 years agoAuto merge of #33803 - WiSaGaN:feature/rename-main-thread, r=alexcrichton
bors [Sat, 4 Jun 2016 02:36:32 +0000 (19:36 -0700)]
Auto merge of #33803 - WiSaGaN:feature/rename-main-thread, r=alexcrichton

Rename main thread from "<main>" to "main".

Fix issue #33789

We may need to discuss whether this counts as a breaking change since code may check the main thread name against "\<main\>". Discussion is in #33789

8 years agocorrect misspelled word
Niko Matsakis [Sat, 4 Jun 2016 00:40:44 +0000 (20:40 -0400)]
correct misspelled word

8 years agoavoid extra clone
Niko Matsakis [Sat, 4 Jun 2016 00:39:43 +0000 (20:39 -0400)]
avoid extra clone

8 years agoAuto merge of #34020 - Stebalien:py-cleanup, r=alexcrichton
bors [Fri, 3 Jun 2016 19:37:01 +0000 (12:37 -0700)]
Auto merge of #34020 - Stebalien:py-cleanup, r=alexcrichton

Avoid repeated string concatenation in python

While performance isn't really critical here, IMO, format strings are more
readable.

/end nit

8 years agoAuto merge of #33997 - jseyfried:resolve_in_phase_2, r=nrc
bors [Fri, 3 Jun 2016 15:22:54 +0000 (08:22 -0700)]
Auto merge of #33997 - jseyfried:resolve_in_phase_2, r=nrc

Move name resolution into phase 2

r? @nrc

8 years agocheck for is_cleanup violations in MIR typeck
Ariel Ben-Yehuda [Sun, 29 May 2016 18:57:58 +0000 (21:57 +0300)]
check for is_cleanup violations in MIR typeck

There weren't any in practice, but as these cause MSVC-only problems, the
check looks like a good idea.

8 years agofix ICEs with RUST_LOG
Ariel Ben-Yehuda [Sun, 29 May 2016 16:27:05 +0000 (19:27 +0300)]
fix ICEs with RUST_LOG

8 years agoremove filling on drop
Ariel Ben-Yehuda [Fri, 27 May 2016 22:10:16 +0000 (01:10 +0300)]
remove filling on drop

8 years agoaddress review comments
Ariel Ben-Yehuda [Fri, 27 May 2016 12:07:08 +0000 (15:07 +0300)]
address review comments

8 years agoimplement drop elaboration
Ariel Ben-Yehuda [Mon, 16 May 2016 23:26:18 +0000 (02:26 +0300)]
implement drop elaboration

Fixes #30380

8 years agointroduce DropAndReplace for translating assignments
Ariel Ben-Yehuda [Mon, 16 May 2016 22:06:52 +0000 (01:06 +0300)]
introduce DropAndReplace for translating assignments

this introduces a DropAndReplace terminator as a fix to #30380. That terminator
is suppsoed to be translated by desugaring during drop elaboration, which is
not implemented in this commit, so this breaks `-Z orbit` temporarily.

8 years agoAdd regression test
Jeffrey Seyfried [Thu, 2 Jun 2016 07:43:44 +0000 (07:43 +0000)]
Add regression test

8 years agoUnsupport wget
Seo Sanghyeon [Fri, 3 Jun 2016 11:53:46 +0000 (20:53 +0900)]
Unsupport wget

8 years agoAuto merge of #33861 - Amanieu:lock_elision_fix, r=alexcrichton
bors [Fri, 3 Jun 2016 11:09:31 +0000 (04:09 -0700)]
Auto merge of #33861 - Amanieu:lock_elision_fix, r=alexcrichton

Make sure Mutex and RwLock can't be re-locked on the same thread

Fixes #33770

r? @alexcrichton

8 years agoUpdate comment
Reeze Xia [Fri, 3 Jun 2016 09:48:49 +0000 (17:48 +0800)]
Update comment

The path has changed

8 years agoAuto merge of #34016 - sanxiyn:travis-docker, r=brson
bors [Fri, 3 Jun 2016 07:13:38 +0000 (00:13 -0700)]
Auto merge of #34016 - sanxiyn:travis-docker, r=brson

Use Docker for Travis

The primary motivtion is to use system LLVM from ubuntu.com, instead of llvm.org.

Travis provides two environments: Ubuntu 12.04 LTS aka precise by default, and Ubuntu 14.04 LTS aka trusty if you specify dist: trusty. According to travis-ci/travis-ci#5821, Ubuntu 16.04 LTS aka xenial is unlikely to be available this year, and Travis recommends to use Docker.

LLVM 3.7 binary for 12.04 and 14.04 is not available from ubuntu.com, that's why we used llvm.org. But LLVM 3.7 binary for 16.04 is available from ubuntu.com, and we can use Docker to run on 16.04.

Fix #34009.

8 years agoUse Docker for Travis
Seo Sanghyeon [Wed, 1 Jun 2016 15:14:22 +0000 (00:14 +0900)]
Use Docker for Travis

8 years agoAuto merge of #33878 - GuillaumeGomez:improve_helps, r=jonathandturner
bors [Fri, 3 Jun 2016 01:10:37 +0000 (18:10 -0700)]
Auto merge of #33878 - GuillaumeGomez:improve_helps, r=jonathandturner

Improve help messages for E0425

Fixes #33876.

r? @Manishearth

cc @steveklabnik
cc @jonathandturner

8 years agoremove trailing whitespace
Scott A Carr [Thu, 2 Jun 2016 22:40:03 +0000 (15:40 -0700)]
remove trailing whitespace

8 years agoAuto merge of #33894 - nagisa:windows-lack-endurance-for-sprint, r=alexcrichton
bors [Thu, 2 Jun 2016 22:20:36 +0000 (15:20 -0700)]
Auto merge of #33894 - nagisa:windows-lack-endurance-for-sprint, r=alexcrichton

Rewrite variadic-ffi pass to use test helper

The sprintf used in this test previously isn’t available on some versions of MSVC.

Fixes #32305

r? @alexcrichton

8 years agoAdd regression test for issue #32829
Jonas Schievink [Thu, 2 Jun 2016 21:58:47 +0000 (23:58 +0200)]
Add regression test for issue #32829

Closes #32829

8 years agoCorrect issue number in test
Jake Goulding [Thu, 2 Jun 2016 20:03:12 +0000 (16:03 -0400)]
Correct issue number in test

8 years agoAuto merge of #33583 - luqmana:tri-bool-mir, r=arielb1
bors [Thu, 2 Jun 2016 17:55:43 +0000 (10:55 -0700)]
Auto merge of #33583 - luqmana:tri-bool-mir, r=arielb1

MIR: Don't generate 3-armed boolean switch from match.

Fixes #33540.

Snippet from issue:
```Rust
fn foo(x: bool, y: bool) -> u32 {
    match (x, y) {
         (false, _) => 0,
         (_, false) => 1,
         (true, true) => 2,
    }
}
```

Generated MIR:
```
fn foo(arg0: bool, arg1: bool) -> u32 {
    let var0: bool;                      // "x" in scope 1 at 3bbm.rs:17:8: 17:9
    let var1: bool;                      // "y" in scope 1 at 3bbm.rs:17:17: 17:18
    let mut tmp0: (bool, bool);
    let mut tmp1: bool;
    let mut tmp2: bool;
    let mut tmp3: (&'static str, &'static str, u32);
    let mut tmp4: &'static (&'static str, &'static str, u32);

    bb0: {
        var0 = arg0;                     // scope 1 at 3bbm.rs:17:8: 17:9
        var1 = arg1;                     // scope 1 at 3bbm.rs:17:17: 17:18
        tmp1 = var0;                     // scope 5 at 3bbm.rs:18:12: 18:13
        tmp2 = var1;                     // scope 6 at 3bbm.rs:18:15: 18:16
        tmp0 = (tmp1, tmp2);             // scope 4 at 3bbm.rs:18:11: 18:17
        if((tmp0.0: bool)) -> [true: bb4, false: bb1]; // scope 3 at 3bbm.rs:19:10: 19:15
    }

    bb1: {
        return = const 0u32;             // scope 10 at 3bbm.rs:19:23: 19:24
        goto -> bb7;                     // scope 3 at 3bbm.rs:18:5: 22:6
    }

    bb2: {
        return = const 1u32;             // scope 11 at 3bbm.rs:20:23: 20:24
        goto -> bb7;                     // scope 3 at 3bbm.rs:18:5: 22:6
    }

    bb3: {
        return = const 2u32;             // scope 12 at 3bbm.rs:21:25: 21:26
        goto -> bb7;                     // scope 3 at 3bbm.rs:18:5: 22:6
    }

    bb4: {
        if((tmp0.1: bool)) -> [true: bb5, false: bb2]; // scope 3 at 3bbm.rs:20:13: 20:18
    }

    bb5: {
        if((tmp0.0: bool)) -> [true: bb3, false: bb6]; // scope 3 at 3bbm.rs:21:10: 21:14
    }

    bb6: {
        tmp4 = promoted0;                // scope 3 at 3bbm.rs:18:5: 22:6
        core::panicking::panic(tmp4);    // scope 3 at 3bbm.rs:18:5: 22:6
    }

    bb7: {
        return;                          // scope 0 at 3bbm.rs:17:1: 23:2
    }
}
```

Not sure about this approach. I was also thinking maybe just a standalone pass?

cc @arielb1, @nagisa

8 years agoFix the test to use explicit argument types
Simonas Kazlauskas [Thu, 2 Jun 2016 14:18:11 +0000 (17:18 +0300)]
Fix the test to use explicit argument types

Hopefully this pacifies the 32bit windows. Apparently there’s an ABI out there that not only allows
non-64 bit variadic arguments, but also has differing ABI for them!

Good thing all variadic functions are unsafe.

8 years agoFix rwlock successfully acquiring a write lock after a read lock
Amanieu d'Antras [Thu, 26 May 2016 05:32:15 +0000 (06:32 +0100)]
Fix rwlock successfully acquiring a write lock after a read lock

8 years agoAdd a test to ensure mutexes and rwlocks can't be re-locked
Amanieu d'Antras [Thu, 26 May 2016 05:10:43 +0000 (06:10 +0100)]
Add a test to ensure mutexes and rwlocks can't be re-locked

8 years agolinkchecker: Treat directory links as errors
Oliver Middleton [Thu, 2 Jun 2016 12:33:21 +0000 (13:33 +0100)]
linkchecker: Treat directory links as errors

Directory links don't work well offline so they should be treated as errors.

8 years agoDon't allow pthread_rwlock_t to recursively lock itself
Amanieu d'Antras [Wed, 25 May 2016 05:07:54 +0000 (06:07 +0100)]
Don't allow pthread_rwlock_t to recursively lock itself

This is allowed by POSIX and can happen on glibc with processors
that support hardware lock elision.

8 years agoFix undefined behavior when re-locking a mutex from the same thread
Amanieu d'Antras [Wed, 25 May 2016 04:44:28 +0000 (05:44 +0100)]
Fix undefined behavior when re-locking a mutex from the same thread

The only applies to pthread mutexes. We solve this by creating the
mutex with the PTHREAD_MUTEX_NORMAL type, which guarantees that
re-locking from the same thread will deadlock.

8 years agoUpdate libc to bring in pthread mutex type definitions
Amanieu d'Antras [Wed, 25 May 2016 04:40:57 +0000 (05:40 +0100)]
Update libc to bring in pthread mutex type definitions

8 years agoAuto merge of #34034 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Thu, 2 Jun 2016 12:28:46 +0000 (05:28 -0700)]
Auto merge of #34034 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 7 pull requests

- Successful merges: #33993, #34013, #34014, #34015, #34019, #34021, #34033
- Failed merges:

8 years agoImprove help messages for E0425
ggomez [Thu, 26 May 2016 13:29:17 +0000 (15:29 +0200)]
Improve help messages for E0425

8 years agoRollup merge of #34033 - tshepang:typo, r=GuillaumeGomez
Guillaume Gomez [Thu, 2 Jun 2016 11:47:08 +0000 (13:47 +0200)]
Rollup merge of #34033 - tshepang:typo, r=GuillaumeGomez

doc: typo

8 years agoRollup merge of #34021 - ollie27:book_links_offline, r=steveklabnik
Guillaume Gomez [Thu, 2 Jun 2016 11:47:08 +0000 (13:47 +0200)]
Rollup merge of #34021 - ollie27:book_links_offline, r=steveklabnik

Fix a few links in the book

Links to directories and direct links to doc.rust-lang.org don't work properly
when viewing the docs offline so fix them.

r? @steveklabnik

8 years agoRollup merge of #34019 - kennytm:fix-33958, r=steveklabnik
Guillaume Gomez [Thu, 2 Jun 2016 11:47:08 +0000 (13:47 +0200)]
Rollup merge of #34019 - kennytm:fix-33958, r=steveklabnik

Restore original meaning of std::fs::read_dir's example changed in #33958

`DirEntry.file_type().is_dir()` will not follow symlinks, but the original example (`fs::metadata(&path).is_dir()`) does. Therefore the change in #33958 introduced a subtle difference that now it won't enter linked folders. To preserve the same behavior, we use `Path::is_dir()` instead, which does follow symlink.

(See discussion in the previous PR for detail.)

8 years agoRollup merge of #34015 - GuillaumeGomez:err-code-tests, r=jonathandturner
Guillaume Gomez [Thu, 2 Jun 2016 11:47:07 +0000 (13:47 +0200)]
Rollup merge of #34015 - GuillaumeGomez:err-code-tests, r=jonathandturner

Add new error code tests

r? @steveklabnik

8 years agoRollup merge of #34014 - GuillaumeGomez:fix-E0165, r=jonathandturner
Guillaume Gomez [Thu, 2 Jun 2016 11:47:07 +0000 (13:47 +0200)]
Rollup merge of #34014 - GuillaumeGomez:fix-E0165, r=jonathandturner

Fix E0165 code examples

r? @steveklabnik

8 years agoRollup merge of #34013 - kraai:fix-link, r=steveklabnik
Guillaume Gomez [Thu, 2 Jun 2016 11:47:07 +0000 (13:47 +0200)]
Rollup merge of #34013 - kraai:fix-link, r=steveklabnik

Fix broken link name in `bool` documentation

8 years agoRollup merge of #33993 - oconnor663:filedocs, r=alexcrichton
Guillaume Gomez [Thu, 2 Jun 2016 11:47:07 +0000 (13:47 +0200)]
Rollup merge of #33993 - oconnor663:filedocs, r=alexcrichton

document that Files close themselves automatically

8 years agodoc: typo
Tshepang Lekhonkhobe [Thu, 2 Jun 2016 11:28:24 +0000 (13:28 +0200)]
doc: typo

8 years agoUpdate cargo version in cargotest
Wangshan Lu [Thu, 2 Jun 2016 10:53:40 +0000 (18:53 +0800)]
Update cargo version in cargotest

8 years agoAuto merge of #33988 - intelfx:hoedown-bump, r=alexcrichton
bors [Thu, 2 Jun 2016 08:42:40 +0000 (01:42 -0700)]
Auto merge of #33988 - intelfx:hoedown-bump, r=alexcrichton

hoedown: fix trigger of -Werror=misleading-indentation

See rust-lang/hoedown#6.

8 years agoFix bug in the `syntax::config::StripUnconfigured` folder
Jeffrey Seyfried [Thu, 2 Jun 2016 07:34:19 +0000 (07:34 +0000)]
Fix bug in the `syntax::config::StripUnconfigured` folder

8 years agoAuto merge of #33947 - xosmig:btree_split_off, r=gereeter
bors [Thu, 2 Jun 2016 04:48:32 +0000 (21:48 -0700)]
Auto merge of #33947 - xosmig:btree_split_off, r=gereeter

Implement split_off for BTreeMap and BTreeSet (RFC 509)

Fixes #19986 and refactors common with append methods.
It splits the tree with O(log n) operations and then calculates sizes by traversing the lower one.

CC @gereeter

8 years ago[MIR] Use If terminator for switches on bools rather than SwitchInt.
Luqman Aden [Sat, 28 May 2016 19:50:33 +0000 (15:50 -0400)]
[MIR] Use If terminator for switches on bools rather than SwitchInt.