]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agotweak unresolved label suggestion
Andy Russell [Thu, 4 Apr 2019 04:43:58 +0000 (00:43 -0400)]
tweak unresolved label suggestion

Only suggest label names in the same hygiene context, and use a
structured suggestion.

5 years agoAuto merge of #59182 - hug-dev:armv8m-base-hf, r=alexcrichton
bors [Wed, 3 Apr 2019 14:23:13 +0000 (14:23 +0000)]
Auto merge of #59182 - hug-dev:armv8m-base-hf, r=alexcrichton

Add dist builder for Armv8-M Baseline and HF

This commit adds the Armv8-M Baseline and Armv8-M Mainline with
FPU targets in the list of targets that
get their dist components built. It also update the build-manifest
so that this target gets also its dist components uploaded.

Made possible with the recent change merged in `compiler-builtins`:
rust-lang-nursery/compiler-builtins#276

A new `compiler-builtins` might be necessary for successfull compilation of the artefacts of those targets.

5 years agoAdd dist builder for Armv8-M Baseline and HF
Hugues de Valon [Tue, 12 Mar 2019 13:58:05 +0000 (13:58 +0000)]
Add dist builder for Armv8-M Baseline and HF

This commit adds the Armv8-M Baseline and Armv8-M Mainline with
FPU targets in the list of targets that
get their dist components built. It also update the build-manifest
so that this target gets also its dist components uploaded.

5 years agoAuto merge of #58458 - nnethercote:tweak-Span-encoding, r=petrochenkov
bors [Wed, 3 Apr 2019 11:27:38 +0000 (11:27 +0000)]
Auto merge of #58458 - nnethercote:tweak-Span-encoding, r=petrochenkov

Tweak `Span` encoding.

Failing to fit `base` is more common than failing to fit `len`.

5 years agoAuto merge of #59657 - Centril:rollup-w5p98mc, r=Centril
bors [Wed, 3 Apr 2019 05:30:20 +0000 (05:30 +0000)]
Auto merge of #59657 - Centril:rollup-w5p98mc, r=Centril

Rollup of 4 pull requests

Successful merges:

 - #55448 (Add 'partition_at_index/_by/_by_key' for slices.)
 - #59186 (improve worst-case performance of BTreeSet intersection v3)
 - #59514 (Remove adt_def from projections and downcasts in MIR)
 - #59630 (Shrink `mir::Statement`.)

Failed merges:

r? @ghost

5 years agoRollup merge of #59630 - nnethercote:shrink-mir-Statement, r=pnkfelix
Mazdak Farrokhzad [Wed, 3 Apr 2019 02:36:14 +0000 (04:36 +0200)]
Rollup merge of #59630 - nnethercote:shrink-mir-Statement, r=pnkfelix

Shrink `mir::Statement`.

The `InlineAsm` variant is extremely rare, and `mir::Statement` often
contributes significantly to peak memory usage.

5 years agoRollup merge of #59514 - tmandry:remove-adt-def-from-projection-elem, r=eddyb
Mazdak Farrokhzad [Wed, 3 Apr 2019 02:36:12 +0000 (04:36 +0200)]
Rollup merge of #59514 - tmandry:remove-adt-def-from-projection-elem, r=eddyb

Remove adt_def from projections and downcasts in MIR

As part of optimizing generator layouts in MIR, we'd like to allow downcasting generators to variants which do not have a corresponding `def_id`, since they are created by the compiler.

This refactor hopes to allow that, without regressing perf.

r? @eddyb

5 years agoRollup merge of #59186 - ssomers:btreeset_intersection_revisited_again, r=KodrAus
Mazdak Farrokhzad [Wed, 3 Apr 2019 02:36:11 +0000 (04:36 +0200)]
Rollup merge of #59186 - ssomers:btreeset_intersection_revisited_again, r=KodrAus

improve worst-case performance of BTreeSet intersection v3

Variation of [#59078](https://github.com/rust-lang/rust/pull/59078) with `Intersection` remaining a struct

r? @scottmcm

5 years agoRollup merge of #55448 - Mokosha:SortAtIndex, r=bluss
Mazdak Farrokhzad [Wed, 3 Apr 2019 02:36:09 +0000 (04:36 +0200)]
Rollup merge of #55448 - Mokosha:SortAtIndex, r=bluss

Add 'partition_at_index/_by/_by_key' for slices.

This is an analog to C++'s std::nth_element (a.k.a. quickselect).

Corresponds to tracking bug #55300.

5 years agoTweak `Span` encoding.
Nicholas Nethercote [Thu, 14 Feb 2019 08:17:07 +0000 (19:17 +1100)]
Tweak `Span` encoding.

Failing to fit `base` is more common than failing to fit `len`.

5 years agoShrink `mir::Statement`.
Nicholas Nethercote [Tue, 2 Apr 2019 09:07:09 +0000 (20:07 +1100)]
Shrink `mir::Statement`.

The `InlineAsm` variant is extremely rare, and `mir::Statement` often
contributes significantly to peak memory usage.

5 years agoAuto merge of #59638 - alexcrichton:less-assertions, r=pietroalbini
bors [Tue, 2 Apr 2019 21:40:20 +0000 (21:40 +0000)]
Auto merge of #59638 - alexcrichton:less-assertions, r=pietroalbini

ci: Disable llvm/debug assertions on x86_64-mingw

Tracked at #59637 for re-enabling this commit disables assertions to
hopefully bring the runtime for this builder under control.

5 years agoRemove adt_def from PlaceTy and make it a struct
Tyler Mandry [Fri, 29 Mar 2019 02:08:31 +0000 (19:08 -0700)]
Remove adt_def from PlaceTy and make it a struct

5 years agoReplace adt_def with name in mir::ProjectionElem::Downcast
Tyler Mandry [Fri, 29 Mar 2019 01:00:17 +0000 (18:00 -0700)]
Replace adt_def with name in mir::ProjectionElem::Downcast

5 years agoci: Disable llvm/debug assertions on x86_64-mingw
Alex Crichton [Tue, 2 Apr 2019 18:02:44 +0000 (11:02 -0700)]
ci: Disable llvm/debug assertions on x86_64-mingw

Tracked at #59637 for re-enabling this commit disables assertions to
hopefully bring the runtime for this builder under control.

5 years agoAuto merge of #59636 - Centril:rollup, r=Centril
bors [Tue, 2 Apr 2019 16:26:10 +0000 (16:26 +0000)]
Auto merge of #59636 - Centril:rollup, r=Centril

Rollup of 4 pull requests

Successful merges:

 - #59166 (resolve: collect trait aliases along with traits)
 - #59341 (Fix custom relative libdir)
 - #59446 (Fix stack overflow when generating debuginfo for 'recursive' type)
 - #59529 (Added documentation on the remainder (Rem) operator for floating points.)

Failed merges:

r? @ghost

5 years agoRollup merge of #59529 - DevQps:improve-rem-docs, r=cuviper
Mazdak Farrokhzad [Tue, 2 Apr 2019 16:25:17 +0000 (18:25 +0200)]
Rollup merge of #59529 - DevQps:improve-rem-docs, r=cuviper

Added documentation on the remainder (Rem) operator for floating points.

# Description

As has been explained in #57738 the remainder operator on floating points is not clear.
This PR requests adds some information on how the `Rem` / remainder operator on floating points works.

Note also that this description is for both `Rem<f32> for f32` and `Rem<f64> for f64` implementations.

Ps. I wasn't really sure on how to formulate things. So please suggest changes if you have better idea's!

closes #57738

5 years agoRollup merge of #59446 - Aaron1011:fix/debuginfo-overflow, r=oli-obk
Mazdak Farrokhzad [Tue, 2 Apr 2019 16:25:15 +0000 (18:25 +0200)]
Rollup merge of #59446 - Aaron1011:fix/debuginfo-overflow, r=oli-obk

Fix stack overflow when generating debuginfo for 'recursive' type

By using 'impl trait', it's possible to create a self-referential
type as follows:

fn foo() -> impl Copy { foo }

This is a function which returns itself.
Normally, the signature of this function would be impossible
to write - it would look like 'fn foo() -> fn() -> fn() ...'
e.g. a function which returns a function, which returns a function...

Using 'impl trait' allows us to avoid writing this infinitely long
type. While it's useless for practical purposes, it does compile and run

However, issues arise when we try to generate llvm debuginfo for such a
type. All 'impl trait' types (e.g. ty::Opaque) are resolved when we
generate debuginfo, which can lead to us recursing back to the original
'fn' type when we try to process its return type.

To resolve this, I've modified debuginfo generation to account for these
kinds of weird types. Unfortunately, there's no 'correct' debuginfo that
we can generate - 'impl trait' does not exist in debuginfo, and this
kind of recursive type is impossible to directly represent.

To ensure that we emit *something*, this commit emits dummy
debuginfo/type names whenever it encounters a self-reference. In
practice, this should never happen - it's just to ensure that we can
emit some kind of debuginfo, even if it's not particularly meaningful

Fixes #58463

5 years agoRollup merge of #59341 - o01eg:use-custom-libdir, r=Mark-Simulacrum
Mazdak Farrokhzad [Tue, 2 Apr 2019 16:25:14 +0000 (18:25 +0200)]
Rollup merge of #59341 - o01eg:use-custom-libdir, r=Mark-Simulacrum

Fix custom relative libdir

While working on #58947 I found out relative libdir ignored during setting LD_LIBRARY_PATH.

5 years agoRollup merge of #59166 - seanmonstar:trait-alias-import, r=alexreg
Mazdak Farrokhzad [Tue, 2 Apr 2019 16:25:12 +0000 (18:25 +0200)]
Rollup merge of #59166 - seanmonstar:trait-alias-import, r=alexreg

resolve: collect trait aliases along with traits

It seems trait aliases weren't being collected as `TraitCandidates` in resolve, this should change that. (I can't compile the full compiler locally, so relying on CI...)

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

r? @alexreg

5 years agoAuto merge of #59632 - Centril:rollup, r=Centril
bors [Tue, 2 Apr 2019 13:06:12 +0000 (13:06 +0000)]
Auto merge of #59632 - Centril:rollup, r=Centril

Rollup of 8 pull requests

Successful merges:

 - #59262 (Remove duplicated code from Iterator::{ne, lt, le, gt, ge})
 - #59286 (Refactor async fn return type lowering)
 - #59444 (Implement useful steps_between for all integers)
 - #59452 (Speed up rustdoc run a bit)
 - #59533 (Support allocating iterators with arenas)
 - #59585 (Fixes for shallow borrows)
 - #59607 (Renames `EvalErrorKind` to `InterpError`)
 - #59613 (SGX target: convert a bunch of panics to aborts)

Failed merges:

 - #59630 (Shrink `mir::Statement`.)

r? @ghost

5 years agoRollup merge of #59613 - jethrogb:jb/waitqueue-wait-unwind, r=alexcrichton
Mazdak Farrokhzad [Tue, 2 Apr 2019 11:47:31 +0000 (13:47 +0200)]
Rollup merge of #59613 - jethrogb:jb/waitqueue-wait-unwind, r=alexcrichton

SGX target: convert a bunch of panics to aborts

Fixes https://github.com/fortanix/rust-sgx/issues/86, https://github.com/fortanix/rust-sgx/issues/103 and in general protect preemptively against Iago attacks by aborting instead of unwinding in potentially unexpected situations.

5 years agoRollup merge of #59607 - kenta7777:renames-EvalErrorKind-to-InterpError, r=oli-obk
Mazdak Farrokhzad [Tue, 2 Apr 2019 11:47:30 +0000 (13:47 +0200)]
Rollup merge of #59607 - kenta7777:renames-EvalErrorKind-to-InterpError, r=oli-obk

Renames `EvalErrorKind` to `InterpError`

This PR renames `EvalErrorKind` to `InterpError`.
This is related to #54395.

5 years agoRollup merge of #59585 - rust-lang:shallow-borrow-fixes, r=pnkfelix
Mazdak Farrokhzad [Tue, 2 Apr 2019 11:47:28 +0000 (13:47 +0200)]
Rollup merge of #59585 - rust-lang:shallow-borrow-fixes, r=pnkfelix

Fixes for shallow borrows

* Don't promote these borrows if we're going to remove them before
  codegen
* Correctly mark unreachable code

5 years agoRollup merge of #59533 - Zoxc:arena-slices, r=michaelwoerister
Mazdak Farrokhzad [Tue, 2 Apr 2019 11:47:27 +0000 (13:47 +0200)]
Rollup merge of #59533 - Zoxc:arena-slices, r=michaelwoerister

Support allocating iterators with arenas

Split out from https://github.com/rust-lang/rust/pull/57173.

r? @michaelwoerister

5 years agoRollup merge of #59452 - GuillaumeGomez:speedup-rustdoc, r=QuietMisdreavus
Mazdak Farrokhzad [Tue, 2 Apr 2019 11:47:25 +0000 (13:47 +0200)]
Rollup merge of #59452 - GuillaumeGomez:speedup-rustdoc, r=QuietMisdreavus

Speed up rustdoc run a bit

r? @QuietMisdreavus

5 years agoRollup merge of #59444 - cuviper:steps_between, r=scottmcm
Mazdak Farrokhzad [Tue, 2 Apr 2019 11:47:24 +0000 (13:47 +0200)]
Rollup merge of #59444 - cuviper:steps_between, r=scottmcm

Implement useful steps_between for all integers

We can use `usize::try_from` to convert steps from any size of integer.
This enables a meaningful `size_hint()` for larger ranges, rather than
always just `(0, None)`. Now they return the true `(len, Some(len))`
when it fits, otherwise `(usize::MAX, None)` for overflow.

5 years agoRollup merge of #59286 - cramertj:async-fn-ret-ty, r=varkor
Mazdak Farrokhzad [Tue, 2 Apr 2019 11:47:22 +0000 (13:47 +0200)]
Rollup merge of #59286 - cramertj:async-fn-ret-ty, r=varkor

Refactor async fn return type lowering

async fn now lowers directly to an existential type declaration
rather than reusing the `impl Trait` return type lowering.

As part of this, it lowers all argument-position elided lifetimes
using the in-band-lifetimes machinery, creating fresh parameter
names for each of them, using each lifetime parameter as a generic
argument to the generated existential type.

This doesn't currently successfully allow multiple
argument-position elided lifetimes since `existential type`
doesn't yet support multiple lifetimes where neither outlive
the other:
```rust
existential type Foo<'a, 'b>:; // error: ambiguous lifetime bound in `impl Trait`
fn foo<'a, 'b>(_: &'a u8, _: &'b u8) -> Foo<'a, 'b> { () }
```

This requires a separate fix.

Fix #59001
Fix #58885
Fix #55324
Fix #54974
Progress on #56238

r? @nikomatsakis

5 years agoRollup merge of #59262 - timvermeulen:iterator_cmp_dedup, r=scottmcm
Mazdak Farrokhzad [Tue, 2 Apr 2019 11:47:21 +0000 (13:47 +0200)]
Rollup merge of #59262 - timvermeulen:iterator_cmp_dedup, r=scottmcm

Remove duplicated code from Iterator::{ne, lt, le, gt, ge}

This PR delegates `Iterator::ne` to `Iterator::eq` and `Iterator::{lt, le, gt, ge}` to `Iterator::partial_cmp`.

Oddly enough, this change actually simplifies the generated assembly [in some cases](https://rust.godbolt.org/z/riBtNe), although I don't understand assembly well enough to see if the longer assembly is doing something clever.

I also added two extremely simple benchmarks:
```
// before
test iter::bench_lt               ... bench:      98,404 ns/iter (+/- 21,008)
test iter::bench_partial_cmp      ... bench:      62,437 ns/iter (+/- 5,009)

// after
test iter::bench_lt               ... bench:      61,757 ns/iter (+/- 8,770)
test iter::bench_partial_cmp      ... bench:      62,151 ns/iter (+/- 13,753)
```

I have no idea why the current `lt`/`le`/`gt`/`ge` implementations don't seem to be compiled optimally, but simply having them call `partial_cmp` seems to be an improvement.

See #44729 for a previous discussion.

5 years agoRefactor async fn return type lowering
Taylor Cramer [Thu, 14 Mar 2019 00:42:23 +0000 (17:42 -0700)]
Refactor async fn return type lowering

async fn now lowers directly to an existential type declaration
rather than reusing the `impl Trait` return type lowering.

As part of this, it lowers all argument-position elided lifetimes
using the in-band-lifetimes machinery, creating fresh parameter
names for each of them, using each lifetime parameter as a generic
argument to the generated existential type.

This doesn't currently successfully allow multiple
argument-position elided lifetimes since `existential type`
doesn't yet support multiple lifetimes where neither outlive
the other. This requires a separate fix.

5 years agoImproved the example with numbers that can be exactly represented as floats and added...
Christian [Mon, 1 Apr 2019 20:49:14 +0000 (22:49 +0200)]
Improved the example with numbers that can be exactly represented as floats and added a comment with the solution.

5 years agoAdd ensure_capacity and rename min to len
John Kåre Alsaker [Mon, 1 Apr 2019 20:35:13 +0000 (22:35 +0200)]
Add ensure_capacity and rename min to len

5 years agoUse set_len
John Kåre Alsaker [Mon, 1 Apr 2019 19:52:13 +0000 (21:52 +0200)]
Use set_len

5 years agoSupport allocating iterators with arenas
John Kåre Alsaker [Fri, 14 Dec 2018 18:02:15 +0000 (19:02 +0100)]
Support allocating iterators with arenas

5 years agoSGX target: convert a bunch of panics to aborts
Jethro Beekman [Sun, 17 Feb 2019 10:01:46 +0000 (15:31 +0530)]
SGX target: convert a bunch of panics to aborts

5 years agoAuto merge of #59606 - Centril:rollup, r=Centril
bors [Mon, 1 Apr 2019 18:37:28 +0000 (18:37 +0000)]
Auto merge of #59606 - Centril:rollup, r=Centril

Rollup of 7 pull requests

Successful merges:

 - #58507 (Add a -Z time option which prints only passes which runs once)
 - #58919 (Suggest using anonymous lifetime in `impl Trait` return)
 - #59041 (fixes rust-lang#56766)
 - #59586 (Fixed URL in cargotest::TEST_REPOS)
 - #59595 (Update rustc-guide submodule)
 - #59601 (Fix small typo)
 - #59603 (stabilize ptr::hash)

Failed merges:

r? @ghost

5 years agoresolve all in scope trait aliases, then elaborate their bounds
Sean McArthur [Fri, 15 Mar 2019 21:55:04 +0000 (14:55 -0700)]
resolve all in scope trait aliases, then elaborate their bounds

5 years agoFix typo
Aaron Hill [Mon, 1 Apr 2019 17:41:41 +0000 (13:41 -0400)]
Fix typo

5 years agorenames EvalErrorKind to InterpError
kenta7777 [Mon, 1 Apr 2019 16:02:18 +0000 (01:02 +0900)]
renames EvalErrorKind to InterpError

5 years agoRollup merge of #59603 - matklad:ptrhash, r=Centril
Mazdak Farrokhzad [Mon, 1 Apr 2019 15:29:59 +0000 (17:29 +0200)]
Rollup merge of #59603 - matklad:ptrhash, r=Centril

stabilize ptr::hash

closes #56286

5 years agoRollup merge of #59601 - kenta7777:typo-fix, r=Centril
Mazdak Farrokhzad [Mon, 1 Apr 2019 15:29:58 +0000 (17:29 +0200)]
Rollup merge of #59601 - kenta7777:typo-fix, r=Centril

Fix small typo

This PR fixes a small typo in `eq()` comments.

5 years agoRollup merge of #59595 - mark-i-m:update-rustc-guide, r=steveklabnik
Mazdak Farrokhzad [Mon, 1 Apr 2019 15:29:56 +0000 (17:29 +0200)]
Rollup merge of #59595 - mark-i-m:update-rustc-guide, r=steveklabnik

Update rustc-guide submodule

Just keeping up with the head...

r? @steveklabnik

5 years agoRollup merge of #59586 - XAMPPRocky:redirect, r=alexcrichton
Mazdak Farrokhzad [Mon, 1 Apr 2019 15:29:55 +0000 (17:29 +0200)]
Rollup merge of #59586 - XAMPPRocky:redirect, r=alexcrichton

Fixed URL in cargotest::TEST_REPOS

5 years agoRollup merge of #59041 - saleemjaffer:trait_doc_comment_better_error_msg, r=pnkfelix
Mazdak Farrokhzad [Mon, 1 Apr 2019 15:29:53 +0000 (17:29 +0200)]
Rollup merge of #59041 - saleemjaffer:trait_doc_comment_better_error_msg, r=pnkfelix

fixes rust-lang#56766

fixes #56766

5 years agoRollup merge of #58919 - estebank:impl-trait-return-lifetime, r=pnkfelix
Mazdak Farrokhzad [Mon, 1 Apr 2019 15:29:51 +0000 (17:29 +0200)]
Rollup merge of #58919 - estebank:impl-trait-return-lifetime, r=pnkfelix

Suggest using anonymous lifetime in `impl Trait` return

Fix #48467.

r? @nikomatsakis

5 years agoRollup merge of #58507 - Zoxc:time-extended, r=michaelwoerister
Mazdak Farrokhzad [Mon, 1 Apr 2019 15:29:48 +0000 (17:29 +0200)]
Rollup merge of #58507 - Zoxc:time-extended, r=michaelwoerister

Add a -Z time option which prints only passes which runs once

This ensures `-Z time-passes` fits on my screen =P

r? @michaelwoerister

5 years agoAuto merge of #59593 - pietroalbini:appveyor-version, r=alexcrichton
bors [Mon, 1 Apr 2019 15:24:15 +0000 (15:24 +0000)]
Auto merge of #59593 - pietroalbini:appveyor-version, r=alexcrichton

Print the appveyor agent version at the start of the build

[AppVeyor support asked for this.](https://help.appveyor.com/discussions/problems/19657-successful-builds-failing-with-code-259#comment_47132359)

r? @alexcrichton

5 years agostabilize ptr::hash
Aleksey Kladov [Mon, 1 Apr 2019 13:36:07 +0000 (16:36 +0300)]
stabilize ptr::hash

closes #56286

5 years agotypo fix
kenta7777 [Mon, 1 Apr 2019 10:51:12 +0000 (19:51 +0900)]
typo fix

5 years agoOnly track 'visited' state for function types
Aaron Hill [Mon, 1 Apr 2019 02:53:27 +0000 (22:53 -0400)]
Only track 'visited' state for function types

5 years agoupdate rustc-guide submodule
mark [Mon, 1 Apr 2019 00:36:00 +0000 (19:36 -0500)]
update rustc-guide submodule

5 years agoFix typos
Aaron Hill [Thu, 28 Mar 2019 16:22:08 +0000 (12:22 -0400)]
Fix typos

5 years agoAdd codegen test
Aaron Hill [Wed, 27 Mar 2019 02:38:55 +0000 (22:38 -0400)]
Add codegen test

5 years agoFix inverted panic check
Aaron Hill [Tue, 26 Mar 2019 23:49:14 +0000 (19:49 -0400)]
Fix inverted panic check

5 years agoFix stack overflow when generating debuginfo for 'recursive' type
Aaron Hill [Tue, 26 Mar 2019 19:30:41 +0000 (15:30 -0400)]
Fix stack overflow when generating debuginfo for 'recursive' type

By using 'impl trait', it's possible to create a self-referential
type as follows:

fn foo() -> impl Copy { foo }

This is a function which returns itself.
Normally, the signature of this function would be impossible
to write - it would look like 'fn foo() -> fn() -> fn() ...'
e.g. a function which returns a function, which returns a function...

Using 'impl trait' allows us to avoid writing this infinitely long
type. While it's useless for practical purposes, it does compile and run

However, issues arise when we try to generate llvm debuginfo for such a
type. All 'impl trait' types (e.g. ty::Opaque) are resolved when we
generate debuginfo, which can lead to us recursing back to the original
'fn' type when we try to process its return type.

To resolve this, I've modified debuginfo generation to account for these
kinds of weird types. Unfortunately, there's no 'correct' debuginfo that
we can generate - 'impl trait' does not exist in debuginfo, and this
kind of recursive type is impossible to directly represent.

To ensure that we emit *something*, this commit emits dummy
debuginfo/type names whenever it encounters a self-reference. In
practice, this should never happen - it's just to ensure that we can
emit some kind of debuginfo, even if it's not particularly meaningful

Fixes #58463

5 years agoAuto merge of #59507 - nnethercote:indent-with-SPACES, r=petrochenkov
bors [Sun, 31 Mar 2019 23:50:46 +0000 (23:50 +0000)]
Auto merge of #59507 - nnethercote:indent-with-SPACES, r=petrochenkov

Optimize indentation in the pretty printer.

Currently the pretty-printer calls `write!` for every space of
indentation. On some workloads the indentation level can exceed 100, and
a faster implementation reduces instruction counts by up to 7% on a few
workloads.

5 years agoci: print the appveyor agent version at the start of the build
Pietro Albini [Sun, 31 Mar 2019 21:56:09 +0000 (23:56 +0200)]
ci: print the appveyor agent version at the start of the build

5 years agoOptimize indentation in the pretty printer.
Nicholas Nethercote [Thu, 28 Mar 2019 21:32:13 +0000 (08:32 +1100)]
Optimize indentation in the pretty printer.

Currently the pretty-printer calls `write!` for every space of
indentation. On some workloads the indentation level can exceed 100, and
a faster implementation reduces instruction counts by up to 7% on a few
workloads.

5 years agoAuto merge of #59577 - dlrobertson:fix_58881, r=nagisa
bors [Sun, 31 Mar 2019 20:28:00 +0000 (20:28 +0000)]
Auto merge of #59577 - dlrobertson:fix_58881, r=nagisa

Fix LLVM IR generated for C-variadic arguments

It is possible to create malformed LLVM IR given variadic arguments that
are aggregate types. This occurs due to improper tracking of the current
argument in the functions list of arguments.

Fixes: #58881
5 years agoFix custom relative libdir.
O01eg [Sun, 31 Mar 2019 19:28:12 +0000 (22:28 +0300)]
Fix custom relative libdir.

Uses relative libdir to place libraries on all stages.
Adds verbose installation output.

5 years agoFix LLVM IR generated for C-variadic arguments
Dan Robertson [Wed, 27 Mar 2019 13:00:37 +0000 (13:00 +0000)]
Fix LLVM IR generated for C-variadic arguments

It is possible to create malformed LLVM IR given variadic arguments that
are aggregate types. This occurs due to improper tracking of the current
argument in the functions list of arguments.

5 years agoAuto merge of #59590 - Centril:rollup, r=Centril
bors [Sun, 31 Mar 2019 17:21:14 +0000 (17:21 +0000)]
Auto merge of #59590 - Centril:rollup, r=Centril

Rollup of 7 pull requests

Successful merges:

 - #58805 (Lint for redundant imports)
 - #59506 (Use platform dependent mcount function)
 - #59519 (rustc_target: factor out common fields of non-Single Variants.)
 - #59580 (Allow closure to unsafe fn coercion)
 - #59581 (Stabilize refcell_replace_swap feature)
 - #59583 (match match match match match)
 - #59587 (Remove #[doc(hidden)] from Error::type_id)

Failed merges:

r? @ghost

5 years agoRollup merge of #59587 - XAMPPRocky:master, r=Centril
Mazdak Farrokhzad [Sun, 31 Mar 2019 17:19:56 +0000 (19:19 +0200)]
Rollup merge of #59587 - XAMPPRocky:master, r=Centril

Remove #[doc(hidden)] from Error::type_id

Nominating this for beta so that `Error::type_id` has documentation in time for release.

cc @rust-lang/release @rust-lang/docs

5 years agoRollup merge of #59583 - oberien:patch-1, r=Centril
Mazdak Farrokhzad [Sun, 31 Mar 2019 17:19:54 +0000 (19:19 +0200)]
Rollup merge of #59583 - oberien:patch-1, r=Centril

match match match match match

5 years agoRollup merge of #59581 - jmcomets:stabilize-refcell_replace_swap, r=Centril
Mazdak Farrokhzad [Sun, 31 Mar 2019 17:19:53 +0000 (19:19 +0200)]
Rollup merge of #59581 - jmcomets:stabilize-refcell_replace_swap, r=Centril

Stabilize refcell_replace_swap feature

Please be kind, this is my first time contributing. :smile:

I noticed #43570 only needs stabilizing (and I need it for a side project I'm working on), so I followed the [guide](https://rust-lang.github.io/rustc-guide/stabilization_guide.html#stabilization-pr) to move things forward.

I'm happy to amend things if needed, let me know!

5 years agoRollup merge of #59580 - taiki-e:coerce-closure, r=oli-obk
Mazdak Farrokhzad [Sun, 31 Mar 2019 17:19:51 +0000 (19:19 +0200)]
Rollup merge of #59580 - taiki-e:coerce-closure, r=oli-obk

Allow closure to unsafe fn coercion

Closes #57883

5 years agoRollup merge of #59519 - eddyb:layout-variants-refactor, r=oli-obk
Mazdak Farrokhzad [Sun, 31 Mar 2019 17:19:50 +0000 (19:19 +0200)]
Rollup merge of #59519 - eddyb:layout-variants-refactor, r=oli-obk

rustc_target: factor out common fields of non-Single Variants.

@tmandry and I were discussing ways to generalize the current variants/discriminant layout to allow more fields in the "`enum`" (or another multi-variant types, such as potentially generator state, in the future), shared by all variants, than just the tag/niche discriminant.

This refactor should make it easier to extend multi-variant layouts, as nothing is duplicating anymore between "tagged enums" and "niche-filling enums".

r? @oli-obk

5 years agoRollup merge of #59506 - JohnTitor:improve-mcount, r=nagisa
Mazdak Farrokhzad [Sun, 31 Mar 2019 17:19:48 +0000 (19:19 +0200)]
Rollup merge of #59506 - JohnTitor:improve-mcount, r=nagisa

Use platform dependent mcount function

close #59097

This pull-request is based on #57244 and [here](https://github.com/llvm-mirror/clang/search?q=MCountName&unscoped_MCountName).

r? @nagisa

5 years agoRollup merge of #58805 - fabric-and-ink:redundant_import, r=petrochenkov
Mazdak Farrokhzad [Sun, 31 Mar 2019 17:19:47 +0000 (19:19 +0200)]
Rollup merge of #58805 - fabric-and-ink:redundant_import, r=petrochenkov

Lint for redundant imports

Add lint for redundant imports. The changes are suggested by @petrochenkov.

Closes #10178.

5 years agoSuggest using anonymous lifetime in `impl Trait` return without hacks
Esteban Küber [Sun, 31 Mar 2019 16:07:56 +0000 (09:07 -0700)]
Suggest using anonymous lifetime in `impl Trait` return without hacks

Fallback to `static_impl_trait` for nice error message by peeking at the
return type and the lifetime type. Point at the return type instead of
the return expr/stmt in NLL mode.

5 years agoAllow closure to unsafe fn coercion
Taiki Endo [Sun, 31 Mar 2019 15:00:43 +0000 (00:00 +0900)]
Allow closure to unsafe fn coercion

5 years agoFixed URL in cargotest::TEST_REPOS
Aaron Power [Sun, 31 Mar 2019 14:56:30 +0000 (16:56 +0200)]
Fixed URL in cargotest::TEST_REPOS

5 years agoRemove #[doc(hidden)] from Error::type_id
Aaron Power [Sun, 31 Mar 2019 14:54:05 +0000 (16:54 +0200)]
Remove #[doc(hidden)] from Error::type_id

5 years agoUse `u{1}` instead of `01`
Yuki OKUSHI [Sun, 31 Mar 2019 14:17:49 +0000 (23:17 +0900)]
Use `u{1}` instead of `01`

5 years agoFixes for shallow borrows
Matthew Jasper [Sun, 31 Mar 2019 14:14:50 +0000 (15:14 +0100)]
Fixes for shallow borrows

* Don't promote these borrows if we're going to remove them before
  codegen
* Correctly mark unreachable code

5 years agoAuto merge of #59584 - Centril:rollup, r=Centril
bors [Sun, 31 Mar 2019 14:11:11 +0000 (14:11 +0000)]
Auto merge of #59584 - Centril:rollup, r=Centril

Rollup of 4 pull requests

Successful merges:

 - #58828 (libstd: deny(elided_lifetimes_in_paths))
 - #59234 (Mention `no merge policy` in the CONTRIBUTING guide)
 - #59572 (Include bounds in generic re-ordering diagnostic)
 - #59574 (Distinguish message for external macros depending on error level)

Failed merges:

r? @ghost

5 years agoRollup merge of #59574 - JohnTitor:distinguish-error-vs-warning, r=Centril
Mazdak Farrokhzad [Sun, 31 Mar 2019 14:10:38 +0000 (16:10 +0200)]
Rollup merge of #59574 - JohnTitor:distinguish-error-vs-warning, r=Centril

Distinguish message for external macros depending on error level

fixes #57716

(I picked you because assigned to this issue.)
r? @estebank

5 years agoRollup merge of #59572 - davidtwco:issue-59508, r=varkor
Mazdak Farrokhzad [Sun, 31 Mar 2019 14:10:37 +0000 (16:10 +0200)]
Rollup merge of #59572 - davidtwco:issue-59508, r=varkor

Include bounds in generic re-ordering diagnostic

Fixes #59508.

r? @estebank
cc @varkor

5 years agoRollup merge of #59234 - stepnivlk:add-no_merge_policy, r=oli-obk
Mazdak Farrokhzad [Sun, 31 Mar 2019 14:10:36 +0000 (16:10 +0200)]
Rollup merge of #59234 - stepnivlk:add-no_merge_policy, r=oli-obk

Mention `no merge policy` in the CONTRIBUTING guide

Issue: https://github.com/rust-lang/rust/issues/59233

5 years agoRollup merge of #58828 - Centril:deny-elided_lifetimes_in_paths-libstd, r=oli-obk
Mazdak Farrokhzad [Sun, 31 Mar 2019 14:10:34 +0000 (16:10 +0200)]
Rollup merge of #58828 - Centril:deny-elided_lifetimes_in_paths-libstd, r=oli-obk

libstd: deny(elided_lifetimes_in_paths)

r? @oli-obk

5 years agomatch match match match match
Jaro Fietz [Sun, 31 Mar 2019 13:20:10 +0000 (15:20 +0200)]
match match match match match

5 years agorefcell_replace_swap: remove feature gate & obsolete documentation item
Jean-Marie Comets [Sun, 31 Mar 2019 12:50:06 +0000 (14:50 +0200)]
refcell_replace_swap: remove feature gate & obsolete documentation item

5 years agolibstd: deny(elided_lifetimes_in_paths), fixes in redox
Mazdak Farrokhzad [Sun, 31 Mar 2019 12:33:50 +0000 (14:33 +0200)]
libstd: deny(elided_lifetimes_in_paths), fixes in redox

5 years agoRemove redundant import
Fabian Drinck [Sun, 31 Mar 2019 12:11:46 +0000 (14:11 +0200)]
Remove redundant import

5 years agolibstd: deny(elided_lifetimes_in_paths), fixes in sgx
Mazdak Farrokhzad [Sun, 31 Mar 2019 10:56:42 +0000 (12:56 +0200)]
libstd: deny(elided_lifetimes_in_paths), fixes in sgx

5 years agolibstd: deny(elided_lifetimes_in_paths), fixes in wasi
Mazdak Farrokhzad [Sat, 30 Mar 2019 14:22:19 +0000 (15:22 +0100)]
libstd: deny(elided_lifetimes_in_paths), fixes in wasi

5 years agolibstd: deny(elided_lifetimes_in_paths), fixes in cloudabi
Mazdak Farrokhzad [Sat, 30 Mar 2019 09:30:57 +0000 (10:30 +0100)]
libstd: deny(elided_lifetimes_in_paths), fixes in cloudabi

5 years agolibstd: deny(elided_lifetimes_in_paths)
Mazdak Farrokhzad [Fri, 1 Mar 2019 08:34:11 +0000 (09:34 +0100)]
libstd: deny(elided_lifetimes_in_paths)

5 years agoAdd back missing import
Fabian Drinck [Sun, 31 Mar 2019 10:02:27 +0000 (12:02 +0200)]
Add back missing import

5 years agoStabilize refcell_replace_swap feature, closes #43570
Jean-Marie Comets [Sun, 31 Mar 2019 08:54:00 +0000 (10:54 +0200)]
Stabilize refcell_replace_swap feature, closes #43570

5 years agoAuto merge of #59566 - cuviper:llvm-rebuild-sha, r=Mark-Simulacrum
bors [Sun, 31 Mar 2019 01:22:07 +0000 (01:22 +0000)]
Auto merge of #59566 - cuviper:llvm-rebuild-sha, r=Mark-Simulacrum

Use the existing LLVM GitInfo for checking rebuilds

Fixes #59565

5 years agoOnly mention const generics if enabled.
David Wood [Sat, 30 Mar 2019 19:57:04 +0000 (20:57 +0100)]
Only mention const generics if enabled.

This commit updates the generic parameter re-ordering diagnostic to only
mention const generics if the feature is enabled.

5 years agoInclude bounds in generic reordering diagnostic.
David Wood [Sat, 30 Mar 2019 19:30:36 +0000 (20:30 +0100)]
Include bounds in generic reordering diagnostic.

This commit extends the existing generic re-ordering diagnostic to
include any bounds on the generic parameter, thus producing correct
suggestions.

5 years agoDistinguish depending on error level
Yuki OKUSHI [Sat, 30 Mar 2019 21:30:45 +0000 (06:30 +0900)]
Distinguish depending on error level

Remove unnecessary comment

5 years agoAuto merge of #59575 - Centril:rollup, r=Centril
bors [Sat, 30 Mar 2019 22:15:05 +0000 (22:15 +0000)]
Auto merge of #59575 - Centril:rollup, r=Centril

Rollup of 3 pull requests

Successful merges:

 - #59405 (doc: use correct body font URLs)
 - #59562 (Changed reference style in dbg macro docs.)
 - #59569 (Add book.toml with title to unstable-book doc)

Failed merges:

r? @ghost

5 years agoRollup merge of #59569 - gruberb:add-title-for-unstable-book, r=frewsxcv
Mazdak Farrokhzad [Sat, 30 Mar 2019 22:14:43 +0000 (23:14 +0100)]
Rollup merge of #59569 - gruberb:add-title-for-unstable-book, r=frewsxcv

Add book.toml with title to unstable-book doc

Adding a title to the unstable book based on https://github.com/rust-lang/rust/issues/59554

5 years agoRollup merge of #59562 - DevQps:dbg-macro-docs, r=Centril
Mazdak Farrokhzad [Sat, 30 Mar 2019 22:14:42 +0000 (23:14 +0100)]
Rollup merge of #59562 - DevQps:dbg-macro-docs, r=Centril

Changed reference style in dbg macro docs.

# Description

A continuation of Pull Request #59528 :
- Fixed method of referencing and adjusted the references as suggested by @lzutao

5 years agoRollup merge of #59405 - benesch:docs-font, r=GuillaumeGomez
Mazdak Farrokhzad [Sat, 30 Mar 2019 22:14:40 +0000 (23:14 +0100)]
Rollup merge of #59405 - benesch:docs-font, r=GuillaumeGomez

doc: use correct body font URLs

The CSS for the docs homepage (docs.rust-lang.org) was using the wrong
URL for the body font, resulting in the fallback serif font being used,
instead of the desired Source Serif Pro fonts.

(It's worth noting that the CSS for rustdoc's API generation got these URLs right.)

5 years agoFix test
Yuki OKUSHI [Sat, 30 Mar 2019 22:13:59 +0000 (07:13 +0900)]
Fix test

5 years agoRestore test
Fabian Drinck [Mon, 18 Mar 2019 16:51:00 +0000 (17:51 +0100)]
Restore test