]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoRollup merge of #42783 - ids1024:redox-env, r=sfackler
Mark Simulacrum [Fri, 23 Jun 2017 12:02:08 +0000 (06:02 -0600)]
Rollup merge of #42783 - ids1024:redox-env, r=sfackler

Redox: Use create() instead of open() when setting env variable

See https://github.com/redox-os/kernel/pull/25.

7 years agoRollup merge of #42777 - kennytm:kill-ignore-doctest, r=estebank
Mark Simulacrum [Fri, 23 Jun 2017 12:02:08 +0000 (06:02 -0600)]
Rollup merge of #42777 - kennytm:kill-ignore-doctest, r=estebank

Remove most "```ignore" doc tests.

Unconditional ` ```ignore ` doc tests lead to outdated examples (e.g. https://github.com/rust-lang/rust/issues/42729#issuecomment-309346572). This PR tries to change all existing ` ```ignore ` tests into one of the following:

* Add import and declarations to ensure the code is run-pass
* If the code is not Rust, change to ` ```text `/` ```sh `/` ```json `/` ```dot `
* If the code is expected compile-fail, change to ` ```compile_fail `
* If the code is expected run-fail, change to ` ```should_panic `
* If the code can type-check but cannot link/run, change to ` ```no_run `
* Otherwise, add an explanation after the ` ```ignore `

The `--explain` handling is changed to cope with hidden lines from the error index.

Tidy is changed to reject any unexplained ` ```ignore ` and ` ```rust,ignore `.

7 years agoAdded a tidy check to disallow "```ignore" and "```rust,ignore".
kennytm [Tue, 20 Jun 2017 17:00:02 +0000 (01:00 +0800)]
Added a tidy check to disallow "```ignore" and "```rust,ignore".

7 years agoModify --explain to handle hidden code (`# ...`) and indented code blocks.
kennytm [Tue, 20 Jun 2017 07:53:03 +0000 (15:53 +0800)]
Modify --explain to handle hidden code (`# ...`) and indented code blocks.

7 years agoRemoved as many "```ignore" as possible.
kennytm [Tue, 20 Jun 2017 07:15:16 +0000 (15:15 +0800)]
Removed as many "```ignore" as possible.

Replaced by adding extra imports, adding hidden code (`# ...`), modifying
examples to be runnable (sorry Homura), specifying non-Rust code, and
converting to should_panic, no_run, or compile_fail.

Remaining "```ignore"s received an explanation why they are being ignored.

7 years agoAuto merge of #42828 - parched:umulo, r=alexcrichton
bors [Fri, 23 Jun 2017 05:25:22 +0000 (05:25 +0000)]
Auto merge of #42828 - parched:umulo, r=alexcrichton

Update LLVM to fix unsigned multiplication overflow

check for some targets, notably ARMv6-M.

Fixes https://github.com/rust-lang-nursery/compiler-builtins/issues/150

7 years agoAuto merge of #42304 - Mark-Simulacrum:issue-37157, r=nikomatsakis
bors [Fri, 23 Jun 2017 00:32:40 +0000 (00:32 +0000)]
Auto merge of #42304 - Mark-Simulacrum:issue-37157, r=nikomatsakis

Print the two types in the span label for transmute errors.

Fixes #37157. I'm not entirely happy with the changes here but overall it's better in my opinion; we certainly avoid the odd language in that issue, which changes to:

```
error[E0512]: transmute called with differently sized types: <C as TypeConstructor<'a>>::T (size can vary because of <C as TypeConstructor>::T) to <C as TypeConstructor<'b>>::T (size can vary because of <C as TypeConstructor>::T)
 --> test.rs:8:5
  |
8 |     ::std::mem::transmute(x)
  |     ^^^^^^^^^^^^^^^^^^^^^ transmuting between <C as TypeConstructor<'a>>::T and <C as TypeConstructor<'b>>::T

error: aborting due to previous error(s)
```

7 years agoAuto merge of #42614 - GuillaumeGomez:new-error-codes, r=pnkfelix
bors [Thu, 22 Jun 2017 21:46:08 +0000 (21:46 +0000)]
Auto merge of #42614 - GuillaumeGomez:new-error-codes, r=pnkfelix

New error codes

Part of #42229.

cc @Susurrus @frewsxcv @QuietMisdreavus

7 years agoAuto merge of #42634 - Zoxc:for-desugar2, r=nikomatsakis
bors [Thu, 22 Jun 2017 15:24:58 +0000 (15:24 +0000)]
Auto merge of #42634 - Zoxc:for-desugar2, r=nikomatsakis

Change the for-loop desugar so the `break` does not affect type inference. Fixes #42618

Rewrite the `for` loop desugaring to avoid contaminating the inference results. Under the older desugaring, `for x in vec![] { .. }` would erroneously type-check, even though the type of `vec![]` is unconstrained. (written by @nikomatsakis)

7 years agoAuto merge of #42824 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Thu, 22 Jun 2017 12:48:54 +0000 (12:48 +0000)]
Auto merge of #42824 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 4 pull requests

- Successful merges: #42799, #42804, #42805, #42806
- Failed merges:

7 years agoRollup merge of #42806 - ollie27:rustbuild_compiler_docs, r=alexcrichton
Mark Simulacrum [Thu, 22 Jun 2017 12:30:12 +0000 (06:30 -0600)]
Rollup merge of #42806 - ollie27:rustbuild_compiler_docs, r=alexcrichton

rustbuild: Fix compiler docs yet again

Add support for `-Z force-unstable-if-unmarked` to rustdoc.

r? @alexcrichton

7 years agoRollup merge of #42805 - stepancheg:forward-python, r=alexcrichton
Mark Simulacrum [Thu, 22 Jun 2017 12:30:11 +0000 (06:30 -0600)]
Rollup merge of #42805 - stepancheg:forward-python, r=alexcrichton

Pass path to python from bootstrap.py to bootstrap.rs

When bootstrap is executed with python not in `$PATH`, (e. g.
`c:\Python27\python.exe x.py test`) bootstrap cannot find python
and crashes.

This commit passes path to python in `BOOTSTRAP_PYTHON` env var.

7 years agoRollup merge of #42804 - Mark-Simulacrum:rustbuild-colors, r=alexcrichton
Mark Simulacrum [Thu, 22 Jun 2017 12:30:10 +0000 (06:30 -0600)]
Rollup merge of #42804 - Mark-Simulacrum:rustbuild-colors, r=alexcrichton

Make rustc errors colorful.

Rustbuild passes --message-format=json to Cargo to learn about the
dependencies for a given build, which then makes Cargo steal the
stderr/stdout for the compiler process, leading to non colorful output.
To avoid this, detection of stderr being a tty is added to rustbuild,
and an environment variable is used to communicate with the rustc shim.

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

r? @alexcrichton

7 years agoRollup merge of #42799 - leodasvacas:impl-clone-for-default-hasher, r=sfackler
Mark Simulacrum [Thu, 22 Jun 2017 12:30:09 +0000 (06:30 -0600)]
Rollup merge of #42799 - leodasvacas:impl-clone-for-default-hasher, r=sfackler

Impl Clone for DefaultHasher

It's useful for a hasher to be `Clone`. It's also strange for any type to not be `Clone`. `DefaultHasher` is not meant to be used directly, but being in std it can be useful as a placeholder. I don't see any forward compatibility hazard if the hasher is changed since it's very rare for something to not be `Clone`.

7 years agoAuto merge of #42798 - stepancheg:args-debug, r=sfackler
bors [Thu, 22 Jun 2017 10:34:21 +0000 (10:34 +0000)]
Auto merge of #42798 - stepancheg:args-debug, r=sfackler

Better Debug for Args and ArgsOs

Display actual args instead of two dots.

7 years agoAuto merge of #42803 - michaelwoerister:msdia-workaround, r=vadimcn
bors [Thu, 22 Jun 2017 08:10:27 +0000 (08:10 +0000)]
Auto merge of #42803 - michaelwoerister:msdia-workaround, r=vadimcn

debuginfo: Work around crash-bug in MSDIA library

Fixes https://github.com/rust-lang/rust/issues/40477 (which also contains a description of the issue being fixed).

r? @vadimcn

7 years agodebuginfo: Work around crash-bug in MSDIA library
Michael Woerister [Wed, 21 Jun 2017 14:38:22 +0000 (17:38 +0300)]
debuginfo: Work around crash-bug in MSDIA library

7 years agoAuto merge of #42785 - Mark-Simulacrum:fix-verbose-bootstrap, r=alexcrichton
bors [Thu, 22 Jun 2017 05:50:58 +0000 (05:50 +0000)]
Auto merge of #42785 - Mark-Simulacrum:fix-verbose-bootstrap, r=alexcrichton

Fixes bootstrapping with custom cargo/rustc.

config.mk is now always read when parsing the configuration to prevent
this from reoccurring in the future, hopefully.

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

r? @alexcrichton

cc @infinity0 @kyrias

7 years agoAuto merge of #42682 - alexcrichton:jobserver, r=michaelwoerister
bors [Thu, 22 Jun 2017 00:32:42 +0000 (00:32 +0000)]
Auto merge of #42682 - alexcrichton:jobserver, r=michaelwoerister

Integrate jobserver support to parallel codegen

This commit integrates the `jobserver` crate into the compiler. The crate was
previously integrated in to Cargo as part of rust-lang/cargo#4110. The purpose
here is to two-fold:

* Primarily the compiler can cooperate with Cargo on parallelism. When you run
  `cargo build -j4` then this'll make sure that the entire build process between
  Cargo/rustc won't use more than 4 cores, whereas today you'd get 4 rustc
  instances which may all try to spawn lots of threads.

* Secondarily rustc/Cargo can now integrate with a foreign GNU `make` jobserver.
  This means that if you call cargo/rustc from `make` or another
  jobserver-compatible implementation it'll use foreign parallelism settings
  instead of creating new ones locally.

As the number of parallel codegen instances in the compiler continues to grow
over time with the advent of incremental compilation it's expected that this'll
become more of a problem, so this is intended to nip concurrent concerns in the
bud by having all the tools to cooperate!

Note that while rustc has support for itself creating a jobserver it's far more
likely that rustc will always use the jobserver configured by Cargo. Cargo today
will now set a jobserver unconditionally for rustc to use.

7 years agoAuto merge of #42771 - arielb1:no-inline-unwind, r=nagisa
bors [Wed, 21 Jun 2017 21:29:45 +0000 (21:29 +0000)]
Auto merge of #42771 - arielb1:no-inline-unwind, r=nagisa

mark calls in the unwind path as !noinline

The unwind path is always cold, so that should not have bad performance
implications.  This avoids catastrophic exponential inlining, and also
decreases the size of librustc.so by 1.5% (OTOH, the size of `libstd.so`
increased by 0.5% for some reason).

Fixes #41696.

r? @nagisa

7 years agorustbuild: Fix compiler docs yet again
Oliver Middleton [Wed, 21 Jun 2017 16:59:10 +0000 (17:59 +0100)]
rustbuild: Fix compiler docs yet again

Add support for `-Z force-unstable-if-unmarked` to rustdoc.

7 years agoMake rustc errors colorful.
Mark Simulacrum [Wed, 21 Jun 2017 16:04:21 +0000 (10:04 -0600)]
Make rustc errors colorful.

Rustbuild passes --message-format=json to Cargo to learn about the
dependencies for a given build, which then makes Cargo steal the
stderr/stdout for the compiler process, leading to non colorful output.
To avoid this, detection of stderr being a tty is added to rustbuild,
and an environment variable is used to communicate with the rustc shim.

7 years agoPass path to python from bootstrap.py to bootstrap.rs
Stepan Koltsov [Wed, 21 Jun 2017 16:01:24 +0000 (19:01 +0300)]
Pass path to python from bootstrap.py to bootstrap.rs

When bootstrap is executed with python not in `$PATH`, (e. g.
`c:\Python27\python.exe x.py test`) bootstrap cannot find python
and crashes.

This commit passes path to python in `BOOTSTRAP_PYTHON` env var.

7 years agoUpdate LLVM to fix unsigned multiplication overflow
James Duley [Wed, 21 Jun 2017 15:38:36 +0000 (16:38 +0100)]
Update LLVM to fix unsigned multiplication overflow

check for some targets, notably ARMv6-M.

7 years agoAuto merge of #42802 - frewsxcv:rollup, r=frewsxcv
bors [Wed, 21 Jun 2017 15:26:55 +0000 (15:26 +0000)]
Auto merge of #42802 - frewsxcv:rollup, r=frewsxcv

Rollup of 4 pull requests

- Successful merges: #42397, #42620, #42762, #42766
- Failed merges:

7 years agoRollup merge of #42766 - nrc:versions, r=nagisa
Corey Farwell [Wed, 21 Jun 2017 14:40:17 +0000 (10:40 -0400)]
Rollup merge of #42766 - nrc:versions, r=nagisa

Update rls-data version

And update the RLS submod

7 years agoRollup merge of #42762 - jackpot51:patch-1, r=sfackler
Corey Farwell [Wed, 21 Jun 2017 14:40:16 +0000 (10:40 -0400)]
Rollup merge of #42762 - jackpot51:patch-1, r=sfackler

Disable repr(simd) in mem::swap on Redox

This addresses https://github.com/rust-lang/rust/issues/42761

7 years agoRollup merge of #42620 - wesleywiser:compile_error, r=brson
Corey Farwell [Wed, 21 Jun 2017 14:40:15 +0000 (10:40 -0400)]
Rollup merge of #42620 - wesleywiser:compile_error, r=brson

Add compile_error!

Related to #40872

7 years agoRollup merge of #42397 - sfackler:syncsender-sync, r=alexcrichton
Corey Farwell [Wed, 21 Jun 2017 14:40:14 +0000 (10:40 -0400)]
Rollup merge of #42397 - sfackler:syncsender-sync, r=alexcrichton

Implement Sync for SyncSender

r? @alexcrichton

7 years agoIntegrate jobserver support to parallel codegen
Alex Crichton [Thu, 15 Jun 2017 14:08:18 +0000 (07:08 -0700)]
Integrate jobserver support to parallel codegen

This commit integrates the `jobserver` crate into the compiler. The crate was
previously integrated in to Cargo as part of rust-lang/cargo#4110. The purpose
here is to two-fold:

* Primarily the compiler can cooperate with Cargo on parallelism. When you run
  `cargo build -j4` then this'll make sure that the entire build process between
  Cargo/rustc won't use more than 4 cores, whereas today you'd get 4 rustc
  instances which may all try to spawn lots of threads.

* Secondarily rustc/Cargo can now integrate with a foreign GNU `make` jobserver.
  This means that if you call cargo/rustc from `make` or another
  jobserver-compatible implementation it'll use foreign parallelism settings
  instead of creating new ones locally.

As the number of parallel codegen instances in the compiler continues to grow
over time with the advent of incremental compilation it's expected that this'll
become more of a problem, so this is intended to nip concurrent concerns in the
bud by having all the tools to cooperate!

Note that while rustc has support for itself creating a jobserver it's far more
likely that rustc will always use the jobserver configured by Cargo. Cargo today
will now set a jobserver unconditionally for rustc to use.

7 years agoImpl Clone for DefaultHasher
Leonardo Yvens [Wed, 21 Jun 2017 13:47:29 +0000 (10:47 -0300)]
Impl Clone for DefaultHasher

7 years agoBetter Debug for Args and ArgsOs
Stepan Koltsov [Wed, 21 Jun 2017 12:40:45 +0000 (15:40 +0300)]
Better Debug for Args and ArgsOs

Display actual args instead of two dots.

7 years agoAuto merge of #42751 - arielb1:fast-representable, r=eddyb
bors [Wed, 21 Jun 2017 12:28:48 +0000 (12:28 +0000)]
Auto merge of #42751 - arielb1:fast-representable, r=eddyb

Memoize types in `is_representable` to avoid exponential worst-case

I could have made representability a cached query, but that would have
been added complexity for not much benefit - outside of the exponential
worst-case, this pass is fast enough already.

Fixes #42747.

r? @eddyb

7 years agoAuto merge of #42750 - arielb1:unwind-stack, r=eddyb
bors [Wed, 21 Jun 2017 10:06:13 +0000 (10:06 +0000)]
Auto merge of #42750 - arielb1:unwind-stack, r=eddyb

Update LLVM to pick StackColoring improvement

Fixes #40883.

r? @eddyb

7 years agoAuto merge of #42664 - alexcrichton:moar-crates, r=eddyb
bors [Wed, 21 Jun 2017 06:27:36 +0000 (06:27 +0000)]
Auto merge of #42664 - alexcrichton:moar-crates, r=eddyb

Remove in-tree flate/getopts crates

Remove `src/libflate` in favor of `flate2` on crates.io and `src/libgetopts` in favor of `getopts` on crates.io. The replacements have slightly different APIs and the usage in the compiler has been updated to reflect this.

This uncovered an unfortunate limitation of the compiler today to deal with linking everything correctly, and the workaround can be found documented in `src/librustc/Cargo.toml`.

7 years agoAuto merge of #42002 - sfackler:trusted-read, r=alexcrichton
bors [Wed, 21 Jun 2017 04:14:46 +0000 (04:14 +0000)]
Auto merge of #42002 - sfackler:trusted-read, r=alexcrichton

Add a Read::initializer method

This is an API that allows types to indicate that they can be passed
buffers of uninitialized memory which can improve performance.

cc @SimonSapin

r? @alexcrichton

7 years agoAdd `Read::initializer`.
Steven Fackler [Mon, 15 May 2017 01:29:18 +0000 (21:29 -0400)]
Add `Read::initializer`.

This is an API that allows types to indicate that they can be passed
buffers of uninitialized memory which can improve performance.

7 years agoAuto merge of #42076 - alex-ozdemir:master, r=nrc
bors [Wed, 21 Jun 2017 00:06:02 +0000 (00:06 +0000)]
Auto merge of #42076 - alex-ozdemir:master, r=nrc

Clearer Error Message for Duplicate Definition

Clearer use of the error message and span labels to communicate duplication definitions/imports.

fixes #42061

7 years agoFixes bootstrapping with custom cargo/rustc.
Mark Simulacrum [Wed, 21 Jun 2017 00:04:36 +0000 (18:04 -0600)]
Fixes bootstrapping with custom cargo/rustc.

config.mk is now always read when parsing the configuration to prevent
this from reoccurring in the future, hopefully.

7 years agoRedox: Use create() instead of open() when setting env variable
Ian Douglas Scott [Tue, 20 Jun 2017 23:04:38 +0000 (16:04 -0700)]
Redox: Use create() instead of open() when setting env variable

7 years agoAuto merge of #42780 - frewsxcv:rollup, r=frewsxcv
bors [Tue, 20 Jun 2017 21:08:28 +0000 (21:08 +0000)]
Auto merge of #42780 - frewsxcv:rollup, r=frewsxcv

Rollup of 6 pull requests

- Successful merges: #42271, #42717, #42728, #42749, #42756, #42772
- Failed merges:

7 years agoRollup merge of #42772 - MaloJaffre:libc, r=alexcrichton
Corey Farwell [Tue, 20 Jun 2017 20:28:32 +0000 (16:28 -0400)]
Rollup merge of #42772 - MaloJaffre:libc, r=alexcrichton

Update libc to 0.2.24

Fixes  #42427.

7 years agoRollup merge of #42756 - sanxiyn:name-for-must-use, r=estebank
Corey Farwell [Tue, 20 Jun 2017 20:28:31 +0000 (16:28 -0400)]
Rollup merge of #42756 - sanxiyn:name-for-must-use, r=estebank

Show type name for unused_must_use lint

Fix #42688.

7 years agoRollup merge of #42749 - frewsxcv:frewsxcxv/doc-examples, r=QuietMisdreavus
Corey Farwell [Tue, 20 Jun 2017 20:28:30 +0000 (16:28 -0400)]
Rollup merge of #42749 - frewsxcv:frewsxcxv/doc-examples, r=QuietMisdreavus

Additions/improvements for doc examples.

None

7 years agoRollup merge of #42728 - jseyfried:fix_resolve_perf, r=nrc
Corey Farwell [Tue, 20 Jun 2017 20:28:27 +0000 (16:28 -0400)]
Rollup merge of #42728 - jseyfried:fix_resolve_perf, r=nrc

resolve: fix perf bug

Fixes #42544.
r? @nrc

7 years agoRollup merge of #42717 - ollie27:into_to_from2, r=sfackler
Corey Farwell [Tue, 20 Jun 2017 20:28:26 +0000 (16:28 -0400)]
Rollup merge of #42717 - ollie27:into_to_from2, r=sfackler

Convert `Into<Box<[T]>> for Vec<T>` into `From<Vec<T>> for Box<[T]>`

As the `collections` crate has been merged into `alloc` in #42648 this impl is now possible. This is the final part of #42129 missing from #42227.

7 years agoRollup merge of #42271 - tinaun:charfromstr, r=alexcrichton
Corey Farwell [Tue, 20 Jun 2017 20:28:25 +0000 (16:28 -0400)]
Rollup merge of #42271 - tinaun:charfromstr, r=alexcrichton

add `FromStr` Impl for `char`

fixes #24939.

is it possible to use pub(restricted) instead of using a stability attribute for the internal error representation? is it needed at all?

7 years agoSwitch to the crates.io `getopts` crate
Alex Crichton [Thu, 8 Jun 2017 21:20:55 +0000 (14:20 -0700)]
Switch to the crates.io `getopts` crate

This commit deletes the in-tree `getopts` crate in favor of the crates.io-based
`getopts` crate. The main difference here is with a new builder-style API, but
otherwise everything else remains relatively standard.

7 years agomark calls in the unwind path as !noinline
Ariel Ben-Yehuda [Tue, 20 Jun 2017 12:07:47 +0000 (15:07 +0300)]
mark calls in the unwind path as !noinline

The unwind path is always cold, so that should not have bad performance
implications.  This avoids catastrophic exponential inlining, and also
decreases the size of librustc.so by 1.5% (OTOH, the size of `libstd.so`
increased by 0.5% for some reason).

Fixes #41696.

7 years agoAdd a couple doc additional examples for `env::join_paths`.
Corey Farwell [Mon, 19 Jun 2017 02:21:17 +0000 (19:21 -0700)]
Add a couple doc additional examples for `env::join_paths`.

7 years agoAdd doc example for `CString::from_raw`.
Corey Farwell [Mon, 19 Jun 2017 01:22:54 +0000 (18:22 -0700)]
Add doc example for `CString::from_raw`.

7 years agoAdd doc example for `FromBytesWithNulError`.
Corey Farwell [Mon, 19 Jun 2017 00:44:41 +0000 (17:44 -0700)]
Add doc example for `FromBytesWithNulError`.

7 years agoAdd doc example for `NulError`.
Corey Farwell [Mon, 19 Jun 2017 00:31:06 +0000 (17:31 -0700)]
Add doc example for `NulError`.

7 years agoAdd doc example for `CStr::to_str`.
Corey Farwell [Sun, 18 Jun 2017 23:12:39 +0000 (16:12 -0700)]
Add doc example for `CStr::to_str`.

7 years agoAdd doc example for `CString::as_c_str`.
Corey Farwell [Sun, 18 Jun 2017 23:05:00 +0000 (16:05 -0700)]
Add doc example for `CString::as_c_str`.

7 years agoAdd doc example for `Box<CStr>::into_c_string`.
Corey Farwell [Sun, 18 Jun 2017 22:48:00 +0000 (15:48 -0700)]
Add doc example for `Box<CStr>::into_c_string`.

7 years agoAdd doc example for `CString::into_boxed_c_str`.
Corey Farwell [Sun, 18 Jun 2017 22:45:00 +0000 (15:45 -0700)]
Add doc example for `CString::into_boxed_c_str`.

7 years agoAdd doc example for `CStr::to_string_lossy`.
Corey Farwell [Sun, 18 Jun 2017 21:46:19 +0000 (14:46 -0700)]
Add doc example for `CStr::to_string_lossy`.

7 years agoAdd error scenario doc examples for `CStr::from_bytes_with_nul`.
Corey Farwell [Sun, 18 Jun 2017 21:28:10 +0000 (14:28 -0700)]
Add error scenario doc examples for `CStr::from_bytes_with_nul`.

7 years agoAdd doc example for `CStr::to_bytes_with_nul`.
Corey Farwell [Sun, 18 Jun 2017 21:12:17 +0000 (14:12 -0700)]
Add doc example for `CStr::to_bytes_with_nul`.

7 years agoAdd doc example for `CStr::to_bytes`.
Corey Farwell [Sun, 18 Jun 2017 21:11:34 +0000 (14:11 -0700)]
Add doc example for `CStr::to_bytes`.

7 years agoRemove the in-tree `flate` crate
Alex Crichton [Thu, 8 Jun 2017 21:10:36 +0000 (14:10 -0700)]
Remove the in-tree `flate` crate

A long time coming this commit removes the `flate` crate in favor of the
`flate2` crate on crates.io. The functionality in `flate2` originally flowered
out of `flate` itself and is additionally the namesake for the crate. This will
leave a gap in the naming (there's not `flate` crate), which will likely cause a
particle collapse of some form somewhere.

7 years agoAuto merge of #42716 - alexbool:cstr-inlines, r=BurntSushi
bors [Tue, 20 Jun 2017 13:25:21 +0000 (13:25 +0000)]
Auto merge of #42716 - alexbool:cstr-inlines, r=BurntSushi

Mark smaller CStr and CString functions as #[inline]

7 years agoUpdate libc to 0.2.24
Malo Jaffré [Tue, 20 Jun 2017 11:42:52 +0000 (13:42 +0200)]
Update libc to 0.2.24

Fixes  #42427.

7 years agoAuto merge of #42571 - tlively:wasm-dev, r=alexcrichton
bors [Tue, 20 Jun 2017 09:44:40 +0000 (09:44 +0000)]
Auto merge of #42571 - tlively:wasm-dev, r=alexcrichton

Enable wasm LLVM backend

Enables compilation to WebAssembly with the LLVM backend using the target triple "wasm32-unknown-unknown". This is the beginning of my work on #38804.

**edit:** The new new target is now wasm32-experimental-emscripten instead of wasm32-unknown-unknown.

7 years agoadded `FromStr` Impl for `char`
tinaun [Sat, 27 May 2017 22:12:16 +0000 (18:12 -0400)]
added `FromStr` Impl for `char`

7 years agoMark smaller CStr and CString functions as #[inline]
Alexander Bulaev [Sat, 17 Jun 2017 12:50:55 +0000 (15:50 +0300)]
Mark smaller CStr and CString functions as #[inline]

7 years agoAuto merge of #42495 - alexcrichton:new-stage0, r=Mark-Simulacrum
bors [Tue, 20 Jun 2017 07:22:38 +0000 (07:22 +0000)]
Auto merge of #42495 - alexcrichton:new-stage0, r=Mark-Simulacrum

Bump to 1.20.0 and update stage0 compiler

Betas are hot off the bots, let's get them while they're fresh.

7 years agoUpdate RLS submod
Nick Cameron [Tue, 20 Jun 2017 05:55:11 +0000 (17:55 +1200)]
Update RLS submod

7 years agoUpdate rls-data dep
Nick Cameron [Tue, 20 Jun 2017 05:54:43 +0000 (17:54 +1200)]
Update rls-data dep

7 years agoBump version and stage0 compiler
Alex Crichton [Wed, 7 Jun 2017 02:32:43 +0000 (19:32 -0700)]
Bump version and stage0 compiler

7 years agoAuto merge of #42313 - pnkfelix:allocator-integration, r=alexcrichton
bors [Tue, 20 Jun 2017 05:02:19 +0000 (05:02 +0000)]
Auto merge of #42313 - pnkfelix:allocator-integration, r=alexcrichton

Allocator integration

Lets start getting some feedback on `trait Alloc`.

Here is:
 *  the `trait Alloc` itself,
 * the `struct Layout` and `enum AllocErr` that its API relies on
 * a `struct HeapAlloc` that exposes the system allocator as an instance of `Alloc`
 * an integration of `Alloc` with `RawVec`
 * ~~an integration of `Alloc` with `Vec`~~

 TODO
 * [x] split `fn realloc_in_place` into `grow` and `shrink` variants
 * [x] add `# Unsafety` and `# Errors` sections to documentation for all relevant methods
 * [x] remove `Vec` integration with `Allocator`
 * [x] add `allocate_zeroed` impl to `HeapAllocator`
 * [x] remove typedefs e.g. `type Size = usize;`
 * [x] impl `trait Error` for all error types in PR
 * [x] make `Layout::from_size_align` public
 * [x] clarify docs of `fn padding_needed_for`.
 * [x] revise `Layout` constructors to ensure that [size+align combination is valid](https://github.com/rust-lang/rust/pull/42313#issuecomment-306845446)
 * [x] resolve mismatch re requirements of align on dealloc. See [comment](https://github.com/rust-lang/rust/pull/42313#issuecomment-306202489).

7 years agoDisable repr(simd) in mem::swap on Redox
Jeremy Soller [Tue, 20 Jun 2017 03:00:30 +0000 (21:00 -0600)]
Disable repr(simd) in mem::swap on Redox

7 years agoAuto merge of #42754 - alexcrichton:update-cargo, r=jonathandturner
bors [Tue, 20 Jun 2017 02:34:41 +0000 (02:34 +0000)]
Auto merge of #42754 - alexcrichton:update-cargo, r=jonathandturner

Update `wincolor` dep for Cargo

Closes rust-lang/cargo#4189

7 years agoIgnore a spuriously failing test on asmjs
Alex Crichton [Mon, 19 Jun 2017 19:40:51 +0000 (12:40 -0700)]
Ignore a spuriously failing test on asmjs

Other tests are already ignored for missing `rust_begin_unwind`, let's add
another.

7 years agoShow type name for unused_must_use lint
Seo Sanghyeon [Mon, 19 Jun 2017 19:36:56 +0000 (04:36 +0900)]
Show type name for unused_must_use lint

7 years agoAdd compile_error!() to the unsable book
Wesley Wiser [Sat, 17 Jun 2017 01:45:46 +0000 (21:45 -0400)]
Add compile_error!() to the unsable book

7 years agoAdd compile_error!
Wesley Wiser [Sun, 7 May 2017 03:26:45 +0000 (23:26 -0400)]
Add compile_error!

Related to #40872

7 years agoUpdate LLVM to pick StackColoring improvement
Ariel Ben-Yehuda [Mon, 19 Jun 2017 12:44:29 +0000 (15:44 +0300)]
Update LLVM to pick StackColoring improvement

Fixes #40883.

7 years agoUpdate `wincolor` dep for Cargo
Alex Crichton [Mon, 19 Jun 2017 17:44:12 +0000 (10:44 -0700)]
Update `wincolor` dep for Cargo

Closes rust-lang/cargo#4189

7 years agoMemoize types in `is_representable` to avoid exponential worst-case
Ariel Ben-Yehuda [Mon, 19 Jun 2017 15:44:05 +0000 (18:44 +0300)]
Memoize types in `is_representable` to avoid exponential worst-case

I could have made representability a cached query, but that would have
been added complexity for not much benefit - outside of the exponential
worst-case, this pass is fast enough already.

Fixes #42747.

7 years agoMinor Allocator doc fix
Alex Crichton [Mon, 19 Jun 2017 14:51:00 +0000 (07:51 -0700)]
Minor Allocator doc fix

7 years agoIgnore test for not-closed issue
Alex Crichton [Mon, 19 Jun 2017 14:49:50 +0000 (07:49 -0700)]
Ignore test for not-closed issue

Confirmed on IRC that the bug isn't fully fixed, and the "resurgence" here isn't
the fault of this PR.

7 years agoAuto merge of #39409 - pnkfelix:mir-borrowck2, r=nikomatsakis
bors [Mon, 19 Jun 2017 13:01:27 +0000 (13:01 +0000)]
Auto merge of #39409 - pnkfelix:mir-borrowck2, r=nikomatsakis

MIR EndRegion Statements (was MIR dataflow for Borrows)

This PR adds an `EndRegion` statement to MIR (where the `EndRegion` statement is what terminates a borrow).

An earlier version of the PR implemented a dataflow analysis on borrow expressions, but I am now factoring that into a follow-up PR so that reviewing this one is easier. (And also because there are some revisions I want to make to that dataflow code, but I want this PR to get out of WIP status...)

This is a baby step towards MIR borrowck. I just want to get the review process going while I independently work on the remaining steps.

7 years agoAuto merge of #42737 - fhahn:rust-log-crash, r=michaelwoerister
bors [Mon, 19 Jun 2017 08:45:00 +0000 (08:45 +0000)]
Auto merge of #42737 - fhahn:rust-log-crash, r=michaelwoerister

rustc: Check if def_path_hash_to_def_id is populated before accessing.

Without this patch, there is an ICE when running rustc with
RUST_LOG=debug. This patch updates extract_def_id to check if the map
has been populated before accessing it. This fixes the problem, but
maybe we do not need to compute the incremental hashes maps in the first
place when we are not in incremental mode?

7 years agoresolve: fix perf bug.
Jeffrey Seyfried [Sat, 17 Jun 2017 10:28:31 +0000 (10:28 +0000)]
resolve: fix perf bug.

7 years agoAuto merge of #42722 - est31:master, r=Mark-Simulacrum
bors [Mon, 19 Jun 2017 03:42:27 +0000 (03:42 +0000)]
Auto merge of #42722 - est31:master, r=Mark-Simulacrum

Remove SUMMARY.md of the unstable book as its autogenerated

Its being autogenerated now, as of PR #42612.
It seems I forgot to remove it.

Also, sort the entries of SUMMARY.md alphabetically.

7 years agoAuto merge of #42740 - arielb1:bad-arm-2, r=alexcrichton
bors [Mon, 19 Jun 2017 01:31:31 +0000 (01:31 +0000)]
Auto merge of #42740 - arielb1:bad-arm-2, r=alexcrichton

Backport fixes to LLVM 4.0 ARM codegen bugs

So ARM had quite a few codegen bugs on LLVM 4.0 which are fixed on LLVM
trunk. This backports 5 of them:
r297871 - ARM: avoid clobbering register in v6 jump-table expansion.
    - fixes rust-lang/rust#42248
r294949 - [Thumb-1] TBB generation: spot redefinitions of index
r295816 - [ARM] Fix constant islands pass.
r300870 - [Thumb-1] Fix corner cases for compressed jump tables
r302650 - [IfConversion] Add missing check in
IfConversion/canFallThroughTo
    - unblocks rust-lang/rust#39409

r? @alexcrichton
beta-nominating because this fixes regressions introduced by LLVM 4.0.

7 years agoAuto merge of #42735 - arielb1:generic-closure-fn, r=eddyb
bors [Sun, 18 Jun 2017 23:22:35 +0000 (23:22 +0000)]
Auto merge of #42735 - arielb1:generic-closure-fn, r=eddyb

collector: apply param substs to closures cast to fn items

Fixes #42718.

r? @eddyb
beta-nominating because serious ICE in newly-stabilized feature.

7 years agoBackport fixes to LLVM 4.0 ARM codegen bugs
Ariel Ben-Yehuda [Sun, 18 Jun 2017 16:01:34 +0000 (19:01 +0300)]
Backport fixes to LLVM 4.0 ARM codegen bugs

So ARM had quite a few codegen bugs on LLVM 4.0 which are fixed on LLVM
trunk. This backports 5 of them:
r297871 - ARM: avoid clobbering register in v6 jump-table expansion.
    - fixes rust-lang/rust#42248
r294949 - [Thumb-1] TBB generation: spot redefinitions of index
r295816 - [ARM] Fix constant islands pass.
r300870 - [Thumb-1] Fix corner cases for compressed jump tables
r302650 - [IfConversion] Add missing check in
IfConversion/canFallThroughTo
    - unblocks rust-lang/rust#39409

7 years agoSort entries of SUMMARY.md alphabetically
est31 [Sat, 17 Jun 2017 19:54:09 +0000 (21:54 +0200)]
Sort entries of SUMMARY.md alphabetically

7 years agoRemove SUMMARY.md of the unstable book as its autogenerated
est31 [Sat, 17 Jun 2017 19:40:22 +0000 (21:40 +0200)]
Remove SUMMARY.md of the unstable book as its autogenerated

Its being autogenerated now, as of PR #42612.
It seems I forgot to remove it.

7 years agoAuto merge of #42676 - alexcrichton:update-cargo, r=Mark-Simulacrum
bors [Sun, 18 Jun 2017 21:10:33 +0000 (21:10 +0000)]
Auto merge of #42676 - alexcrichton:update-cargo, r=Mark-Simulacrum

Update cargo/rls submodules and dependencies

Brings in a few regression fixes on the Cargo side, updates the rls to work
with the newer Cargo, and also updates other crates.io dependencies to pull in
various bug fixes and such.

7 years agoUpdate UI tests to be platform independent
Mark Simulacrum [Sun, 4 Jun 2017 13:02:05 +0000 (07:02 -0600)]
Update UI tests to be platform independent

7 years agoAuto merge of #42738 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Sun, 18 Jun 2017 17:29:58 +0000 (17:29 +0000)]
Auto merge of #42738 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 7 pull requests

- Successful merges: #42695, #42714, #42720, #42723, #42730, #42731, #42734
- Failed merges: #42722

7 years agoUpdate transmute size lints.
Mark Simulacrum [Mon, 29 May 2017 23:22:41 +0000 (17:22 -0600)]
Update transmute size lints.

Also moves a few transmute tests to UI tests to better test their
output.

7 years agoRollup merge of #42734 - MaloJaffre:tests, r=Mark-Simulacrum
Mark Simulacrum [Sun, 18 Jun 2017 16:34:14 +0000 (10:34 -0600)]
Rollup merge of #42734 - MaloJaffre:tests, r=Mark-Simulacrum

Add tests for various issues

Fixes #11740.
Fixes #19601.
Fixes #22603
Fixes #22789.
Fixes #26614.

r? @Mark-Simulacrum.

7 years agoRollup merge of #42731 - MaloJaffre:issue-24889, r=Mark-Simulacrum
Mark Simulacrum [Sun, 18 Jun 2017 16:34:13 +0000 (10:34 -0600)]
Rollup merge of #42731 - MaloJaffre:issue-24889, r=Mark-Simulacrum

Add test for #24889

Fixes #24889.
r? @Mark-Simulacrum (Thanks for the instructions).

7 years agoRollup merge of #42730 - VBChunguk:boxed-wild-pattern, r=eddyb
Mark Simulacrum [Sun, 18 Jun 2017 16:34:12 +0000 (10:34 -0600)]
Rollup merge of #42730 - VBChunguk:boxed-wild-pattern, r=eddyb

Use T as the subpattern type of Box<T>

The subpattern type of boxes being nil does not make sense because of box patterns. They should have their inner type as the subpattern type.

Fixes #42679, which describes ICE caused by the bug.

7 years agoRollup merge of #42723 - ubsan:master, r=QuietMisdreavus
Mark Simulacrum [Sun, 18 Jun 2017 16:34:11 +0000 (10:34 -0600)]
Rollup merge of #42723 - ubsan:master, r=QuietMisdreavus

Add `_` to the list of keywords

also, make sure the keyword table is correctly spaced

note: the reference also needs to be updated. This is not the only way to do this in the grammar, but it's my preferred way.