Commit Graph

66317 Commits

Author SHA1 Message Date
Ariel Ben-Yehuda
85c102757a rustc_mir: don't build unused unwind cleanup blocks
The unused blocks are removed by SimplifyCfg, but they can cause a
significant performance slowdown before they are removed.
2017-08-01 00:12:30 +03:00
Ariel Ben-Yehuda
1447daa01d remove the span field from diverge_cleanup 2017-08-01 00:12:30 +03:00
bors
37c7d0ebb3 Auto merge of #43399 - tschottdorf:bndmode-pat-adjustments, r=nikomatsakis
default binding modes: add pat_binding_modes

This PR kicks off the implementation of the [default binding modes RFC][1] by
introducing the `pat_binding_modes` typeck table mentioned in the [mentoring
instructions][2].

It is a WIP because I wasn't able to avoid all uses of the binding modes as
not all call sites are close enough to the typeck tables. I added marker
comments to any line matching `BindByRef|BindByValue` so that reviewers
are aware of all of them.

I will look into changing the HIR (as suggested in [2]) to not carry a
`BindingMode` unless one was explicitly specified, but this PR is good for
a first round of comments.

The actual changes are quite small and CI will fail due to overlong lines
caused by the marker comments.

See #42640.

cc @nikomatsakis

[1]: https://github.com/rust-lang/rfcs/pull/2005
[2]: https://github.com/rust-lang/rust/issues/42640#issuecomment-313535089
2017-07-31 20:47:42 +00:00
Ralf Jung
6135461f9a CleanEndRegions: use default impl where possible 2017-07-31 13:21:10 -07:00
Ralf Jung
6ff7c8fa04 more documentation 2017-07-31 13:20:37 -07:00
Michael Woerister
b1e043e9e9 async-llvm(27): Move #[rustc_error] check to an earlier point in order to restore some test expections. 2017-07-31 18:51:39 +02:00
Niko Matsakis
8f67f1efaf add comments from arielb1 2017-07-31 18:13:49 +03:00
Ariel Ben-Yehuda
93db1f9923 trans::mir::constant - fix assignment error recovery
We used to not store anything when the RHS of an assignment returned an
error, which caused ICEs downstream.

Fixes #43197.
2017-07-31 18:09:02 +03:00
Ariel Ben-Yehuda
1057a728f5 fix -Z treat-err-as-bug 2017-07-31 18:09:02 +03:00
Michael Woerister
cacc31f8a3 async-llvm(26): Print error when failing to acquire Jobserver token. 2017-07-31 15:41:41 +02:00
Michael Woerister
a9a0ea921b async-llvm(25): Restore -Ztime-passes output for trans and LLVM. 2017-07-31 15:15:44 +02:00
Michael Woerister
bd36df84a5 async-llvm(24): Improve scheduling and documentation. 2017-07-31 15:15:44 +02:00
Michael Woerister
f5acc392e0 async-llvm(23): Let the main thread also do LLVM work in order to reduce memory pressure. 2017-07-31 15:15:44 +02:00
Michael Woerister
8819278523 async-llvm(22): mw invokes mad html skillz to produce graphical LLVM timing reports. 2017-07-31 15:15:44 +02:00
Michael Woerister
1480be3779 async-llvm(21): Re-use worker-ids in order to simulate persistent worker threads. 2017-07-31 15:15:09 +02:00
Michael Woerister
ab3bc584c0 async-llvm(20): Do some cleanup. 2017-07-31 15:15:09 +02:00
Michael Woerister
81b789fd87 async-llvm(19): Already start LLVM while still translating. 2017-07-31 15:15:09 +02:00
Michael Woerister
7e09d1e170 async-llvm(18): Instantiate OngoingCrateTranslation before starting translation. 2017-07-31 15:15:09 +02:00
Michael Woerister
e7d0fa340f async-llvm(17): Create MSVC __imp_ symbols immediately for each module. 2017-07-31 15:15:09 +02:00
Michael Woerister
0ad9eaa998 async-llvm(16): Inject allocator shim into LLVM module immediately if necessary. 2017-07-31 15:15:09 +02:00
Michael Woerister
943a5bdf35 async-llvm(15): Don't require number of codegen units upfront. 2017-07-31 15:15:09 +02:00
Michael Woerister
a1be65845c async-llvm(14): Move LTO/codegen-unit conflict check to beginning of compilation process. 2017-07-31 15:15:09 +02:00
Michael Woerister
b924ec1484 async-llvm(13): Submit LLVM work packages from base::trans_crate(). 2017-07-31 15:15:09 +02:00
Michael Woerister
397b2a800f async-llvm(12): Hide no_integrated_as logic in write::run_passes. 2017-07-31 15:15:09 +02:00
Michael Woerister
f3ce50558f async-llvm(11): Delay joining ongoing translation until right before linking. 2017-07-31 15:15:09 +02:00
Michael Woerister
28589ec3e4 async-llvm(10): Factor compile output files cleanup into separate functions. 2017-07-31 15:15:09 +02:00
Michael Woerister
ccb970be4c async-llvm(9): Move OngoingCrateTranslation into back::write. 2017-07-31 15:15:09 +02:00
Michael Woerister
645841ea44 async-llvm(8): Clean up resource management and drop LLVM modules ASAP. 2017-07-31 15:15:09 +02:00
Michael Woerister
4282dd87ea async-llvm(7): Clean up error handling a bit. 2017-07-31 15:15:09 +02:00
Michael Woerister
8f6894e177 async-llvm(6): Make the LLVM work coordinator get its work package through a channel instead of upfront. 2017-07-31 15:15:09 +02:00
Michael Woerister
b18a61a15b async-llvm(5): Do continuous error handling on main thread. 2017-07-31 15:15:09 +02:00
Michael Woerister
df6be33d84 async-llvm(4): Move work coordination to separate thread in order to free up the main thread for translation. 2017-07-31 15:15:09 +02:00
Michael Woerister
bac57cf654 async-llvm(3): Make write::CodegenContext Clone and Send. 2017-07-31 15:13:10 +02:00
Michael Woerister
29d4725b31 async-llvm(2): Decouple diagnostics emission from LLVM worker coordination. 2017-07-31 14:55:13 +02:00
Michael Woerister
c4adeceb37 async-llvm(1): Run LLVM already in trans_crate(). 2017-07-31 14:55:13 +02:00
Ariel Ben-Yehuda
83eb264273 borrowck: skip CFG construction when there is nothing to propagate
CFG construction takes a large amount of time and memory, especially for
large constants. If such a constant contains no actions on lvalues, it
can't have borrowck problems and can be ignored by it.

This removes the 4.9GB borrowck peak from #36799. It seems that HIR had
grown by 300MB and MIR had grown by 500MB from the last massif
collection and that remains to be investigated, but this at least shaves
the borrowck peak.
2017-07-31 15:17:30 +03:00
bors
2a6828e7f1 Auto merge of #43562 - alexcrichton:no-clean-rebuild, r=petrochenkov
rustbuild: Remove `--enable-llvm-clean-rebuild`

This was intended for bots back in the day where we'd persist caches of LLVM
builds across runs, but nowadays we don't do that on any of the bots so this
option is no longer necessary
2017-07-31 08:35:36 +00:00
bors
f6d7873e93 Auto merge of #43546 - nikomatsakis:issue-43132, r=arielb1
save subobligations in the projection cache

The projection cache explicitly chose not to "preserve" subobligations for projections, since the fulfillment context ought to have been doing so. But for the trait evaluation scheme that causes problems. This PR reproduces subobligations. This has the potential to slow down compilation, but minimal investigation suggests it does not do so.

One hesitation about this PR: I could not find a way to make a standalone test case for #43132 (but admittedly I did not try very hard).

Fixes #43132.

r? @arielb1
2017-07-31 04:58:10 +00:00
bors
2789db2720 Auto merge of #43519 - zackmdavis:long_diagnostics_ever_after, r=GuillaumeGomez
a couple more error explanations for posterity

E0436, E0595, and moving E0569 to where it belongs in the file rather than being bizarrely out of numerical order

r? @GuillaumeGomez
2017-07-31 01:00:13 +00:00
bors
15266f9a1b Auto merge of #43563 - tbu-:pr_from_str_radix_panic, r=alexcrichton
Document the `from_str_radix` panic

CC #42034
2017-07-30 22:39:23 +00:00
Tobias Bucher
bbb5311ad6 Document the from_str_radix panic
CC #42034
2017-07-30 23:20:54 +02:00
Alex Crichton
eb1c44b6ed rustbuild: Remove --enable-llvm-clean-rebuild
This was intended for bots back in the day where we'd persist caches of LLVM
builds across runs, but nowadays we don't do that on any of the bots so this
option is no longer necessary
2017-07-30 13:50:19 -07:00
bors
aac223f4f5 Auto merge of #43556 - dmizuk:remove-z-opt-usage, r=arielb1
librustc_driver: Remove -Z option from usage on stable compiler

The `-Z` flag has been disabled since Rust 1.19 stable, but it still shows in `rustc --help`.

This PR addresses the inconsistency by removing the message on the stable channel.
2017-07-30 20:19:53 +00:00
QuietMisdreavus
a2d5514693 add docs for references as a primitive 2017-07-30 14:59:08 -05:00
Zack M. Davis
7dab9812c4 extended info for E0595 closure cannot mutate immutable local variable 2017-07-30 11:10:35 -07:00
Zack M. Davis
5605d58fc7 move extended info for E0569 to numerical-order location in file
We want the error explanations to appear in numerical order so that
they're easy to find. (Also, any other order would be arbitrary and thus
not constitute a Schelling point.) Bizarrely, the extended information
for E0569 was placed between E0244 and E0318 in
librustc_typeck/diagnostics.rs (when the code was introduced in
9a649c32). This commit moves it to be between E0562 and E0570, where it
belongs.

(Also, at reviewer request, say "Erroneous code example", the standard
verbiage that it has been decided that we say everywhere.)
2017-07-30 11:09:37 -07:00
Zack M. Davis
6f14ff105f add extended info for E0436 functional record update syntax needs struct
This example focuses on struct-like enum variants, because it's not
immediately obvious in what other context we can get E0436 alone,
without any other, more serious, errors. (Triggering E0436 with a union
also emits a separate "union expressions should have exactly one field"
error.)

(One might argue that we ought to accept the functional record update
syntax for struct-like enums, but that is beyond the scope of this
error-index-comprehensiveness commit.)
2017-07-30 11:08:41 -07:00
Niko Matsakis
2574f31b9b save the subobligations as well 2017-07-30 11:07:28 -07:00
bors
489b792bab Auto merge of #43515 - QuietMisdreavus:show-assoc-types, r=GuillaumeGomez
rustdoc: print associated types in traits "implementors" section

When viewing a trait's implementors, they won't show anything about the implementation other than any bounds on the generics. You can see the full implementation details on the page for the type, but if the type is external (e.g. it's an extension trait being implemented for primitives), then you'll never be able to see the details of the implementation without opening the source code. This doesn't solve everything about that, but it does still show an incredibly useful piece of information: the associated types. This can help immensely for traits like `Deref` or `IntoIterator` in libstd, and also for traits like `IntoFuture` outside the standard library.

Fixes #24200

🚨 BIKESHED ALERT 🚨 The indentation and sizing of the types is suspect. I put it in the small text so it wouldn't blend in with the next impl line. (It shares a CSS class with the where clauses, as you can see in the following image.) However, the indentation is nonstandard. I initially tried with no indentation (looked awkward and blended too well with the surrounding impls) and with 4-space indentation (too easy to confuse with where clauses), before settling on the 2-space indentation seen below. It's... okay, i guess. Open to suggestions.

![snippet of the implementors of IntoIterator, showing the associated types](https://user-images.githubusercontent.com/5217170/28697456-a4e01a12-7301-11e7-868e-2a6441d6c9e0.png)
2017-07-30 17:42:32 +00:00
Ralf Jung
6641415e87 do not use doc comments inside functions 2017-07-30 10:29:15 -07:00