]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoRollup merge of #44542 - alexcrichton:fix-windows-emscripten, r=nikomatsakis
Alex Crichton [Sat, 16 Sep 2017 14:16:51 +0000 (09:16 -0500)]
Rollup merge of #44542 - alexcrichton:fix-windows-emscripten, r=nikomatsakis

rustc: Spawn `cmd /c emcc.bat` explicitly

In #42436 the behavior for spawning processes on Windows was tweaked slightly to
fix various bugs, but this caused #42791 as a regression, namely that to spawn
batch scripts they need to be manually spawned with `cmd /c` instead now. This
updates the compiler to handle this case explicitly for Emscripten.

Closes #42791

6 years agoRollup merge of #44531 - QuietMisdreavus:bump-gcc, r=alexcrichton
Alex Crichton [Sat, 16 Sep 2017 14:16:49 +0000 (09:16 -0500)]
Rollup merge of #44531 - QuietMisdreavus:bump-gcc, r=alexcrichton

bump gcc for bootstrap

On Windows, the gcc crate would send /Wall to msvc, which would cause
builds to get flooded with warnings, exploding compile times from one
hour to more than 72! The gcc crate version 0.3.54 changes this behavior
to send /W4 instead, which greatly cuts down on cl.exe flooding the
command prompt window with warnings.

6 years agoRollup merge of #44395 - jcdyer:ip-constructors, r=alexcrichton
Alex Crichton [Sat, 16 Sep 2017 14:16:48 +0000 (09:16 -0500)]
Rollup merge of #44395 - jcdyer:ip-constructors, r=alexcrichton

Ipv4Addr and Ipv6Addr convenience constructors.

Introduce convenience constructors for common types.

This introduces the following constructors:

* Ipv6Addr::localhost()
* Ipv6Addr::unspecified()
* Ipv4Addr::localhost()
* Ipv4Addr::unspecified()

The recently added `From` implementations were nice for avoiding the fallibility of conversions from strings like `"127.0.0.1".parse().unwrap()`, and `"::1".parse().unwrap()`, but while the Ipv4 version is roughly comparable in verbosity, the Ipv6 version lacks zero-segment elision, which makes it significantly more awkward: `[0, 0, 0, 0, 0, 0, 0, 0].into()`.  While there isn't a clear way to introduce zero elision to type that can infallibly be converted into Ipv6 addresses, this PR resolves the problem for the two most commonly used addresses, which, incidentally, are the ones that suffer the most from the lack of zero-segment elision.

This change is dead simple, and introduces no backwards incompatibility.

See also, [this topic on the inernals board](https://internals.rust-lang.org/t/pre-rfc-convenience-ip-address-constructors/5878)

6 years agoRollup merge of #44356 - nrc:rls-component-manifest, r=@alexcrichton
Alex Crichton [Sat, 16 Sep 2017 14:16:47 +0000 (09:16 -0500)]
Rollup merge of #44356 - nrc:rls-component-manifest, r=@alexcrichton

Attempt to fix the component manifest problem for rls-preview

cc #44270

See #44270

6 years agoRollup merge of #44273 - bluss:rc-downcast, r=alexcrichton
Alex Crichton [Sat, 16 Sep 2017 14:16:46 +0000 (09:16 -0500)]
Rollup merge of #44273 - bluss:rc-downcast, r=alexcrichton

Implement <Rc<Any>>::downcast

* Implement `<Rc<Any>>::downcast::<T>`
  * New unstable method. Works just like Box\<Any\>, but for Rc.
  * Any has two cases for its methods: Any and Any + Send; Rc is never Send, so that case is skipped for Rc.
  * Motivation for being a method with self is to match Box and there is no user-supplied type; the inner type is Any and downcast does not conflict with any method of Any.
* Arc was skipped because Any itself has no downcast for the case that makes most sense: Any + Send + Sync

6 years agoAuto merge of #43964 - Gankro:unsafe-reform, r=sfackler
bors [Sat, 16 Sep 2017 19:54:58 +0000 (19:54 +0000)]
Auto merge of #43964 - Gankro:unsafe-reform, r=sfackler

implement unsafe pointer methods

I also cleaned up some existing documentation a bit here or there since I was doing so much auditing of it. Most notably I significantly rewrote the `offset` docs to clarify safety (`*const` and `*mut`'s offset docs had actually diverged).

6 years agoAuto merge of #43017 - durka:stabilize-const-invocation, r=eddyb
bors [Sat, 16 Sep 2017 17:02:17 +0000 (17:02 +0000)]
Auto merge of #43017 - durka:stabilize-const-invocation, r=eddyb

Individualize feature gates for const fn invocation

This PR changes the meaning of `#![feature(const_fn)]` so it is only required to declare a const fn but not to call one. Based on discussion at #24111. I was hoping we could have an FCP here in order to move that conversation forward.

This sets the stage for future stabilization of the constness of several functions in the standard library (listed below), so could someone please tag the lang team for review.

- `std::cell`
    - `Cell::new`
    - `RefCell::new`
    - `UnsafeCell::new`
- `std::mem`
    - `size_of`
    - `align_of`
- `std::ptr`
    - `null`
    - `null_mut`
- `std::sync`
    - `atomic`
        - `Atomic{Bool,Ptr,Isize,Usize}::new`
    - `once`
        - `Once::new`
- primitives
    - `{integer}::min_value`
    - `{integer}::max_value`

Some other functions are const but they are also unstable or hidden, e.g. `Unique::new` so they don't have to be considered at this time.

After this stabilization, the following `*_INIT` constants in the standard library can be deprecated. I wasn't sure whether to include those deprecations in the current PR.

- `std::sync`
    - `atomic`
        - `ATOMIC_{BOOL,ISIZE,USIZE}_INIT`
    - `once`
        - `ONCE_INIT`

6 years agobump rls
Alex Burka [Wed, 13 Sep 2017 04:18:51 +0000 (04:18 +0000)]
bump rls

6 years agochange #![feature(const_fn)] to specific gates
Alex Burka [Fri, 8 Sep 2017 18:26:54 +0000 (18:26 +0000)]
change #![feature(const_fn)] to specific gates

6 years agoAuto merge of #44605 - alexcrichton:less-rustdoc, r=Mark-Simulacrum
bors [Sat, 16 Sep 2017 09:26:45 +0000 (09:26 +0000)]
Auto merge of #44605 - alexcrichton:less-rustdoc, r=Mark-Simulacrum

rustbuild: Compile the error-index in stage 2

Right now we comiple rustdoc in stage 2 and the error index in stage 0, which
ends up compiling rustdoc twice! To avoid compiling rustdoc twice (which takes
awhile) let's just compile it once in stage 2.

6 years agoAuto merge of #44610 - alexcrichton:osx-no-assertions, r=Mark-Simulacrum
bors [Sat, 16 Sep 2017 04:04:24 +0000 (04:04 +0000)]
Auto merge of #44610 - alexcrichton:osx-no-assertions, r=Mark-Simulacrum

travis: Disable LLVM assertions on OSX

Our OSX builders are routinely and significantly over hour 2 hour "soft limit"
for testing PRs. I *think* that a big portion of this time comes from the fact
that LLVM and debug assertions are enabled. In an effort to speed up these
builders and reduce cycle time this commit disables LLVM assertions on OSX for
all builders.

My thinking is that we'll let this bake for a bit after merged to see what the
effect is on timing on Travis. If it doesn't actually help much we can turn them
back on, and if it doesn't help enough we can disable Rust debug assertions as
well.

6 years agotravis: Disable LLVM assertions on OSX
Alex Crichton [Fri, 15 Sep 2017 17:34:05 +0000 (10:34 -0700)]
travis: Disable LLVM assertions on OSX

Our OSX builders are routinely and significantly over hour 2 hour "soft limit"
for testing PRs. I *think* that a big portion of this time comes from the fact
that LLVM and debug assertions are enabled. In an effort to speed up these
builders and reduce cycle time this commit disables LLVM assertions on OSX for
all builders.

My thinking is that we'll let this bake for a bit after merged to see what the
effect is on timing on Travis. If it doesn't actually help much we can turn them
back on, and if it doesn't help enough we can disable Rust debug assertions as
well.

6 years agoalloc: Add tracking issue for rc_downcast
Ulrik Sverdrup [Fri, 15 Sep 2017 17:16:22 +0000 (19:16 +0200)]
alloc: Add tracking issue for rc_downcast

6 years agorustbuild: Compile the error-index in stage 2
Alex Crichton [Fri, 15 Sep 2017 16:34:17 +0000 (09:34 -0700)]
rustbuild: Compile the error-index in stage 2

Right now we comiple rustdoc in stage 2 and the error index in stage 0, which
ends up compiling rustdoc twice! To avoid compiling rustdoc twice (which takes
awhile) let's just compile it once in stage 2.

6 years agoAuto merge of #43949 - GuillaumeGomez:compile_fail_stable, r=alexcrichton
bors [Fri, 15 Sep 2017 08:05:39 +0000 (08:05 +0000)]
Auto merge of #43949 - GuillaumeGomez:compile_fail_stable, r=alexcrichton

Compile fail stable

Since #30726, we never made the `compile_fail` flag nor the error code check stable. I think it's time to change this fact.

r? @alexcrichton

6 years agoAuto merge of #44585 - frewsxcv:rollup, r=frewsxcv
bors [Fri, 15 Sep 2017 04:22:45 +0000 (04:22 +0000)]
Auto merge of #44585 - frewsxcv:rollup, r=frewsxcv

Rollup of 23 pull requests

- Successful merges: #44131, #44254, #44368, #44374, #44378, #44388, #44430, #44450, #44453, #44472, #44476, #44477, #44485, #44497, #44521, #44534, #44536, #44541, #44552, #44559, #44563, #44569, #44572
- Failed merges:

6 years agoRollup merge of #44572 - frewsxcv:frewsxcv-from-utf16-lossy, r=QuietMisdreavus
Corey Farwell [Fri, 15 Sep 2017 02:32:52 +0000 (22:32 -0400)]
Rollup merge of #44572 - frewsxcv:frewsxcv-from-utf16-lossy, r=QuietMisdreavus

Clarify return type of `String::from_utf16_lossy`.

Fixes https://github.com/rust-lang/rust/issues/32874

6 years agoRollup merge of #44569 - est31:master, r=estebank
Corey Farwell [Fri, 15 Sep 2017 02:32:51 +0000 (22:32 -0400)]
Rollup merge of #44569 - est31:master, r=estebank

"avoid" is a better word here than "disable"

You don't "disable" the warning really, you just avoid it (as a conscious action).

6 years agoRollup merge of #44563 - budziq:stablilize_tcpstream_connect_timeout, r=alexcrichton
Corey Farwell [Fri, 15 Sep 2017 02:32:50 +0000 (22:32 -0400)]
Rollup merge of #44563 - budziq:stablilize_tcpstream_connect_timeout, r=alexcrichton

stabilize tcpstream_connect_timeout (closes #43079)

6 years agoRollup merge of #44559 - frewsxcv:frewsxcv-rm-loop, r=sfackler
Corey Farwell [Fri, 15 Sep 2017 02:32:49 +0000 (22:32 -0400)]
Rollup merge of #44559 - frewsxcv:frewsxcv-rm-loop, r=sfackler

Remove unneeded `loop`.

None

6 years agoRollup merge of #44552 - durka:patch-42, r=alexcrichton
Corey Farwell [Fri, 15 Sep 2017 02:32:48 +0000 (22:32 -0400)]
Rollup merge of #44552 - durka:patch-42, r=alexcrichton

update "since" for discriminant_value

It's [going](https://github.com/rust-lang/rust/pull/44263#issuecomment-329257597) to be backported to beta.

r? @alexcrichton

6 years agoRollup merge of #44541 - GuillaumeGomez:openoptions-docs, r=QuietMisdreavus
Corey Farwell [Fri, 15 Sep 2017 02:32:48 +0000 (22:32 -0400)]
Rollup merge of #44541 - GuillaumeGomez:openoptions-docs, r=QuietMisdreavus

Openoptions docs

r? @QuietMisdreavus

6 years agoRollup merge of #44536 - Havvy:transmute-docs, r=steveklabnik
Corey Farwell [Fri, 15 Sep 2017 02:32:47 +0000 (22:32 -0400)]
Rollup merge of #44536 - Havvy:transmute-docs, r=steveklabnik

Fix example in transmute; add safety requirement to Vec::from_raw_parts

This fixes the second bullet point on #44281 and also removes some incorrect information.

6 years agoRollup merge of #44534 - adlerd:drain_filter_doctest, r=bluss
Corey Farwell [Fri, 15 Sep 2017 02:32:46 +0000 (22:32 -0400)]
Rollup merge of #44534 - adlerd:drain_filter_doctest, r=bluss

Fix drain_filter doctest.

Fixes #44499.

Also change some of the hidden logic in the doctest as a regression test; two bugs in the original would now cause test failure.

6 years agoRollup merge of #44521 - rwakulszowa:str_utf16_doc, r=frewsxcv
Corey Farwell [Fri, 15 Sep 2017 02:32:45 +0000 (22:32 -0400)]
Rollup merge of #44521 - rwakulszowa:str_utf16_doc, r=frewsxcv

Add an example of std::str::encode_utf16

Closes #44419

6 years agoRollup merge of #44497 - tommyip:doc_example, r=frewsxcv
Corey Farwell [Fri, 15 Sep 2017 02:32:44 +0000 (22:32 -0400)]
Rollup merge of #44497 - tommyip:doc_example, r=frewsxcv

Add doc example to str::from_boxed_utf8_unchecked

Fixes #44463.

6 years agoRollup merge of #44485 - 42triangles:master, r=frewsxcv
Corey Farwell [Fri, 15 Sep 2017 02:32:43 +0000 (22:32 -0400)]
Rollup merge of #44485 - 42triangles:master, r=frewsxcv

Added an example for `std::str::into_boxed_bytes()`

This solves issue #44423.

6 years agoRollup merge of #44477 - napen123:master, r=frewsxcv
Corey Farwell [Fri, 15 Sep 2017 02:32:42 +0000 (22:32 -0400)]
Rollup merge of #44477 - napen123:master, r=frewsxcv

Add doc examples to str::from_utf8_unchecked_mut

Fixes #44461

6 years agoRollup merge of #44476 - integer32llc:update-label-explanation, r=Mark-Simulacrum
Corey Farwell [Fri, 15 Sep 2017 02:32:41 +0000 (22:32 -0400)]
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

6 years agoRollup merge of #44472 - smt923:master, r=frewsxcv
Corey Farwell [Fri, 15 Sep 2017 02:32:40 +0000 (22:32 -0400)]
Rollup merge of #44472 - smt923:master, r=frewsxcv

Add short doc examples for str::from_utf8_mut

Fixes #44462

6 years agoRollup merge of #44453 - tommyip:doc_string_as_mut_str, r=frewsxcv
Corey Farwell [Fri, 15 Sep 2017 02:32:38 +0000 (22:32 -0400)]
Rollup merge of #44453 - tommyip:doc_string_as_mut_str, r=frewsxcv

Add doc example to String::as_mut_str

Fixes #44429.

6 years agoRollup merge of #44450 - SergioBenitez:master, r=nrc
Corey Farwell [Fri, 15 Sep 2017 02:32:37 +0000 (22:32 -0400)]
Rollup merge of #44450 - SergioBenitez:master, r=nrc

Add `impl From<Vec<Span>> for MultiSpan`.

A simple `impl`.

r? @nrc

6 years agoRollup merge of #44430 - steveklabnik:update-mdbook, r=alexcrichton
Corey Farwell [Fri, 15 Sep 2017 02:32:37 +0000 (22:32 -0400)]
Rollup merge of #44430 - steveklabnik:update-mdbook, r=alexcrichton

update mdbook

This eliminates some warnings

r? @alexcrichton

6 years agoRollup merge of #44388 - tbu-:pr_doc_udp_connect_multiple, r=frewsxcv
Corey Farwell [Fri, 15 Sep 2017 02:32:36 +0000 (22:32 -0400)]
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

6 years agoRollup merge of #44378 - frehberg:rustdoc, r=dtolnay
Corey Farwell [Fri, 15 Sep 2017 02:32:35 +0000 (22:32 -0400)]
Rollup merge of #44378 - frehberg:rustdoc, r=dtolnay

rustdoc: extend UdpSocket API doc (#657)

see  https://github.com/carllerche/mio/issues/657

6 years agoRollup merge of #44374 - jsheard:threadname, r=alexcrichton
Corey Farwell [Fri, 15 Sep 2017 02:32:34 +0000 (22:32 -0400)]
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)

6 years agoRollup merge of #44368 - ollie27:rustdoc_pulldown_ids, r=QuietMisdreavus
Corey Farwell [Fri, 15 Sep 2017 02:32:33 +0000 (22:32 -0400)]
Rollup merge of #44368 - ollie27:rustdoc_pulldown_ids, r=QuietMisdreavus

rustdoc: Don't counts ids twice when using --enable-commonmark

cc @GuillaumeGomez
r? @QuietMisdreavus

6 years agoRollup merge of #44254 - GuillaumeGomez:const-fix-rustdoc, r=QuietMisdreavus
Corey Farwell [Fri, 15 Sep 2017 02:32:32 +0000 (22:32 -0400)]
Rollup merge of #44254 - GuillaumeGomez:const-fix-rustdoc, r=QuietMisdreavus

Fix rendering of const keyword for functions

Fixes #44187.

r? @QuietMisdreavus

6 years agoRollup merge of #44131 - smaeul:openssl-perl, r=Mark-Simulacrum
Corey Farwell [Fri, 15 Sep 2017 02:32:31 +0000 (22:32 -0400)]
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).

6 years agoAdd unstable attributes for Ipv?Addr constructors.
J. Cliff Dyer [Fri, 15 Sep 2017 01:30:36 +0000 (21:30 -0400)]
Add unstable attributes for Ipv?Addr constructors.

6 years agoClarify return type of `String::from_utf16_lossy`.
Corey Farwell [Thu, 14 Sep 2017 19:34:31 +0000 (15:34 -0400)]
Clarify return type of `String::from_utf16_lossy`.

Fixes https://github.com/rust-lang/rust/issues/32874

6 years agoAuto merge of #44502 - alexcrichton:remove-session-dep-graph, r=michaelwoerister
bors [Thu, 14 Sep 2017 19:37:11 +0000 (19:37 +0000)]
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

6 years agorustc: Remove `Session::dep_graph`
Alex Crichton [Sat, 9 Sep 2017 18:02:18 +0000 (11:02 -0700)]
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

6 years ago"avoid" is a better word here than "disable"
est31 [Thu, 14 Sep 2017 15:22:15 +0000 (17:22 +0200)]
"avoid" is a better word here than "disable"

6 years agostabilize tcpstream_connect_timeout (closes #43079)
Michal Budzynski [Thu, 14 Sep 2017 14:18:49 +0000 (16:18 +0200)]
stabilize tcpstream_connect_timeout (closes #43079)

6 years agoMerge branch 'master' into threadname
Joshua Sheard [Thu, 14 Sep 2017 13:19:53 +0000 (14:19 +0100)]
Merge branch 'master' into threadname

6 years agoAuto merge of #44480 - Zoxc:gen-liveness, r=arielb1
bors [Thu, 14 Sep 2017 12:28:31 +0000 (12:28 +0000)]
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

6 years agoAuto merge of #44526 - leodasvacas:remove-deprecated-lang-items, r=arielb1
bors [Thu, 14 Sep 2017 09:18:28 +0000 (09:18 +0000)]
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.

6 years agoAttempt to fix the component manifest problem for rls-preview
Nick Cameron [Tue, 5 Sep 2017 20:28:15 +0000 (08:28 +1200)]
Attempt to fix the component manifest problem for rls-preview

cc #44270

6 years agoAuto merge of #43972 - TobiasSchaffner:std_clean, r=alexcrichton
bors [Thu, 14 Sep 2017 03:02:58 +0000 (03:02 +0000)]
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: c151220a84e40b65e45308cc0f3bbea4466d3acf

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>
6 years agoRemove unneeded `loop`.
Corey Farwell [Thu, 14 Sep 2017 02:44:14 +0000 (22:44 -0400)]
Remove unneeded `loop`.

6 years agoAuto merge of #44484 - tirr-c:issue-44332, r=petrochenkov
bors [Thu, 14 Sep 2017 00:28:27 +0000 (00:28 +0000)]
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

6 years agoupdate "since" for discriminant_value
Alex Burka [Wed, 13 Sep 2017 21:29:55 +0000 (17:29 -0400)]
update "since" for discriminant_value

It's going to be backported to beta.

6 years agoFix a bug where StorageIgnored had an incorrect buffer length
John Kåre Alsaker [Wed, 13 Sep 2017 21:27:40 +0000 (23:27 +0200)]
Fix a bug where StorageIgnored had an incorrect buffer length

6 years agoFix nits and refactor creation of StorageLive blocks
John Kåre Alsaker [Mon, 11 Sep 2017 16:11:21 +0000 (18:11 +0200)]
Fix nits and refactor creation of StorageLive blocks

6 years agoMake sure we aren't using dead locals
John Kåre Alsaker [Mon, 11 Sep 2017 10:15:35 +0000 (12:15 +0200)]
Make sure we aren't using dead locals

6 years agoAnalyse storage liveness and preserve it during generator transformation
John Kåre Alsaker [Sun, 10 Sep 2017 20:34:56 +0000 (22:34 +0200)]
Analyse storage liveness and preserve it during generator transformation

6 years agoAuto merge of #44516 - gaurikholkar:fns, r=arielb1
bors [Wed, 13 Sep 2017 21:20:19 +0000 (21:20 +0000)]
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

6 years agoFix initial review
leonardo.yvens [Wed, 13 Sep 2017 17:21:16 +0000 (14:21 -0300)]
Fix initial review

6 years agofix ui tests
gaurikholkar [Wed, 13 Sep 2017 15:26:27 +0000 (20:56 +0530)]
fix ui tests

6 years agoRefactor fn_trait_kind
leonardo.yvens [Wed, 13 Sep 2017 15:19:37 +0000 (12:19 -0300)]
Refactor fn_trait_kind

Short and sweet

6 years agohonor #[rustc_const_unstable] attributes
Alex Burka [Fri, 8 Sep 2017 18:11:30 +0000 (18:11 +0000)]
honor #[rustc_const_unstable] attributes

6 years agoRefactor how to get a lang item's name
leonardo.yvens [Wed, 13 Sep 2017 15:00:40 +0000 (12:00 -0300)]
Refactor how to get a lang item's name

Small refactorings

6 years agorustc: Spawn `cmd /c emcc.bat` explicitly
Alex Crichton [Wed, 13 Sep 2017 14:41:58 +0000 (07:41 -0700)]
rustc: Spawn `cmd /c emcc.bat` explicitly

In #42436 the behavior for spawning processes on Windows was tweaked slightly to
fix various bugs, but this caused #42791 as a regression, namely that to spawn
batch scripts they need to be manually spawned with `cmd /c` instead now. This
updates the compiler to handle this case explicitly for Emscripten.

Closes #42791

6 years agoRemove require_owned_box
leonardo.yvens [Wed, 13 Sep 2017 14:16:45 +0000 (11:16 -0300)]
Remove require_owned_box

It's unused and unnecessary

6 years agoAuto merge of #44129 - pnkfelix:fix-end-region-emission-order, r=nmatsakis
bors [Wed, 13 Sep 2017 13:01:42 +0000 (13:01 +0000)]
Auto merge of #44129 - pnkfelix:fix-end-region-emission-order, r=nmatsakis

Fix end region emission order

Fix #43481

6 years agoAdd note for append method in OpenOptions docs
Guillaume Gomez [Wed, 13 Sep 2017 12:47:50 +0000 (14:47 +0200)]
Add note for append method in OpenOptions docs

6 years agoAdd missing urls for OpenOptions docs
Guillaume Gomez [Wed, 13 Sep 2017 12:46:15 +0000 (14:46 +0200)]
Add missing urls for OpenOptions docs

6 years agoFix example in transmute; add safety requirement to Vec::from_raw_parts
Havvy [Wed, 13 Sep 2017 08:27:41 +0000 (01:27 -0700)]
Fix example in transmute; add safety requirement to Vec::from_raw_parts

6 years agoTest case illustrating some destruction code extent stuff.
Felix S. Klock II [Thu, 31 Aug 2017 11:32:52 +0000 (13:32 +0200)]
Test case illustrating some destruction code extent stuff.

6 years agoUnit test for proper EndRegion emission on a cyclic reference.
Felix S. Klock II [Mon, 28 Aug 2017 11:39:06 +0000 (13:39 +0200)]
Unit test for proper EndRegion emission on a cyclic reference.

6 years agoUpdate mir-opt tests to reflect change to EndRegion emission order.
Felix S. Klock II [Mon, 28 Aug 2017 09:40:37 +0000 (11:40 +0200)]
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).

6 years agoFix issue #43481: emit the EndRegion *before* StorageDeads for a scope.
Felix S. Klock II [Tue, 22 Aug 2017 13:54:57 +0000 (15:54 +0200)]
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.)

6 years agoAuto merge of #44386 - est31:master, r=pnkfelix
bors [Wed, 13 Sep 2017 10:28:33 +0000 (10:28 +0000)]
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

6 years agoMove default stack min size to thread implementations
Tobias Schaffner [Sat, 9 Sep 2017 09:09:34 +0000 (11:09 +0200)]
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.

6 years agoFix drain_filter doctest.
David Adler [Wed, 13 Sep 2017 05:33:27 +0000 (22:33 -0700)]
Fix drain_filter doctest.

6 years agoAuto merge of #44420 - alexcrichton:private-cstore, r=michaelwoerister
bors [Wed, 13 Sep 2017 05:32:00 +0000 (05:32 +0000)]
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)

6 years agorustc: Make `CrateStore` private to `TyCtxt`
Alex Crichton [Thu, 7 Sep 2017 20:21:46 +0000 (13:21 -0700)]
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.

6 years agoAuto merge of #44456 - eddyb:stable-drop-const, r=nikomatsakis
bors [Wed, 13 Sep 2017 03:04:49 +0000 (03:04 +0000)]
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

6 years agoRemove Invalid UTF-8 from str::from_utf8_unchecked_mut
Ethan Dagner [Tue, 12 Sep 2017 23:30:44 +0000 (17:30 -0600)]
Remove Invalid UTF-8 from str::from_utf8_unchecked_mut

6 years agobump gcc for bootstrap
QuietMisdreavus [Tue, 12 Sep 2017 23:09:26 +0000 (18:09 -0500)]
bump gcc for bootstrap

On Windows, the gcc crate would send /Wall to msvc, which would cause
builds to get flooded with warnings, exploding compile times from one
hour to more than 72! The gcc crate version 0.3.54 changes this behavior
to send /W4 instead, which greatly cuts down on cl.exe flooding the
command prompt window with warnings.

6 years agoAuto merge of #44015 - kennytm:hasher, r=alexcrichton
bors [Tue, 12 Sep 2017 21:39:08 +0000 (21:39 +0000)]
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.

6 years agoRemove deprecated lang items
leonardo.yvens [Tue, 12 Sep 2017 20:04:26 +0000 (17:04 -0300)]
Remove deprecated lang items

They have been deprecated for years and there is no trace left of them
in the compiler.

6 years agoFix rendering of const keyword for functions
Guillaume Gomez [Fri, 1 Sep 2017 21:09:11 +0000 (23:09 +0200)]
Fix rendering of const keyword for functions

6 years agoAuto merge of #44133 - vorner:allocator-kind-autodetect, r=alexcrichton
bors [Tue, 12 Sep 2017 18:12:21 +0000 (18:12 +0000)]
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.

6 years agoRemove the `cstore` reference from Session in order to prepare encapsulating CrateSto...
Michael Woerister [Tue, 5 Sep 2017 14:48:24 +0000 (16:48 +0200)]
Remove the `cstore` reference from Session in order to prepare encapsulating CrateStore access in tcx.

6 years agoAdding changes for trait objects
gaurikholkar [Tue, 12 Sep 2017 12:52:22 +0000 (18:22 +0530)]
Adding changes for trait objects

6 years agoAuto merge of #44413 - est31:move_man, r=nikomatsakis
bors [Tue, 12 Sep 2017 12:41:23 +0000 (12:41 +0000)]
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.

6 years agoadd ui test for fn items, tidy fixes
gaurikholkar [Tue, 12 Sep 2017 11:18:01 +0000 (16:48 +0530)]
add ui test for fn items, tidy fixes

6 years agoAdd an example of std::str::encode_utf16
rwakulszowa [Tue, 12 Sep 2017 10:53:16 +0000 (11:53 +0100)]
Add an example of std::str::encode_utf16

Closes #44419

6 years agoAuto merge of #44344 - jonhoo:entry_or_default, r=BurntSushi
bors [Tue, 12 Sep 2017 09:54:59 +0000 (09:54 +0000)]
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)`.

6 years agoDisable the new Hasher tests on Emscripten.
kennytm [Sun, 10 Sep 2017 16:13:19 +0000 (00:13 +0800)]
Disable the new Hasher tests on Emscripten.

6 years agoimpl Hasher for {&mut Hasher, Box<Hasher>}
kennytm [Mon, 21 Aug 2017 14:15:02 +0000 (22:15 +0800)]
impl Hasher for {&mut Hasher, Box<Hasher>}

6 years agoAuto merge of #44310 - ldr709:master, r=BurntSushi
bors [Tue, 12 Sep 2017 07:13:40 +0000 (07:13 +0000)]
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.

6 years agofixes
gaurikholkar [Mon, 11 Sep 2017 19:04:52 +0000 (00:34 +0530)]
fixes

6 years agocorrect depth initialisation
gaurikholkar [Mon, 11 Sep 2017 18:28:29 +0000 (23:58 +0530)]
correct depth initialisation

6 years agoadd logs
gaurikholkar [Tue, 15 Aug 2017 16:46:29 +0000 (22:16 +0530)]
add logs

6 years agoextend E0623 for fns
gaurikholkar [Tue, 15 Aug 2017 04:51:31 +0000 (10:21 +0530)]
extend E0623 for fns

6 years agoAdding E0623 for structs
gaurikholkar [Sat, 5 Aug 2017 22:39:43 +0000 (04:09 +0530)]
Adding E0623 for structs

6 years agoAuto merge of #44275 - eddyb:deferred-ctfe, r=nikomatsakis
bors [Tue, 12 Sep 2017 04:14:07 +0000 (04:14 +0000)]
Auto merge of #44275 - eddyb:deferred-ctfe, r=nikomatsakis

Evaluate fixed-length array length expressions lazily.

This is in preparation for polymorphic array lengths (aka `[T; T::A]`) and const generics.
We need deferred const-evaluation to break cycles when array types show up in positions which require knowing the array type to typeck the array length, e.g. the array type is in a `where` clause.

The final step - actually passing bounds in scope to array length expressions from the parent - is not done because it still produces cycles when *normalizing* `ParamEnv`s, and @nikomatsakis' in-progress lazy normalization work is needed to deal with that uniformly.

However, the changes here are still useful to unlock work on const generics, which @EpicatSupercell manifested interest in, and I might be mentoring them for that, but we need this baseline first.

r? @nikomatsakis cc @oli-obk