Commit Graph

54112 Commits

Author SHA1 Message Date
Eduard Burtescu
d8dddbf201 Respect #[rustc_inherit_overflow_checks] in mir::build and trans. 2016-06-05 14:41:03 +03:00
Eduard Burtescu
702c47baae core: mark relevant functions with #[rustc_inherit_overflow_checks]. 2016-06-05 14:41:03 +03:00
Eduard Burtescu
4adc967ed1 mir: report when overflow checks would be missing cross-crate. 2016-06-05 14:41:03 +03:00
Eduard Burtescu
cab35ff4b8 trans: support uses of projections of immediate pairs. 2016-06-05 14:41:02 +03:00
Eduard Burtescu
f1f453cf3b trans: generalize OperandValue::FatPtr to all pairs of immediates. 2016-06-05 14:41:02 +03:00
Eduard Burtescu
156b1fb9e1 Add a new Assert terminator to MIR for bounds & arithmetic checks. 2016-06-05 14:41:02 +03:00
James Miller
7fbff36d01 Change with_cond to build_cond_br
This is simpler to work with than `with_cond`.
2016-06-05 14:02:24 +03:00
James Miller
bcdb2602f8 Enable the overflow-related tests for MIR 2016-06-05 14:02:24 +03:00
James Miller
f2c983b248 Add a with_cond method
Factors out the common pattern across the several places that do
arithmetic checks
2016-06-05 14:02:24 +03:00
James Miller
73f3054288 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.
2016-06-05 14:02:24 +03:00
Eduard Burtescu
bcec7a5848 rustc: add ReErased to be used by trait selection, MIR and trans. 2016-06-05 13:58:51 +03:00
bors
22b36c70f9 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.
2016-06-05 03:12:38 -07:00
Srinivas Reddy Thatiparthy
27d4ed4d34 run rustfmt on librustc_bitflags folder 2016-06-05 13:01:11 +05:30
Alex Crichton
1564e92940 rustc: Try to contain prepends to PATH
This commit attempts to bring our prepends to PATH on Windows when loading
plugins because we've been seeing quite a few issues with failing to spawn a
process on Windows, the leading theory of which is that PATH is too large as a
result of this. Currently this is mostly a stab in the dark as it's not
confirmed to actually fix the problem, but it's probably not a bad change to
have anyway!

cc #33844
Closes #17360
2016-06-05 00:08:35 -07:00
Srinivas Reddy Thatiparthy
8a6a9af982 run rustfmt on libtest folder 2016-06-05 12:19:37 +05:30
bors
f97c411548 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.
2016-06-04 23:49:29 -07:00
Ariel Ben-Yehuda
063f8826e7 Update LLVM
Picks up the fix for PR28005
2016-06-05 09:45:47 +03:00
Ariel Ben-Yehuda
4106ab24d7 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.
2016-06-05 09:27:26 +03:00
Srinivas Reddy Thatiparthy
d6560ddd20 run rustfmt on map.rs in libcollections/btree folder 2016-06-05 11:53:44 +05:30
Srinivas Reddy Thatiparthy
adf2c432dc run rustfmt on liballoc_jemalloc folder 2016-06-05 11:39:17 +05:30
bors
ccfaaa7d98 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
2016-06-04 16:48:29 -07:00
Oliver Middleton
55af6e48ca rustdoc: Fix a few missing colors in the CSS
This adds color to some of the search results and sidebar items which were missing.
2016-06-04 23:43:24 +01:00
John Ericson
bce5383942 No build.rs for libcore 2016-06-04 15:10:26 -07:00
bors
12238b984a 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
2016-06-04 10:47:55 -07:00
bors
382ab92cee 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
2016-06-04 06:14:57 -07:00
Ariel Ben-Yehuda
4248269f8a fix fallout in tests 2016-06-04 13:26:37 +03:00
Ariel Ben-Yehuda
1ae7ae0c1c 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.
2016-06-04 13:26:32 +03:00
Ariel Ben-Yehuda
506086ef96 jump to the cleanup block in the unwind path for open_drop_for_box
silly bug. Hopefully the last one.
2016-06-04 13:25:10 +03:00
bors
4fb145867b 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
2016-06-04 01:23:02 -07:00
bors
7738479d72 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
2016-06-03 22:32:15 -07:00
bors
c81c75076c 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
2016-06-03 19:36:32 -07:00
Niko Matsakis
e548c46c70 correct misspelled word 2016-06-03 20:40:44 -04:00
Niko Matsakis
af4a0e8e05 avoid extra clone 2016-06-03 20:39:43 -04:00
Oliver Middleton
4ddb541818 rustdoc: Fix generating redirect pages for statics and consts
These were missing from the cache for some reason meaning the redirect pages failed to render.
2016-06-03 22:59:45 +01:00
bors
7de2e6dc82 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
2016-06-03 12:37:01 -07:00
bors
1ceaa86e0a Auto merge of #33997 - jseyfried:resolve_in_phase_2, r=nrc
Move name resolution into phase 2

r? @nrc
2016-06-03 08:22:54 -07:00
Ariel Ben-Yehuda
148f8422f3 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.
2016-06-03 16:11:18 +03:00
Ariel Ben-Yehuda
f6068ea847 fix ICEs with RUST_LOG 2016-06-03 16:11:18 +03:00
Ariel Ben-Yehuda
4fff19528b remove filling on drop 2016-06-03 16:11:18 +03:00
Ariel Ben-Yehuda
8d6d646203 address review comments 2016-06-03 16:11:18 +03:00
Ariel Ben-Yehuda
a091cfd4f3 implement drop elaboration
Fixes #30380
2016-06-03 16:11:18 +03:00
Ariel Ben-Yehuda
de7cb0fdd6 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.
2016-06-03 16:11:18 +03:00
Jeffrey Seyfried
9639ec87e7 Add regression test 2016-06-03 12:57:58 +00:00
Jeffrey Seyfried
635a82e744 Add regression test. 2016-06-03 12:56:26 +00:00
Seo Sanghyeon
a7e96af377 Unsupport wget 2016-06-03 20:53:46 +09:00
bors
9552bcdd92 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
2016-06-03 04:09:31 -07:00
Jakob Demler
c26703b77b document of shared modules for integration tests 2016-06-03 12:16:07 +02:00
Reeze Xia
959c5f1a92 Update comment
The path has changed
2016-06-03 17:48:49 +08:00
Jakob Demler
d71f9f614c Fixed ambiguous explanaiton of tests/ directory 2016-06-03 11:43:42 +02:00
bors
95206f438f 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.
2016-06-03 00:13:38 -07:00