Commit Graph

59005 Commits

Author SHA1 Message Date
bors
9ca50bd4d5 Auto merge of #38027 - rkruppe:llvm-printpasses-fwdcompat, r=alexcrichton
[LLVM 4.0] LLVMRustPrintPasses

Adapt `LLVMRustPrintPasses` to LLVM 4.0 preferring `StringRef` over `char *`

cc #37609
2016-11-27 13:51:40 -06:00
bors
2008732975 Auto merge of #37983 - GuillaumeGomez:tcp_listener_doc, r=frewsxcv
Add examples for TcpListener struct

r? @frewsxcv
2016-11-27 10:39:41 -06:00
Robin Kruppe
cb0e24eafa Adapt LLVMRustPrintPasses to LLVM 4.0 preferring StringRef over char * 2016-11-27 14:48:47 +01:00
bors
0e17ba5ffc Auto merge of #38007 - alygin:err-expl-fix, r=eddyb
Fix error explanation formatting

Errors E0101, E0458, E0535 and E0537 have incorrectly formatted bulleted lists in their explanations. As the result, they are not rendered as lists in the documentation.

The fix applies the correct formatting to those lists.
2016-11-27 06:04:18 -06:00
Guillaume Gomez
f216f1fc53 Add examples for TcpListener struct 2016-11-27 13:00:31 +01:00
bors
f3930aab46 Auto merge of #38023 - arielb1:constant-evil-x2, r=eddyb
don't double-apply variant padding to const enums

`build_const_struct` already returns the struct with padding - don't double-apply it in the `General` case.

This should hopefully be the last time we have this sort of bug.

Fixes #38002.

Beta-nominating because regression.

r? @eddyb
2016-11-26 21:49:41 -06:00
Ariel Ben-Yehuda
fcebf3beab don't double-apply variant padding to const enums
Fixes #38002.
2016-11-27 02:57:55 +02:00
bors
f8614c3973 Auto merge of #36340 - sfackler:slice-get-slice, r=alexcrichton
Implement RFC 1679

cc #35729

r? @alexcrichton
2016-11-26 18:47:06 -06:00
bors
9a8657925b Auto merge of #38004 - GuillaumeGomez:tcp_stream_doc, r=frewsxcv
Add missing urls and examples to TcpStream

r? @frewsxcv
2016-11-26 15:37:34 -06:00
bors
9003e1ab6a Auto merge of #38008 - bluss:rustbuild-benches, r=alexcrichton
Add rustbuild command `bench`

Add command bench to rustbuild, so that `./x.py bench <path>` can compile and run benchmarks.

`./x.py bench --stage 1 src/libcollections` and `./x.py bench --stage 1 src/libstd` should both compile well. Just `./x.py bench` runs all benchmarks for the libstd crates.

Fixes #37897
2016-11-26 12:32:19 -06:00
Andrew Lygin
984c039e4e Fix error explanation formatting 2016-11-26 21:20:20 +03:00
Andrew Lygin
9fb81b92f9 Fix error explanation formatting 2016-11-26 21:20:20 +03:00
Steven Fackler
5377b5e9c4 Overload get{,_mut}{,_unchecked} 2016-11-26 10:07:39 -08:00
bors
7e39c0ede5 Auto merge of #38015 - sanxiyn:rollup, r=sanxiyn
Rollup of 7 pull requests

- Successful merges: #37962, #37963, #37967, #37978, #37985, #38001, #38010
- Failed merges:
2016-11-26 07:40:43 -06:00
Seo Sanghyeon
44b926a6bb Rollup merge of #38010 - frewsxcv:lock-creations, r=GuillaumeGomez
Document how lock 'guard' structures are created.
2016-11-26 22:02:15 +09:00
Seo Sanghyeon
f9f92e12c7 Rollup merge of #38001 - vickenty:patch-1, r=steveklabnik
Follow our own recommendations in the examples

Remove exclamation marks from the the example error descriptions:
> The description [...] should not contain newlines or sentence-ending punctuation
2016-11-26 22:02:14 +09:00
Seo Sanghyeon
18f4006e09 Rollup merge of #37985 - frewsxcv:completed-fixme, r=petrochenkov
Remove completed FIXME.

https://github.com/rust-lang/rust/issues/30530
2016-11-26 22:02:14 +09:00
Seo Sanghyeon
eeac361f52 Rollup merge of #37978 - fkjogu:master, r=sfackler
Define `bound` argument in std::sync::mpsc::sync_channel in the documentation

The `bound` argument in `std::sync::mpsc::sync:channel(bound: usize)` was not defined in the documentation.
2016-11-26 22:02:14 +09:00
Seo Sanghyeon
6ffcdff06c Rollup merge of #37967 - sfackler:enumset-issue, r=sfackler
Add a tracking issue for enum_set

I totally forgot this even existed!
2016-11-26 22:02:14 +09:00
Seo Sanghyeon
5aceedf4d8 Rollup merge of #37963 - bluss:iterator-docs, r=alexcrichton
Fix two small issues in iterator docs

- `collect()` is a regular method, not an adaptor (does not return an Iterator). I just randomly picked `filter` as a third common adaptor to mention instead.
- Fix example in `Map`'s docs so that it uses the DoubleEndedIterator implementation
2016-11-26 22:02:14 +09:00
Seo Sanghyeon
a809749fdf Rollup merge of #37962 - GuillaumeGomez:socket-v6, r=frewsxcv
Add missing examples to SocketAddrV6

r? @steveklabnik

cc @frewsxcv
2016-11-26 22:02:13 +09:00
bors
73e98a0210 Auto merge of #37961 - samestep:radices, r=frewsxcv
Use "radices" instead of "radicum"

The correct plural of "radix" is "radices" or "radixes", not "radicum".
2016-11-25 23:31:42 -06:00
bors
d64b703065 Auto merge of #37960 - samestep:five, r=frewsxcv
Use literal 5 instead of five in book section 4.1

The other two code snippets in this sentence are valid code, so it makes more sense to use the literal `5` rather than the invalid symbol `five`.
2016-11-25 20:19:47 -06:00
Corey Farwell
6075af4ac0 Document how the MutexGuard structure is created.
Also, end sentence with a period.
2016-11-25 19:08:26 -05:00
Corey Farwell
6b4de8bf91 Document how the RwLockWriteGuard structure is created. 2016-11-25 18:57:11 -05:00
Corey Farwell
276d91d8cb Document how the RwLockReadGuard structure is created. 2016-11-25 18:57:09 -05:00
Ulrik Sverdrup
17cb7bdd83 rustbuild: Add bench = false to std shim crates 2016-11-26 00:26:44 +01:00
bors
2217bd771c Auto merge of #38000 - rkruppe:llvm-dinamespace-fwdcompat, r=alexcrichton
[LLVM 4.0] Pass new argument ExportSymbol to DIBuilder::createNameSpace

cc #37609
2016-11-25 16:57:37 -06:00
Guillaume Gomez
56529cd286 Add missing urls and examples to TcpStream 2016-11-25 23:45:43 +01:00
Ulrik Sverdrup
42e66344b5 rustbuild: Point to core and collections's external benchmarks. 2016-11-25 23:10:43 +01:00
Ulrik Sverdrup
b1566baa0b rustbuild: Add bench subcommand
Add command `./x.py bench`; use `./x.py bench --help -v` to list all
available benchmark targets.
2016-11-25 22:15:52 +01:00
bors
dad5cdea2a Auto merge of #37987 - plietar:cross-proc-macro, r=jseyfried
Delay error reporting of filename mismatch.

When cross compiling with procedural macros, the crate loader starts by
looking for a target crate, before trying with a host crate.

Rather than emitting an error immediately if the host and target
extension differ, the compiler should delay it until both attempts have
failed.

Fixes #37899
2016-11-25 13:48:08 -06:00
Vickenty Fesunov
a3ce39898c Follow our own recommendations in the examples
Remove exclamation marks from the the example error descriptions:
> The description [...] should not contain newlines or sentence-ending punctuation
2016-11-25 17:59:04 +01:00
Robin Kruppe
2e6d49de07 Pass new argument ExportSymbol to DIBuilder::createNameSpace 2016-11-25 17:23:25 +01:00
bors
ebc0373909 Auto merge of #37982 - rkruppe:llvm-diagnostic-fwdcompat, r=alexcrichton
[LLVM 4.0] OptimizationDiagnostic FFI forward compatibility

- getMsg() changed to return std::string by-value. Fix: copy the data to a rust String during unpacking.
- getPassName() changed to return StringRef

cc #37609
2016-11-25 09:01:33 -06:00
bors
c78cc52afd Auto merge of #37979 - nnethercote:Ty-super_fold_with, r=eddyb
Avoid more unnecessary mk_ty calls in Ty::super_fold_with.

This speeds up several rustc-benchmarks by 1--5%.

This PR is the lovechild of #37108 and #37705.
```
futures-rs-test  4.059s vs  4.011s --> 1.012x faster (variance: 1.016x, 1.026x)
helloworld       0.236s vs  0.239s --> 0.986x faster (variance: 1.051x, 1.014x)
html5ever-2016-  3.831s vs  3.824s --> 1.002x faster (variance: 1.020x, 1.019x)
hyper.0.5.0      4.928s vs  4.936s --> 0.998x faster (variance: 1.003x, 1.012x)
inflate-0.1.0    4.135s vs  4.104s --> 1.007x faster (variance: 1.026x, 1.028x)
issue-32062-equ  0.309s vs  0.303s --> 1.017x faster (variance: 1.019x, 1.084x)
issue-32278-big  1.818s vs  1.797s --> 1.011x faster (variance: 1.011x, 1.008x)
jld-day15-parse  1.304s vs  1.271s --> 1.026x faster (variance: 1.018x, 1.012x)
piston-image-0. 10.938s vs 10.921s --> 1.002x faster (variance: 1.025x, 1.016x)
reddit-stress    2.327s vs  2.208s --> 1.054x faster (variance: 1.016x, 1.006x)
regex-0.1.80     8.796s vs  8.727s --> 1.008x faster (variance: 1.012x, 1.019x)
regex.0.1.30     2.294s vs  2.249s --> 1.020x faster (variance: 1.013x, 1.026x)
rust-encoding-0  1.914s vs  1.886s --> 1.015x faster (variance: 1.027x, 1.026x)
```
2016-11-25 00:22:49 -06:00
bors
2e7176f98b Auto merge of #37974 - japaric:abort, r=alexcrichton
std: make compilation of libpanic_unwind optional via a Cargo feature

with this feature disabled, you can (Cargo) compile std with
"panic=abort"

rustbuild will build std with this feature enabled, to maintain the
status quo

fixes #37252

r? @alexcrichton
2016-11-24 19:03:07 -06:00
Paul Lietar
2cdde5aef4 Delay error reporting of filename mismatch.
When cross compiling with procedural macros, the crate loader starts by
looking for a target crate, before trying with a host crate.

Rather than emitting an error immediately if the host and target
extension differ, the compiler should delay it until both attempts have
failed.

Fixes #37899

r? @jseyfried
2016-11-24 22:26:35 +00:00
bors
d9bdc636da Auto merge of #37951 - jseyfried:improve_macro_resolution_perf, r=nrc
macros: improve resolution performance

Avoid quadratic legacy macro name resolution in more cases.
r? @nrc
2016-11-24 15:31:47 -06:00
Corey Farwell
e1269ff688 Remove completed FIXME.
https://github.com/rust-lang/rust/issues/30530
2016-11-24 16:26:21 -05:00
bors
a31ad75bde Auto merge of #37944 - bluss:adaptors-are-empty, r=alexcrichton
Forward ExactSizeIterator::len and is_empty for important iterator adaptors

Forward ExactSizeIterator::len and is_empty for important iterator adaptors

Because some iterators will provide improved version of len and/or is_empty,
adaptors should forward to those implementations if possible.
2016-11-24 11:56:11 -06:00
Robin Kruppe
730400167a Support LLVM 4.0 in OptimizationDiagnostic FFI
- getMsg() changed to return std::string by-value. Fix: copy the data to a rust String during unpacking.
- getPassName() changed to return StringRef
2016-11-24 17:33:47 +01:00
bors
ddf011d773 Auto merge of #37770 - pnkfelix:print-type-sizes, r=arielb1
Add debug flag `-Z print-type-sizes` for instrumention type/variant sizes

Add debug flag `-Z print-type-sizes` for instrumention type/variant sizes

This is meant to help with things like #36799 in a very local way; namely, once you have a hypothesis as to which types have a large population or are "too large", you can use `-Z print-type-sizes` to learn how large each type is, and how much each variant in an enum contributes to the size of that overall enum.
2016-11-24 08:26:36 -06:00
Nicholas Nethercote
4d0618ee30 Avoid more unnecessary mk_ty calls in Ty::super_fold_with.
This speeds up several rustc-benchmarks by 1--5%.
2016-11-24 21:11:05 +11:00
bors
217f57c0b5 Auto merge of #37943 - bluss:exact-is-empty, r=alexcrichton
Implement better .is_empty() for slice and vec iterators

These iterators can use a pointer comparison instead of computing the length.
2016-11-24 03:37:44 -06:00
Felix S. Klock II
75825fe1df Tests of -Z print-type-sizes functionality.
Note that the tests have been updated to initialize the local
variables; originally it was enough just to declare them.

Back when I started this, the `layout_cache` contained entries even
just for types that had been declared but not initialized. Apparently
things have changed in the interim so that if I want one of those
layouts to be computed, I need to actually initialize the value.

(Incidentally, this shows a weakness in the strategy of just walking
the `layout_cache`; the original strategy of using a MIR visitor would
probably have exhibited more robustness in terms of consistent output,
but it had other weaknesses so I chose not to reimplement it. At
least, not yet.)

----

Also, I have updated tests to avoid target-specific alignments.
2016-11-24 10:30:18 +01:00
Felix S. Klock II
70e5ca2ab4 Revisions from review comments, squashed.
Biggest change: Revised print-type-sizes output to include breakdown
of layout.

Includes info about field sizes (and alignment + padding when padding
is injected; the injected padding is derived from the offsets computed
by layout module).

Output format is illustrated in commit that has the ui tests.

Note: there exists (at least) one case of variant w/o name: empty
enums.  Namely, empty enums use anonymous univariant repr. So for such
cases, print the number of the variant instead of the name.

----

Also, eddyb suggested of reading from `layout_cache` post-trans.

(For casual readers: the compiler source often uses the word "cache"
for tables that are in fact not periodically purged, and thus are
useful as the basis for data like this.)

Some types that were previously not printed are now included in the
output. (See e.g. the tests `print_type_sizes/generics.rs` and
`print_type_sizes/variants.rs`)

----

Other review feedback:

switch to an exhaustive match when filtering in just structural types.
switch to hashset for layout info and move sort into print method.

----

Driveby change: Factored session::code_stats into its own module

----

incorporate njn feedback re output formatting.
2016-11-24 10:30:18 +01:00
Felix S. Klock II
9383fcf07f Add -Z print-type-sizes, a tool for digging into how variants are laid out. 2016-11-24 10:30:18 +01:00
fkjogu
a3e03e42e1 Define bound argument in std::sync::mpsc::sync_channel
The `bound` argument in `std::sync::mpsc::sync:channel(bound: usize)` was not defined in the documentation.
2016-11-24 09:49:30 +01:00
bors
29abe6f9e8 Auto merge of #37890 - eddyb:rustdoc-1, r=nrc
rustdoc: separate test collection from the main "clean"-ing pipeline.

While reusing the documentation "clean"-ing infrastructure for collecting code examples to test may have seemed appealing at some point, doing the same through a HIR visitor is barely any harder.
At the same time, supporting both "regular documentation" and "test collection" modes in `rustdoc::clean` has its cost, requiring any use of a `TyCtxt` to be speculative, and provide some sort of fallback.

This simplification is the first step towards bringing rustdoc closer to the compiler, and perhaps even unifying the "local crate" (based on the HIR AST) and "inlinined across crates" (based on crate metadata and typesystem information) implementations of rustdoc.

Sadly, not all possible changes to rustdoc will be uncontroversial, so I'm starting small with this patch.
2016-11-24 00:26:44 -06:00