Commit Graph

59095 Commits

Author SHA1 Message Date
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
Nick Cameron
5787643800 save-analysis: redirect a module decl to the start of the defining file 2016-11-25 16:50:47 +13: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
Vadim Petrochenkov
7d15250b0e Support ?Sized in where clauses 2016-11-25 00:43:00 +03: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
Esteban Küber
b7982bbbe0 review comments 2016-11-23 23:44:17 -08: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
bors
696fab844a Auto merge of #37849 - xen0n:compiler-rt-bump, r=alexcrichton
Update compiler-rt to fix MIPS64 infinite recursion

Fixes #37823.

Test fixes are coming in a separate PR later.

r? @alexcrichton
2016-11-23 21:03:47 -06:00
Jorge Aparicio
ba07a1b58d 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
2016-11-23 21:49:54 -05:00
bors
1e45b63052 Auto merge of #37931 - eddyb:meta-version, r=jseyfried
rustc_metadata: don't break the version check when CrateRoot changes.

In #36551 I made `rustc_version` a field of `CrateRoot`, but despite it being the first field, one could still break the version check by changing `CrateRoot` so older compilers couldn't fully decode it (e.g. #37463).

This PR fixes #37803 by moving the version string back at the beginning of metadata, right after the 32-bit big-endian absolute position of `CrateRoot`, and by incrementing `METADATA_VERSION`.
2016-11-23 17:48:44 -06:00
Eduard-Mihai Burtescu
4be7786330 rustdoc: we can now assume DocContext always has a TyCtxt. 2016-11-24 01:40:56 +02:00
Eduard-Mihai Burtescu
e68ad42dfa rustdoc: sidestep the main pipeline for test collection. 2016-11-24 01:40:56 +02:00
Eduard-Mihai Burtescu
12c5f8cb75 rustdoc: use libsyntax ast::Attribute instead of "cleaning" them. 2016-11-24 01:40:52 +02:00
bors
d5814b03e6 Auto merge of #37908 - nrc:save-def, r=eddyb
save-analysis: fix ICE on partially resolved path

Occurs when we produce save-analysis before type checking is complete (due to errors).
2016-11-23 14:31:45 -06:00
Steven Fackler
8560991cb0 Add a tracking issue for enum_set 2016-11-23 10:55:44 -08:00
Nick Cameron
b1f86fb7c3 Inspect def locally instead of using a method 2016-11-24 07:50:22 +13:00
bors
d515586465 Auto merge of #36449 - canndrew:expand_is_uninhabited, r=eddyb
Expand is_uninhabited

This allows code such as this to compile:

``` rust
let x: ! = ...;
match x {};

let y: (u32, !) = ...;
match y {};
```

@eddyb You were worried about making this change. Do you have any idea about what could break? Are there any special tests that need to be written for it?
2016-11-23 11:16:22 -06:00
Guillaume Gomez
559141c827 Add missing examples to SocketAddrV6 2016-11-23 17:14:41 +01:00