]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoRollup merge of #44595 - budziq:stabilize_compiler_fences, r=alexcrichton
Tim Neumann [Sun, 17 Sep 2017 11:19:09 +0000 (13:19 +0200)]
Rollup merge of #44595 - budziq:stabilize_compiler_fences, r=alexcrichton

stabilized compiler_fences (fixes #41091)

I did not know what to proceed with "unstable-book" entry. The feature would no longer be unstable so I have deleted it. If it was the wrong call I'll revert it (unfortunately his case is not described in the CONTRIBUTING.md).

6 years agoRollup merge of #44567 - budziq:stabilize_iterator_for_each, r=alexcrichton
Tim Neumann [Sun, 17 Sep 2017 11:19:08 +0000 (13:19 +0200)]
Rollup merge of #44567 - budziq:stabilize_iterator_for_each, r=alexcrichton

stabilized iterator_for_each (closes #42986)

Also updated clippy and rls as these use the iterator_for_each

I've made my first PR's today so most likely I've done something wrong. Sorry about that!

6 years agoRollup merge of #44562 - eddyb:ugh-rustdoc, r=nikomatsakis
Tim Neumann [Sun, 17 Sep 2017 11:19:07 +0000 (13:19 +0200)]
Rollup merge of #44562 - eddyb:ugh-rustdoc, r=nikomatsakis

rustdoc: pretty-print Unevaluated expressions in types.

Fixes #44555.

r? @nikomatsakis

6 years agoRollup merge of #44553 - qmx:refactor-remove-overzealous-box-szero-optimization,...
Tim Neumann [Sun, 17 Sep 2017 11:19:06 +0000 (13:19 +0200)]
Rollup merge of #44553 - qmx:refactor-remove-overzealous-box-szero-optimization, r=arielb1

remove overzealous Box<ZeroSizeType> optimization

6 years agoRollup merge of #44549 - gaurikholkar:master, r=arielb1
Tim Neumann [Sun, 17 Sep 2017 11:19:05 +0000 (13:19 +0200)]
Rollup merge of #44549 - gaurikholkar:master, r=arielb1

extend E0623 for earlybound and latebound for structs

This fixes #44508

r? @nikomatsakis

6 years agoRollup merge of #44533 - nrc:rustfmt-submod, r=alexcrichton
Tim Neumann [Sun, 17 Sep 2017 11:19:04 +0000 (13:19 +0200)]
Rollup merge of #44533 - nrc:rustfmt-submod, r=alexcrichton

Add Rustfmt

r? @alexcrichton

6 years agoRollup merge of #44509 - tamird:remove-rustbuild-feature, r=nikomatsakis
Tim Neumann [Sun, 17 Sep 2017 11:19:03 +0000 (13:19 +0200)]
Rollup merge of #44509 - tamird:remove-rustbuild-feature, r=nikomatsakis

Update compiler-builtins

~~I can't tell if this was ever used, but it's not used today.~~

See commits.

6 years agoRollup merge of #44397 - GuillaumeGomez:codeblock-color, r=QuietMisdreavus
Tim Neumann [Sun, 17 Sep 2017 11:19:02 +0000 (13:19 +0200)]
Rollup merge of #44397 - GuillaumeGomez:codeblock-color, r=QuietMisdreavus

Codeblock color

<img width="1440" alt="screen shot 2017-09-07 at 21 53 58" src="https://user-images.githubusercontent.com/3050060/30183045-4319108e-9419-11e7-98da-da54952cab37.png">

This screenshot has been generated from:

```rust
/// foo
///
/// ```compile_fail
/// foo();
/// ```
///
/// ```ignore
/// goo();
/// ```
///
/// ```
/// let x = 0;
/// ```
pub fn bar() -> usize { 2 }
```

r? @QuietMisdreavus
cc @rust-lang/docs

6 years agoRollup merge of #44381 - jessicah:haiku-ci, r=alexcrichton
Tim Neumann [Sun, 17 Sep 2017 11:19:01 +0000 (13:19 +0200)]
Rollup merge of #44381 - jessicah:haiku-ci, r=alexcrichton

ci: introduce haiku x86_64 builder

6 years agoRollup merge of #44088 - bjorn3:better_trace_macros, r=jseyfried
Tim Neumann [Sun, 17 Sep 2017 11:19:00 +0000 (13:19 +0200)]
Rollup merge of #44088 - bjorn3:better_trace_macros, r=jseyfried

Fix "new trace_macros doesn't work if there's an error during expansion"

Fixes #43493

6 years agoRollup merge of #44073 - murarth:rc-into-raw-unsized, r=alexcrichton
Tim Neumann [Sun, 17 Sep 2017 11:18:59 +0000 (13:18 +0200)]
Rollup merge of #44073 - murarth:rc-into-raw-unsized, r=alexcrichton

Implement `Arc`/`Rc` raw pointer conversions for `?Sized`

* Add `T: ?Sized` bound to {`Arc`,`Rc`}::{`from_raw`,`into_raw`}

6 years agoAuto merge of #44641 - alexcrichton:disable-more-osx-assertions, r=Mark-Simulacrum
bors [Sun, 17 Sep 2017 05:19:00 +0000 (05:19 +0000)]
Auto merge of #44641 - alexcrichton:disable-more-osx-assertions, r=Mark-Simulacrum

ci: Disable rustc debug assertions on OSX

This commit disables debug assertions for OSX in an effort to improve cycle time
on OSX. It looks like #44610 didn't shave off quite as much time as desired so
let's see how much this helps.

6 years agoAuto merge of #44634 - alexcrichton:rollup, r=alexcrichton
bors [Sun, 17 Sep 2017 01:51:55 +0000 (01:51 +0000)]
Auto merge of #44634 - alexcrichton:rollup, r=alexcrichton

Rollup of 19 pull requests

- Successful merges: #44273, #44356, #44395, #44531, #44537, #44542, #44560, #44567, #44574, #44577, #44586, #44589, #44590, #44593, #44598, #44606, #44609, #44616, #44631
- Failed merges:

6 years agoci: Disable rustc debug assertions on OSX
Alex Crichton [Sun, 17 Sep 2017 00:25:12 +0000 (17:25 -0700)]
ci: Disable rustc debug assertions on OSX

This commit disables debug assertions for OSX in an effort to improve cycle time
on OSX. It looks like #44610 didn't shave off quite as much time as desired so
let's see how much this helps.

6 years agoRollup merge of #44631 - kennytm:travis-conditional-jobs, r=alexcrichton
Alex Crichton [Sat, 16 Sep 2017 14:17:04 +0000 (09:17 -0500)]
Rollup merge of #44631 - kennytm:travis-conditional-jobs, r=alexcrichton

Make use of Travis's conditional jobs.

Conditional jobs: https://docs.travis-ci.com/user/conditional-builds-stages-jobs/#Conditional-Jobs.

Jobs not matching the condition will not be scheduled at all. This allows us to get rid of `$ALLOW_PR`/`$ALLOW_TRY`/`$SKIP_BUILD` in `.travis.yml`, and perfectly prevent spurious PR failures due to flaky macOS machines.

6 years agoRollup merge of #44616 - alexcrichton:rustdoc-fix-again-whee, r=Mark-Simulacrum
Alex Crichton [Sat, 16 Sep 2017 14:17:03 +0000 (09:17 -0500)]
Rollup merge of #44616 - alexcrichton:rustdoc-fix-again-whee, r=Mark-Simulacrum

rustbuild: Fix test "test rustdoc" invocation

Previously it would use the librustc output directory which would cause rustdoc
to get entirely recompiled, whereas the intention is that it uses the
already-compiled artifacts from building rustdoc itself, using the tool output
directory

6 years agoRollup merge of #44609 - jonhoo:hash-alloc, r=steveklabnik
Alex Crichton [Sat, 16 Sep 2017 14:17:02 +0000 (09:17 -0500)]
Rollup merge of #44609 - jonhoo:hash-alloc, r=steveklabnik

Mention that HashMap::new and HashSet::new do not allocate

The docs for `HashMap::with_capacity` and `HashSet::with_capacity` already say that
> If `capacity` is 0, the hash map/set will not allocate.
However, the docs for `::new` do not say that the initial capacity is 0, and thus promise that a call to `::new` alone does not allocate. This PR fixes that.

6 years agoRollup merge of #44606 - alexcrichton:update-cmake, r=Mark-Simulacrum
Alex Crichton [Sat, 16 Sep 2017 14:17:01 +0000 (09:17 -0500)]
Rollup merge of #44606 - alexcrichton:update-cmake, r=Mark-Simulacrum

rustbuild: Update `cmake` dependency

Should help suppress some warnings from various repos as `cmake` in the newest
version disables warnings by default.

6 years agoRollup merge of #44598 - RalfJung:installer, r=alexcrichton
Alex Crichton [Sat, 16 Sep 2017 14:17:00 +0000 (09:17 -0500)]
Rollup merge of #44598 - RalfJung:installer, r=alexcrichton

update rust-installer

Fixes <https://github.com/rust-lang/rust/issues/44594>

r? @alexcrichton

6 years agoRollup merge of #44593 - budziq:stabilize_ord_max_min, r=alexcrichton
Alex Crichton [Sat, 16 Sep 2017 14:16:59 +0000 (09:16 -0500)]
Rollup merge of #44593 - budziq:stabilize_ord_max_min, r=alexcrichton

stabilized ord_max_min (fixes #25663)

6 years agoRollup merge of #44590 - oli-obk:allow_unused_mut_on_vars, r=eddyb
Alex Crichton [Sat, 16 Sep 2017 14:16:58 +0000 (09:16 -0500)]
Rollup merge of #44590 - oli-obk:allow_unused_mut_on_vars, r=eddyb

Get `allow(unused_mut)` to work on `let` bindings

fixes #40491

6 years agoRollup merge of #44589 - makotokato:thumb2, r=alexcrichton
Alex Crichton [Sat, 16 Sep 2017 14:16:57 +0000 (09:16 -0500)]
Rollup merge of #44589 - makotokato:thumb2, r=alexcrichton

Require +thumb-mode to generate thumb2 code for Android/armv7-a

I am investigating rust's code generation into Gecko by https://bugzilla.mozilla.org/show_bug.cgi?id=1399337.

armv7-linux-androideabi target uses `+v7,+thumb2,+vfp3,+d16,-neon` as target-feature.  But `+thumb2` only doesn't generate thumb2 code.  To generate thumb2 code, it requires `+thumb-mode`.  So we should add it for armv7-linux-androideabi.

r? @alexcrichton

6 years agoRollup merge of #44586 - alexcrichton:smaller-query, r=michaelwoerister
Alex Crichton [Sat, 16 Sep 2017 14:16:56 +0000 (09:16 -0500)]
Rollup merge of #44586 - alexcrichton:smaller-query, r=michaelwoerister

rustc: Preallocate when building the dep graph

This commit alters the `query` function in the dep graph module to preallocate
memory using `with_capacity` instead of relying on automatic growth. Discovered
in #44576 it was found that for the syntex_syntax clean incremental benchmark
the peak memory usage was found when the dep graph was being saved, particularly
the `DepGraphQuery` data structure itself. PRs like #44142 which add more
queries end up just making this much larger!

I didn't see an immediately obvious way to reduce the size of the
`DepGraphQuery` object, but it turns out that `with_capacity` helps quite a bit!
Locally 831 MB was used [before] this commit, and 770 MB is in use at the peak
of the compiler [after] this commit. That's a nice 7.5% improvement! This won't
quite make up for the losses in #44142 but I figured it's a good start.

[before]: https://gist.github.com/alexcrichton/2d2b9c7a65503761925c5a0bcfeb0d1e
[before]: https://gist.github.com/alexcrichton/6da51f2a6184bfb81694cc44f06deb5b

6 years agoRollup merge of #44577 - cuviper:flat_map-fold, r=alexcrichton
Alex Crichton [Sat, 16 Sep 2017 14:16:55 +0000 (09:16 -0500)]
Rollup merge of #44577 - cuviper:flat_map-fold, r=alexcrichton

Customize `<FlatMap as Iterator>::fold`

`FlatMap` can use internal iteration for its `fold`, which shows a
performance advantage in the new benchmarks:

    test iter::bench_flat_map_chain_ref_sum ... bench:   4,354,111 ns/iter (+/- 108,871)
    test iter::bench_flat_map_chain_sum     ... bench:     468,167 ns/iter (+/- 2,274)
    test iter::bench_flat_map_ref_sum       ... bench:     449,616 ns/iter (+/- 6,257)
    test iter::bench_flat_map_sum           ... bench:     348,010 ns/iter (+/- 1,227)

... where the "ref" benches are using `by_ref()` that isn't optimized.
So this change shows a decent advantage on its own, but much more when
combined with a `chain` iterator that also optimizes `fold`.

6 years agoRollup merge of #44574 - alexcrichton:new-sccache-region, r=aidanhs
Alex Crichton [Sat, 16 Sep 2017 14:16:54 +0000 (09:16 -0500)]
Rollup merge of #44574 - alexcrichton:new-sccache-region, r=aidanhs

travis: Move sccache to the us-west-1 region

Most of the other rust-lang buckets are in us-west-1 and I think the original
bucket was just accidentally created in the us-east-1 region. Let's consolidate
by moving it to the same location as the rest of our buckets.

6 years agoRollup merge of #44560 - qmx:import-TyCtxt, r=eddyb
Alex Crichton [Sat, 16 Sep 2017 14:16:52 +0000 (09:16 -0500)]
Rollup merge of #44560 - qmx:import-TyCtxt, r=eddyb

bring TyCtxt into scope

got comments both from @eddyb and @nikomatsakis (via https://github.com/rust-lang/rust/pull/44505) that we should always put `TyCtxt` in scope

should I just go and import it at other places in the codebase or we just keep doing small improvements?

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 agoImplement `Arc`/`Rc` raw pointer conversions for `?Sized`
Murarth [Thu, 24 Aug 2017 05:50:00 +0000 (22:50 -0700)]
Implement `Arc`/`Rc` raw pointer conversions for `?Sized`

* Add `T: ?Sized` bound to {`Arc`,`Rc`}::{`from_raw`,`into_raw`}

6 years agoAuto merge of #43989 - circuitfox:sliceext-binary-search-sig, r=alexcrichton
bors [Sat, 16 Sep 2017 22:20:55 +0000 (22:20 +0000)]
Auto merge of #43989 - circuitfox:sliceext-binary-search-sig, r=alexcrichton

Remove Borrow bound from SliceExt::binary_search

#37761 added a Borrow bound to `binary_search` and `binary_search_by_key` in `core::SliceExt`, but did not add it to the methods in `std::slice`. #41590 attempted to add this bound to `std::slice` but was not merged due to breakage. This PR removes the bound in `core::SliceExt`, so that these methods will have the same signature in `core` and `std`.

Fixes #41561

6 years agostabilized iterator_for_each (closes #42986)
Michal Budzynski [Fri, 15 Sep 2017 15:06:49 +0000 (17:06 +0200)]
stabilized iterator_for_each (closes #42986)

updated clippy and rls as it uses the iterator_for_each

6 years agoAdded more text from unstable-book to `compiler_fence` docs
Michal Budzynski [Sat, 16 Sep 2017 20:16:49 +0000 (22:16 +0200)]
Added more text from unstable-book to `compiler_fence` docs

6 years agoAdded example to `compiler_fence` docs taken from unstable-book
Michal Budzynski [Fri, 15 Sep 2017 15:03:09 +0000 (17:03 +0200)]
Added example to `compiler_fence` docs taken from unstable-book

6 years agostabilized compiler_fences (fixes #41091)
Michal Budzynski [Fri, 15 Sep 2017 12:51:44 +0000 (14:51 +0200)]
stabilized compiler_fences (fixes #41091)

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 agoMake use of Travis's conditional jobs.
kennytm [Sat, 16 Sep 2017 11:28:08 +0000 (19:28 +0800)]
Make use of Travis's conditional jobs.

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 agoci: haiku: wrap lines as necessary for tidy.
Jessica Hamilton [Sat, 16 Sep 2017 06:00:40 +0000 (01:00 -0500)]
ci: haiku: wrap lines as necessary for tidy.

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 agoci: haiku: rename llvm-config to address tidy issues.
Jessica Hamilton [Sat, 16 Sep 2017 02:51:50 +0000 (21:51 -0500)]
ci: haiku: rename llvm-config to address tidy issues.

6 years agoci: move dist-x86_64-haiku into disabled.
Jessica Hamilton [Sat, 16 Sep 2017 00:04:24 +0000 (19:04 -0500)]
ci: move dist-x86_64-haiku into disabled.

6 years agorustbuild: Fix test "test rustdoc" invocation
Alex Crichton [Fri, 15 Sep 2017 22:28:59 +0000 (15:28 -0700)]
rustbuild: Fix test "test rustdoc" invocation

Previously it would use the librustc output directory which would cause rustdoc
to get entirely recompiled, whereas the intention is that it uses the
already-compiled artifacts from building rustdoc itself, using the tool output
directory

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 agoHashMap::new and HashSet::new do not allocate
Jon Gjengset [Fri, 15 Sep 2017 17:32:45 +0000 (13:32 -0400)]
HashMap::new and HashSet::new do not allocate

6 years agoAdd a specific test for `FlatMap::fold`
Josh Stone [Fri, 15 Sep 2017 17:30:56 +0000 (10:30 -0700)]
Add a specific test for `FlatMap::fold`

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: Update `cmake` dependency
Alex Crichton [Fri, 15 Sep 2017 16:37:52 +0000 (09:37 -0700)]
rustbuild: Update `cmake` dependency

Should help suppress some warnings from various repos as `cmake` in the newest
version disables warnings by default.

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 agoupdate rust-installer
Ralf Jung [Fri, 15 Sep 2017 14:29:21 +0000 (16:29 +0200)]
update rust-installer

6 years agostabilized ord_max_min (fixes #25663)
Michal Budzynski [Fri, 15 Sep 2017 10:54:03 +0000 (12:54 +0200)]
stabilized ord_max_min (fixes #25663)

6 years agoGet `allow(unused_mut)` to work on `let` bindings
Oliver Schneider [Fri, 15 Sep 2017 08:36:14 +0000 (10:36 +0200)]
Get `allow(unused_mut)` to work on `let` bindings

fixes #40491

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 agoRequire +thumb-mode to generate thumb2 code for Android/armv7-a
Makoto Kato [Fri, 15 Sep 2017 05:42:03 +0000 (14:42 +0900)]
Require +thumb-mode to generate thumb2 code for Android/armv7-a

6 years agorustc: Preallocate when building the dep graph
Alex Crichton [Fri, 15 Sep 2017 04:28:55 +0000 (21:28 -0700)]
rustc: Preallocate when building the dep graph

This commit alters the `query` function in the dep graph module to preallocate
memory using `with_capacity` instead of relying on automatic growth. Discovered
in #44576 it was found that for the syntex_syntax clean incremental benchmark
the peak memory usage was found when the dep graph was being saved, particularly
the `DepGraphQuery` data structure itself. PRs like #44142 which add more
queries end up just making this much larger!

I didn't see an immediately obvious way to reduce the size of the
`DepGraphQuery` object, but it turns out that `with_capacity` helps quite a bit!
Locally 831 MB was used [before] this commit, and 770 MB is in use at the peak
of the compiler [after] this commit. That's a nice 7.5% improvement! This won't
quite make up for the losses in #44142 but I figured it's a good start.

[before]: https://gist.github.com/alexcrichton/2d2b9c7a65503761925c5a0bcfeb0d1e
[before]: https://gist.github.com/alexcrichton/6da51f2a6184bfb81694cc44f06deb5b

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 agobring Ty into scope
Douglas Campos [Fri, 15 Sep 2017 01:44:23 +0000 (21:44 -0400)]
bring Ty into scope

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 agobring TyCtxt into scope
Douglas Campos [Fri, 15 Sep 2017 01:13:36 +0000 (21:13 -0400)]
bring TyCtxt into scope

6 years agoCustomize `<FlatMap as Iterator>::fold`
Josh Stone [Thu, 14 Sep 2017 20:51:32 +0000 (13:51 -0700)]
Customize `<FlatMap as Iterator>::fold`

`FlatMap` can use internal iteration for its `fold`, which shows a
performance advantage in the new benchmarks:

    test iter::bench_flat_map_chain_ref_sum ... bench:   4,354,111 ns/iter (+/- 108,871)
    test iter::bench_flat_map_chain_sum     ... bench:     468,167 ns/iter (+/- 2,274)
    test iter::bench_flat_map_ref_sum       ... bench:     449,616 ns/iter (+/- 6,257)
    test iter::bench_flat_map_sum           ... bench:     348,010 ns/iter (+/- 1,227)

... where the "ref" benches are using `by_ref()` that isn't optimized.
So this change shows a decent advantage on its own, but much more when
combined with a `chain` iterator that also optimizes `fold`.

6 years agotravis: Move sccache to the us-west-1 region
Alex Crichton [Thu, 14 Sep 2017 20:17:25 +0000 (13:17 -0700)]
travis: Move sccache to the us-west-1 region

Most of the other rust-lang buckets are in us-west-1 and I think the original
bucket was just accidentally created in the us-east-1 region. Let's consolidate
by moving it to the same location as the rest of our buckets.

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 agoDelete fn.rs
Gauri Kholkar [Thu, 14 Sep 2017 12:06:57 +0000 (17:36 +0530)]
Delete fn.rs

Removing unwanted file merged in  a previous commit

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 agorustdoc: pretty-print Unevaluated expressions in types.
Eduard-Mihai Burtescu [Thu, 14 Sep 2017 06:45:07 +0000 (09:45 +0300)]
rustdoc: pretty-print Unevaluated expressions in types.

6 years agoadd ui tests for EBR
gaurikholkar [Thu, 14 Sep 2017 04:57:41 +0000 (10:27 +0530)]
add ui tests for EBR