Commit Graph

53406 Commits

Author SHA1 Message Date
bors
5f6eb14b28 Auto merge of #33563 - Amanieu:oncestate, r=alexcrichton
Export OnceState from libstd

This type is used in the signature of `call_once_force` but isn't exported from libstd.

r? @alexcrichton
2016-05-14 07:15:45 -07:00
bors
6ba8a1a657 Auto merge of #33632 - Manishearth:rollup, r=Manishearth
Rollup of 9 pull requests

- Successful merges: #33544, #33552, #33554, #33555, #33560, #33566, #33572, #33574, #33576
- Failed merges:
2016-05-14 04:24:33 -07:00
Tshepang Lekhonkhobe
e699e12eb0 doc: 'tis the lang, not the reptile 2016-05-14 13:02:28 +02:00
Vadim Petrochenkov
a62a690326 Add checks for self: _ and self: &_ 2016-05-14 13:42:37 +03:00
Tshepang Lekhonkhobe
971a3afe48 doc: improve output 2016-05-14 12:35:02 +02:00
Vadim Petrochenkov
766f9b5a2f Remove ExplicitSelf from HIR 2016-05-14 13:26:40 +03:00
Vadim Petrochenkov
212d5d4352 syntax: Refactor parsing of method declarations
Fix spans and expected token lists, fix #33413 + other cosmetic improvements
Add test for #33413
Convert between `Arg` and `ExplicitSelf` precisely
Simplify pretty-printing for methods
2016-05-14 13:23:37 +03:00
Manish Goregaokar
61d87f0825 Rollup merge of #33576 - soltanmm:vtable, r=nikomatsakis
Plumb inference obligations through selection, take 2

Using a `SnapshotVec` and dumping inferred obligations into `Vtable` variants.

r? @nikomatsakis
2016-05-14 11:57:49 +02:00
Manish Goregaokar
c62d65cfbf Rollup merge of #33574 - michaelwoerister:collector-cleanup, r=nikomatsakis
trans-collector: Assorted fixes and refactorings needed for making trans collector-driven.

As the title says. The messages on the individual commits should do a good job of explaining what they are about.

r? @nikomatsakis
2016-05-14 11:57:49 +02:00
Manish Goregaokar
8845592514 Rollup merge of #33572 - nagisa:assoc-const-types, r=eddyb
Support references to outer type params for assoc consts

Fixes #28809

r? @eddyb
2016-05-14 11:57:48 +02:00
Manish Goregaokar
25ca82aa17 Rollup merge of #33566 - dotdash:biased_switch, r=nagisa
[MIR trans] Optimize trans for biased switches

Currently, all switches in MIR are exhausitive, meaning that we can have
a lot of arms that all go to the same basic block, the extreme case
being an if-let expression which results in just 2 possible cases, be
might end up with hundreds of arms for large enums.

To improve this situation and give LLVM less code to chew on, we can
detect whether there's a pre-dominant target basic block in a switch
and then promote this to be the default target, not translating the
corresponding arms at all.

In combination with #33544 this makes unoptimized MIR trans of
nickel.rs as fast as using old trans and greatly improves the times for
optimized builds, which are only 30-40% slower instead of ~300%.

cc #33111
2016-05-14 11:57:48 +02:00
Manish Goregaokar
f5462013ee Rollup merge of #33560 - eddyb:symtidy, r=alexcrichton
Use symlink_metadata in tidy to avoid panicking on broken symlinks.

r? @alexcrichton
2016-05-14 11:57:48 +02:00
Manish Goregaokar
8bc265bdd1 Rollup merge of #33555 - soltanmm:ambiguous-nixon, r=nikomatsakis
Remove unification despite ambiguity in projection

Turns out that closures aren't explicitly considered in `project.rs`, so the ambiguity handling w.r.t. closures can just be removed as the change done in `select.rs` covers it.

r? @nikomatsakis
2016-05-14 11:57:48 +02:00
Manish Goregaokar
4a1ce9831c Rollup merge of #33554 - sfackler:no-current-exe, r=alexcrichton
Don't use env::current_exe with libbacktrace

If the path we give to libbacktrace doesn't actually correspond to the
current process, libbacktrace will segfault *at best*.

cc #21889

r? @alexcrichton
cc @semarie
2016-05-14 11:57:47 +02:00
Manish Goregaokar
ea68dd8def Rollup merge of #33552 - dotdash:scfg, r=luqmana
[MIR] Enhance the SimplifyCfg pass to merge consecutive blocks

Updated from #30238, including the changes suggested by @Aatch.
2016-05-14 11:57:47 +02:00
Manish Goregaokar
36c4c6d433 Rollup merge of #33544 - dotdash:baby_dont_break_me_no_more, r=Aatch
Only break critical edges where actually needed

Currently, to prepare for MIR trans, we break _all_ critical edges,
although we only actually need to do this for edges originating from a
call that gets translated to an invoke instruction in LLVM.

This has the unfortunate effect of undoing a bunch of the things that
SimplifyCfg has done. A particularly bad case arises when you have a
C-like enum with N variants and a derived PartialEq implementation.

In that case, the match on the (&lhs, &rhs) tuple gets translated into
nested matches with N arms each and a basic block each, resulting in N²
basic blocks. SimplifyCfg reduces that to roughly 2*N basic blocks, but
breaking the critical edges means that we go back to N².

In nickel.rs, there is such an enum with roughly N=800. So we get about
640K basic blocks or 2.5M lines of LLVM IR. LLVM takes a while to
reduce that to the final "disr_a == disr_b".

So before this patch, we had 2.5M lines of IR with 640K basic blocks,
which took about about 3.6s in LLVM to get optimized and translated.
After this patch, we get about 650K lines with about 1.6K basic blocks
and spent a little less than 0.2s in LLVM.

cc #33111

r? @Aatch
2016-05-14 11:57:47 +02:00
Tshepang Lekhonkhobe
deb8165b36 doc: this statement does not have an effect 2016-05-14 11:55:46 +02:00
Scott Olson
ef53fa76df rustbuild: Ignore user config.toml file. 2016-05-14 01:16:08 -06:00
bors
d3ec9d43cf Auto merge of #33538 - Ms2ger:LocalCrateReader, r=arielb1
Refactor code around LocalCrateReader.
2016-05-13 23:34:52 -07:00
Ariel Ben-Yehuda
5458d8b419 rewrite fuzzy on_unimplemented matching to avoid ICEs 2016-05-13 23:01:57 -07:00
Ariel Ben-Yehuda
f0f5ef51bf address review comments 2016-05-13 21:23:02 -07:00
Ariel Ben-Yehuda
5c39a2ae44 add cycle-reporting logic
Fixes #33344
2016-05-13 21:23:02 -07:00
Ariel Ben-Yehuda
957500b793 rewrite obligation forest. cycles still handled incorrectly. 2016-05-13 21:23:02 -07:00
bors
dee865a56d Auto merge of #33532 - jseyfried:mutable_lowering_context, r=nrc
Clean up `hir::lowering`

Clean up `hir::lowering`:
 - give lowering functions mutable access to the lowering context
 - refactor the `lower_*` functions and other functions that take a lowering context into methods
 - simplify the API that `hir::lowering` exposes to `driver`
 - other miscellaneous cleanups

r? @nrc
2016-05-13 18:40:08 -07:00
bors
2b79e05a05 Auto merge of #33508 - alexcrichton:always-lower-frem, r=nikomatsakis
trans: Always lower to `frem`

Long ago LLVM unfortunately didn't handle the 32-bit MSVC case of `frem` where
it can't be lowered to `fmodf` because that symbol doesn't exist. That was since
fixed in http://reviews.llvm.org/D12099 (landed as r246615) and was released in
what appears to be LLVM 3.8. Now that we're using that branch of LLVM let's
remove our own hacks and help LLVM optimize a little better by giving it
knowledge about what we're doing.
2016-05-13 16:00:05 -07:00
Niko Matsakis
3ff521bdb5 check check-ui and check-incremental in check 2016-05-13 15:23:20 -07:00
Niko Matsakis
1ba4e7b7cf modify rust-build to support incremental, ui tests 2016-05-13 15:22:45 -07:00
Niko Matsakis
225fa0faff dump outputs, diff on UI test failure 2016-05-13 15:22:45 -07:00
Niko Matsakis
cb112dc8cf add UI testing framework 2016-05-13 15:22:45 -07:00
Jonas Schievink
2c7e398935 Indent comments less
40 chars is still enough indentation (most common MIR statements don't
take more than 40 chars), and fits more easily in 80-character
terminals.
2016-05-13 23:40:06 +02:00
Jonas Schievink
95a968c426 Much smaller scope tree printing 2016-05-13 23:36:50 +02:00
Jonathan Turner
6793cace06 Address nit 2016-05-13 12:57:34 -07:00
Eduard Burtescu
55aae6f48e mir: always allow &mut [...] in static mut regardless of the array length. 2016-05-13 22:27:09 +03:00
Nick Cameron
6d6986b87a save-analysis: make DefIds prettier 2016-05-13 12:23:41 -07:00
bors
33a5c9dfd1 Auto merge of #33355 - luqmana:33202-repr-ice, r=nrc
adt: Allow repr attribute on single variant enum.

Fixes #33202.
2016-05-13 12:16:53 -07:00
Val Vanderschaegen
64feba03d7 Updated based on CR feedback. 2016-05-13 12:01:45 -07:00
Sander Maijers
650855322b
IntelliJ support, ordering, cleanup 2016-05-13 19:18:59 +02:00
Amanieu d'Antras
915fa57a93 Make AtomicBool the same size as bool 2016-05-13 17:54:06 +01:00
Luqman Aden
f3e1d57bc2 Allow repr attribute on single variant enum. 2016-05-13 12:36:57 -04:00
Jonathan Turner
ecadd7e957 Update span_label call to new api 2016-05-13 09:27:35 -07:00
bors
bc5789902b Auto merge of #33531 - antonblanchard:local_stage0_fix, r=alexcrichton
Copy more libraries from local Rust to stage0

When bootstrapping Rust using a previously built toolchain, I noticed
a number of libraries were not copied in. As a result the copied in
rustc fails to execute because it can't find all its dependences.

Add them into the local_stage0.sh script.
2016-05-13 08:46:16 -07:00
bors
edb6f83b89 Auto merge of #33513 - sanxiyn:tab-in-error, r=nikomatsakis
Better handling of tab in error

cc #33240.
2016-05-13 06:26:15 -07:00
Andrea Canciani
f96864dab6 Document the x87 control word
Explain the meaning of the fields of the control word and provide more
details about how the relevant one (Precision Control) is updated in
the fast path.
2016-05-13 15:19:23 +02:00
Andrea Canciani
78124a2b32 Fix fast path of float parsing on x87
The fast path of the float parser relies on the rounding to happen
exactly and directly to the correct number of bits. On x87, instead,
double rounding would occour as the FPU stack defaults to 80 bits of
precision.

This can be fixed by setting the precision of the FPU stack before
performing the int to float conversion. This can be achieved by
changing the value of the x87 control word. This is a somewhat common
operation that is in fact performed whenever a float needs to be
truncated to an integer, but it is undesirable to add its overhead for
code that does not rely on x87 for computations (i.e. on non-x86
architectures, or x86 architectures which perform FPU computations on
using SSE).

Fixes `num::dec2flt::fast_path_correct` (on x87).
2016-05-13 15:18:31 +02:00
ggomez
1d6411d863 Add compile-fail tests for error codes 2016-05-13 14:43:56 +02:00
bors
a581c82bdc Auto merge of #33541 - eddyb:promote-only-temps, r=arielb1
mir: don't attempt to promote Unpromotable constant temps.

Fixes #33537. This was a non-problem in regular functions, but we also promote in `const fn`s.
There we always qualify temps so you can't depend on `Unpromotable` temps being `NOT_CONST`.
2016-05-13 03:10:46 -07:00
bors
709e5c5fde Auto merge of #33596 - nikomatsakis:issue-33586-regr-assoc-type-path, r=eddyb
re-introduce a cache for ast-ty-to-ty

It turns out that `ast_ty_to_ty` is supposed to be updating the `def`
after it finishes, but at some point in the past it stopped doing
so. This was never noticed because of the `ast_ty_to_ty_cache`, but that
cache was recently removed. This PR fixes the code to update the def
properly, but apparently that is not quite enough to make the operation
idempotent, so for now we reintroduce the cache too.

Fixes #33586.

r? @eddyb
2016-05-13 00:29:22 -07:00
Steven Burns
04baf2593e Generic encoded enums no longer crash on reference/pointer types 2016-05-12 22:01:49 -06:00
bors
01ed700640 Auto merge of #33450 - SiegeLord:dep_info_no_analysis, r=nrc
Make --emit dep-info work correctly with -Z no-analysis again.

Previously, it would attempt to resolve some external crates that weren't necessary for dep-info output.

Fixes #33231.
2016-05-12 19:52:51 -07:00
Val Vanderschaegen
7da9ea0af4 Add a note about Higher-Ranked Trait Bounds in docs on Closures.
When using closures that take references with explicit lifetimes sometimes
it's required to use where F: for<..> ... syntax to express the right
lifetimes. This adds a quick note to the docs so other users can discover
it as well.
2016-05-12 18:56:20 -07:00