Commit graph

67584 commits

Author SHA1 Message Date
Corey Farwell
27b1097ba0 Rollup merge of #44476 - integer32llc:update-label-explanation, r=Mark-Simulacrum
Update label explanations

Some of the newer labels weren't covered in CONTRIBUTING.md :)

r? @Mark-Simulacrum
2017-09-14 22:32:41 -04:00
Corey Farwell
65b9b56463 Rollup merge of #44472 - smt923:master, r=frewsxcv
Add short doc examples for str::from_utf8_mut

Fixes #44462
2017-09-14 22:32:40 -04:00
Corey Farwell
b4f6fba1d9 Rollup merge of #44453 - tommyip:doc_string_as_mut_str, r=frewsxcv
Add doc example to String::as_mut_str

Fixes #44429.
2017-09-14 22:32:38 -04:00
Corey Farwell
1e2d6a804e Rollup merge of #44450 - SergioBenitez:master, r=nrc
Add `impl From<Vec<Span>> for MultiSpan`.

A simple `impl`.

r? @nrc
2017-09-14 22:32:37 -04:00
Corey Farwell
5255ab7e2a Rollup merge of #44430 - steveklabnik:update-mdbook, r=alexcrichton
update mdbook

This eliminates some warnings

r? @alexcrichton
2017-09-14 22:32:37 -04:00
Corey Farwell
eb45c0ac7f Rollup merge of #44388 - tbu-:pr_doc_udp_connect_multiple, r=frewsxcv
Clarify the behavior of UDP sockets wrt. multiple addresses in `connect`

CC @frewsxcv #22569 #44209
2017-09-14 22:32:36 -04:00
Corey Farwell
64690fe92e Rollup merge of #44378 - frehberg:rustdoc, r=dtolnay
rustdoc: extend UdpSocket API doc (#657)

see  https://github.com/carllerche/mio/issues/657
2017-09-14 22:32:35 -04:00
Corey Farwell
3ef792a035 Rollup merge of #44374 - jsheard:threadname, r=alexcrichton
Implement named threads on Windows (v2)

https://msdn.microsoft.com/en-us/library/windows/desktop/mt774976(v=vs.85).aspx

Windows 10 version 1607 finally added a sensible API for naming threads, so we can now implement named threads without having to use MSVC compiler extensions like before. VS2017s debugger and the WPA profiler already use this API where available, but other tools may need some time to catch up.

![thread](https://user-images.githubusercontent.com/3153547/30133438-c92a3cda-934b-11e7-9668-915d53e8d860.png)
2017-09-14 22:32:34 -04:00
Corey Farwell
9761a8dc14 Rollup merge of #44368 - ollie27:rustdoc_pulldown_ids, r=QuietMisdreavus
rustdoc: Don't counts ids twice when using --enable-commonmark

cc @GuillaumeGomez
r? @QuietMisdreavus
2017-09-14 22:32:33 -04:00
Corey Farwell
4e646ba713 Rollup merge of #44254 - GuillaumeGomez:const-fix-rustdoc, r=QuietMisdreavus
Fix rendering of const keyword for functions

Fixes #44187.

r? @QuietMisdreavus
2017-09-14 22:32:32 -04:00
Corey Farwell
76799d1ea3 Rollup merge of #44131 - smaeul:openssl-perl, r=Mark-Simulacrum
Explicitly run perl for OpenSSL Configure

OpenSSL's Configure script is missing a shebang. On some platforms,
execve falls back to execution with the shell. Some other platforms,
like musl, will fail with an exec format error. Avoid this by calling
perl explicitly (since it's a perl script).
2017-09-14 22:32:31 -04:00
bors
2d288a5ae5 Auto merge of #44502 - alexcrichton:remove-session-dep-graph, r=michaelwoerister
rustc: Remove `Session::dep_graph`

This commit removes the `dep_graph` field from the `Session` type according to
issue #44390. Most of the fallout here was relatively straightforward and the
`prepare_session_directory` function was rejiggered a bit to reuse the results
in the later-called `load_dep_graph` function.

Closes #44390
2017-09-14 19:37:11 +00:00
Alex Crichton
1cf956f2ba rustc: Remove Session::dep_graph
This commit removes the `dep_graph` field from the `Session` type according to
issue #44390. Most of the fallout here was relatively straightforward and the
`prepare_session_directory` function was rejiggered a bit to reuse the results
in the later-called `load_dep_graph` function.

Closes #44390
2017-09-14 10:40:50 -07:00
Joshua Sheard
597ac36547 Merge branch 'master' into threadname 2017-09-14 14:19:53 +01:00
bors
5dfc84cfa7 Auto merge of #44480 - Zoxc:gen-liveness, r=arielb1
Analyse storage liveness and preserve it during generator transformation

This uses a dataflow analysis on `StorageLive` and `StorageDead` statements to infer where the storage of locals are live. The result of this analysis is intersected with the regular liveness analysis such that a local is can only be live when its storage is. This fixes https://github.com/rust-lang/rust/issues/44184. If the storage of a local is live across a suspension point, we'll insert a `StorageLive` statement for it after the suspension point so storage liveness is preserved. This fixes https://github.com/rust-lang/rust/issues/44179.

r? @arielb1
2017-09-14 12:28:31 +00:00
bors
2b6bc588ca Auto merge of #44526 - leodasvacas:remove-deprecated-lang-items, r=arielb1
Remove deprecated lang items

They have been deprecated for years and there is no trace left of them in the compiler. Also removed `require_owned_box` which is dead code and other small refactorings.
2017-09-14 09:18:28 +00:00
bors
84bbd14e3f Auto merge of #43972 - TobiasSchaffner:std_clean, r=alexcrichton
Add the libstd-modifications needed for the L4Re target

This commit adds the needed modifications to compile the std crate for the L4 Runtime environment (L4Re).

A target for the L4Re was introduced in commit: c151220a84

In many aspects implementations for linux also apply for the L4Re microkernel.

Some uncommon characteristics had to be resolved:
 * L4Re has no network funktionality
 * L4Re has a maximum stacksize of 1Mb for threads
 * L4Re has no uid or gid

Co-authored-by: Sebastian Humenda <sebastian.humenda@tu-dresden.de>
2017-09-14 03:02:58 +00:00
bors
d1ca653b17 Auto merge of #44484 - tirr-c:issue-44332, r=petrochenkov
Parse nested closure with two consecutive parameter lists properly

This is a followup of #44332.

---

Currently, in nightly, this does not compile:

```rust
fn main() {
    let f = |_||x, y| x+y;
    println!("{}", f(())(1, 2)); // should print 3
}
```

`|_||x, y| x+y` should be parsed as `|_| (|x, y| x+y)`, but the parser didn't accept `||` between `_` and `x`. This patch fixes the problem.

r? @petrochenkov
2017-09-14 00:28:27 +00:00
John Kåre Alsaker
0e8e6592f6 Fix a bug where StorageIgnored had an incorrect buffer length 2017-09-13 23:28:11 +02:00
John Kåre Alsaker
a2b3e0889f Fix nits and refactor creation of StorageLive blocks 2017-09-13 23:28:11 +02:00
John Kåre Alsaker
d97a7d2594 Make sure we aren't using dead locals 2017-09-13 23:28:11 +02:00
John Kåre Alsaker
efc7d46188 Analyse storage liveness and preserve it during generator transformation 2017-09-13 23:28:10 +02:00
bors
94211416bc Auto merge of #44516 - gaurikholkar:fns, r=arielb1
Extend E0623 for fn items

This fixes #44516
The below example now gives
```
error[E0623]: lifetime mismatch
 --> gg.rs:3:10
  |
2 | fn foo(x:fn(&u8, &u8), y: Vec<&u8>, z: &u8) {
  |                               ---      --- these two types are declared with different lifetimes...
3 |   y.push(z);
  |          ^ ...but data from `z` flows into `y` here

error: aborting due to previous error
```

r? @nikomatsakis
cc @arielb1
2017-09-13 21:20:19 +00:00
leonardo.yvens
9218e44434 Fix initial review 2017-09-13 14:21:16 -03:00
gaurikholkar
e71eef1775 fix ui tests 2017-09-13 20:56:27 +05:30
leonardo.yvens
c2fb70be6b Refactor fn_trait_kind
Short and sweet
2017-09-13 12:19:37 -03:00
leonardo.yvens
ab30b6a6ed Refactor how to get a lang item's name
Small refactorings
2017-09-13 12:00:40 -03:00
leonardo.yvens
74107f987b Remove require_owned_box
It's unused and unnecessary
2017-09-13 11:16:45 -03:00
bors
539f2083de Auto merge of #44129 - pnkfelix:fix-end-region-emission-order, r=nmatsakis
Fix end region emission order

Fix #43481
2017-09-13 13:01:42 +00:00
Felix S. Klock II
5fa0b661e0 Test case illustrating some destruction code extent stuff. 2017-09-13 12:55:03 +02:00
Felix S. Klock II
88080bd56a Unit test for proper EndRegion emission on a cyclic reference. 2017-09-13 12:55:03 +02:00
Felix S. Klock II
ab46142bd9 Update mir-opt tests to reflect change to EndRegion emission order.
Driveby fix to end_region_9.rs; it was missing END marker and was
therefore always passing (regardless of output correctness).
2017-09-13 12:55:03 +02:00
Felix S. Klock II
25aa86da17 Fix issue #43481: emit the EndRegion *before* StorageDeads for a scope.
(The idea is that the StorageDead marks the point where the memory can
be deallocated, and the EndRegion is marking where borrows of that
memory can no longer legally exist.)
2017-09-13 12:55:03 +02:00
bors
824952f48b Auto merge of #44386 - est31:master, r=pnkfelix
Fix mispositioned error indicators

Fixes #38384

Most of the Rust community uses 4 spaces for indentation,
but there are also tab users of Rust (including myself!).

This patch fixes a bug in error printing which mispositions
error indicators when near code with tabs.

The code attempted to fix the issue by replacing spaces
with tabs, but it sadly wasn't enough, as sometimes
you may not print spaces but _ or ^ instead.

This patch employs the reverse strategy: it replaces each
tab with a space, so that the number of _ and ^ and spaces
in error indicators below the code snippet line up
perfectly.

In a study [1] preceeding this patch, we could see that
this strategy is also chosen by gcc version 6.3.0.

Its not perfect, as the output is not beautiful, but its
the easiest to implement. If anyone wants to improve on
this, be my guest! This patch is meant as improvement of
the status quo, not as perfect end status. It fixes the
actual issue of mispositioning error indicators.

[1]: https://github.com/rust-lang/rust/issues/38384#issuecomment-326813710
2017-09-13 10:28:33 +00:00
Tobias Schaffner
b2b5063517 Move default stack min size to thread implementations
The default min stack size value is smaller on l4re and therefore
this value has to be different depending on the platform.
2017-09-13 10:56:41 +02:00
bors
c3eccc694c Auto merge of #44420 - alexcrichton:private-cstore, r=michaelwoerister
rustc: Make `CrateStore` private to `TyCtxt`

This commit makes the `CrateStore` object private to the `ty/context.rs` module and also absent on the `Session` itself.

cc #44390
cc #44341 (initial commit pulled and rebased from here)
2017-09-13 05:32:00 +00:00
Alex Crichton
921750b8ac rustc: Make CrateStore private to TyCtxt
This commit removes the `cstore_untracked` method, making the `CrateStore` trait
object entirely private to the `ty/context.rs` module.
2017-09-12 21:14:06 -07:00
bors
7eefed392f Auto merge of #44456 - eddyb:stable-drop-const, r=nikomatsakis
Stabilize drop_types_in_const.

Closes #33156, stabilizing the new, revised, rules, and improving the error message.

r? @nikomatsakis cc @SergioBenitez
2017-09-13 03:04:49 +00:00
bors
2fdccaffe6 Auto merge of #44015 - kennytm:hasher, r=alexcrichton
impl Hasher for {&mut Hasher, Box<Hasher>}

**Rationale:** The `Hash` trait has `fn hash<H: Hasher>(&self, state: &mut H)`, which can only accept a `Sized` hasher, even if the `Hasher` trait is object-safe. We cannot retroactively add the `?Sized` bound without breaking stability, thus implementing `Hasher` to a trait object reference is the next best solution.

**Warning:** These `impl` are insta-stable, and should need an FCP. I don't think a full RFC is necessary.
2017-09-12 21:39:08 +00:00
leonardo.yvens
4738231cc7 Remove deprecated lang items
They have been deprecated for years and there is no trace left of them
in the compiler.
2017-09-12 17:04:26 -03:00
Guillaume Gomez
742ff5a489 Fix rendering of const keyword for functions 2017-09-12 21:55:24 +02:00
bors
dd08c30703 Auto merge of #44133 - vorner:allocator-kind-autodetect, r=alexcrichton
Autodetect the type of allocator crate used

Annotate the allocator crates (allocator_system, allocator_jemalloc) by the type of allocator they are. If one is requested as an exe allocator, detect its type by the flags.

This has the effect that using this (de jure wrong) configuration in the target spec works instead of producing a really unhelpful and arcane linker error:

"exe-allocation-crate": "alloc_system"

Fixes #43524.

There are two yet unsolved FIXME's, I'll be glad for some advice on what to do with them.
2017-09-12 18:12:21 +00:00
Michael Woerister
54fa047d92 Remove the cstore reference from Session in order to prepare encapsulating CrateStore access in tcx. 2017-09-12 07:19:06 -07:00
gaurikholkar
6e3cdcea4c Adding changes for trait objects 2017-09-12 18:22:22 +05:30
bors
a7b7dce02d Auto merge of #44413 - est31:move_man, r=nikomatsakis
Move the man directory to a subdirectory

There is no reason it should be in the top directory.
2017-09-12 12:41:23 +00:00
gaurikholkar
93529b40ca add ui test for fn items, tidy fixes 2017-09-12 16:48:18 +05:30
bors
817e1b81e2 Auto merge of #44344 - jonhoo:entry_or_default, r=BurntSushi
Add or_default to Entry APIs

As argued for in #44324, this PR adds a new `or_default` method to the various `Entry` APIs (currently just for `BTreeMap` and `HashMap`) when `V: Default`. This method is effectively a shorthand for `or_insert_with(Default::default)`.
2017-09-12 09:54:59 +00:00
kennytm
143e2dcd5c
Disable the new Hasher tests on Emscripten. 2017-09-12 17:28:07 +08:00
kennytm
0bbe468271
impl Hasher for {&mut Hasher, Box<Hasher>} 2017-09-12 17:28:07 +08:00
bors
8fc0fc8c2d Auto merge of #44310 - ldr709:master, r=BurntSushi
Additional traits for std::mem::ManuallyDrop

The first commit adds `Clone` and `Copy` trait implementations for `ManuallyDrop`. Although `Drop` and `Copy` cannot be used together, this may be useful for generics.

The second commit adds implementations common traits. I do not think this is necessary, as they could be implemented in a wrapper type outside the standard library, but it would make `ManuallyDrop` more convenient to use.
2017-09-12 07:13:40 +00:00