]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoRollup merge of #55802 - wesleywiser:inlined_calls_2_electric_boogaloo, r=nagisa
Pietro Albini [Sat, 10 Nov 2018 23:21:19 +0000 (00:21 +0100)]
Rollup merge of #55802 - wesleywiser:inlined_calls_2_electric_boogaloo, r=nagisa

Don't inline virtual calls (take 2)

When I fixed the previous mis-optimizations, I didn't realize there were
actually two different places where we mutate `callsites` and both of
them should have the same behavior.

As a result, if a function was inlined and that function contained
virtual function calls, they were incorrectly being inlined. I also
added a test case which covers this.

5 years agoRollup merge of #55801 - pnkfelix:update-box-insensitivity-test-for-nll, r=davidtwco
Pietro Albini [Sat, 10 Nov 2018 23:21:17 +0000 (00:21 +0100)]
Rollup merge of #55801 - pnkfelix:update-box-insensitivity-test-for-nll, r=davidtwco

NLL: Update box insensitivity test

This is just keeping one of our tests honest with respect to NLL, in two ways:

 1. Adds uses of borrows that would otherwise be too short to observe the error that we would have expected to see...
 2. ... I say "would have expected" because all of the errors in this file are part of the reversion of rust-lang/rfcs#130 that is attached to NLL (you can see more discussion of this here https://github.com/rust-lang/rust/issues/43234#issuecomment-411017768 )

5 years agoRollup merge of #55800 - estebank:abolish-ice-for-lifetime, r=oli-obk
Pietro Albini [Sat, 10 Nov 2018 23:21:16 +0000 (00:21 +0100)]
Rollup merge of #55800 - estebank:abolish-ice-for-lifetime, r=oli-obk

Fix ICE in `return_type_impl_trait`

Fix #55796.

5 years agoRollup merge of #55799 - pnkfelix:remove-useless-revisions-marker-from-lint-unused...
Pietro Albini [Sat, 10 Nov 2018 23:21:15 +0000 (00:21 +0100)]
Rollup merge of #55799 - pnkfelix:remove-useless-revisions-marker-from-lint-unused-mut-variables, r=davidtwco

Removed unneeded instance of `// revisions` from a lint test

Removed an unneeded instance of `// revisions`; the compare-mode=nll shows the output is identical now.

cc #54528

5 years agoRollup merge of #55792 - oli-obk:propsicle, r=RalfJung
Pietro Albini [Sat, 10 Nov 2018 23:21:14 +0000 (00:21 +0100)]
Rollup merge of #55792 - oli-obk:propsicle, r=RalfJung

Prevent ICE in const-prop array oob check

fixes https://github.com/rust-lang/rust/issues/55772
fixes https://github.com/rust-lang/rust/issues/54541

5 years agoRollup merge of #55764 - murarth:fix-rc-alloc, r=RalfJung
Pietro Albini [Sat, 10 Nov 2018 23:21:13 +0000 (00:21 +0100)]
Rollup merge of #55764 - murarth:fix-rc-alloc, r=RalfJung

Fix Rc/Arc allocation layout

* Rounds allocation layout up to a multiple of alignment
* Adds a convenience method `Layout::pad_to_align` to perform rounding

Closes #55747

cc #55724

5 years agoRollup merge of #55745 - nnethercote:outlives_components-SmallVec, r=matthewjasper
Pietro Albini [Sat, 10 Nov 2018 23:21:12 +0000 (00:21 +0100)]
Rollup merge of #55745 - nnethercote:outlives_components-SmallVec, r=matthewjasper

Convert `outlives_components`' return value to a `SmallVec` outparam.

This avoids some allocations, reducing instruction counts by 1% on a
couple of benchmarks.

5 years agoRollup merge of #55687 - alexreg:fix-24010, r=scalexm
Pietro Albini [Sat, 10 Nov 2018 23:21:11 +0000 (00:21 +0100)]
Rollup merge of #55687 - alexreg:fix-24010, r=scalexm

Take supertraits into account when calculating associated types

Fixes #24010 and #23856. Applies to trait aliases too.

As a by-product, this PR also makes repeated bindings of the same associated item in the same definition a hard error. This was previously a warning with a note about it becoming a hard error in the future. See #50589 for more info.

I talked about this with @nikomatsakis recently, but only very superficially, so this shouldn't stop anyone from assigning it to themself to review and r+.

N.B. The "WIP" commits represent imperfect attempts to solve the problem just for trait objects, but I've left them in for reference for the sake of whomever is reviewing this.

CC @carllerche @theemathas @durka @mbrubeck

5 years agoAuto merge of #55650 - nikic:funnel-shift, r=nagisa
bors [Sat, 10 Nov 2018 19:58:14 +0000 (19:58 +0000)]
Auto merge of #55650 - nikic:funnel-shift, r=nagisa

Implement rotate using funnel shift on LLVM >= 7

Implement the rotate_left and rotate_right operations using
llvm.fshl and llvm.fshr if they are available (LLVM >= 7).

Originally I wanted to expose the funnel_shift_left and
funnel_shift_right intrinsics and implement rotate_left and
rotate_right on top of them. However, emulation of funnel
shifts requires emitting a conditional to check for zero shift
amount, which is not necessary for rotates. I was uncomfortable
doing that here, as I don't want to rely on LLVM to optimize
away that conditional (and for variable rotates, I'm not sure it
can). We should revisit that question when we raise our minimum
version requirement to LLVM 7 and don't need emulation code
anymore.

Fixes #52457.

5 years agoAuto merge of #55830 - alexcrichton:update-cargo, r=alexcrichton
bors [Sat, 10 Nov 2018 12:21:58 +0000 (12:21 +0000)]
Auto merge of #55830 - alexcrichton:update-cargo, r=alexcrichton

Update Cargo submodule

Hopefully a relatively routine update!

5 years agoAuto merge of #55637 - pnkfelix:issue-55552-dont-attempt-to-ascribe-projections-out...
bors [Sat, 10 Nov 2018 09:38:10 +0000 (09:38 +0000)]
Auto merge of #55637 - pnkfelix:issue-55552-dont-attempt-to-ascribe-projections-out-of-a-ty-var, r=nikomatsakis

Do not attempt to ascribe projections out of a ty var

If we encounter `_` ascribed to structural pattern like `(a, b)`, just skip relate_types.

Fix #55552

5 years agoAuto merge of #55717 - oli-obk:rustdoc_overflow, r=pnkfelix
bors [Sat, 10 Nov 2018 07:03:04 +0000 (07:03 +0000)]
Auto merge of #55717 - oli-obk:rustdoc_overflow, r=pnkfelix

Bubble up an overflow error so that rustdoc can ignore it

fixes #54524

Idk how to write a test for this, other than trying to minimize the entire diesel crate. If desirable I will do that.

Note that there are many other such overflow errors hiding out there. Should we try to proactively eliminate them or do we just whack-a-mole them?

cc @GuillaumeGomez

r? @nikomatsakis

5 years agoDon't inline virtual calls (take 2)
Wesley Wiser [Wed, 7 Nov 2018 03:31:09 +0000 (22:31 -0500)]
Don't inline virtual calls (take 2)

When I fixed the previous mis-optimizations, I didn't realize there were
actually two different places where we mutate `callsites` and both of
them should have the same behavior.

As a result, if a function was inlined and that function contained
virtual function calls, they were incorrectly being inlined. I also
added a test case which covers this.

5 years agoAuto merge of #55626 - nikic:update-emscripten, r=alexcrichton
bors [Sat, 10 Nov 2018 01:16:02 +0000 (01:16 +0000)]
Auto merge of #55626 - nikic:update-emscripten, r=alexcrichton

Update emscripten

This updates emscripten to 1.38.15, which is based on LLVM 6.0.1 and would allow us to drop code for handling LLVM 4.

The main issue I ran into is that exporting statics through `EXPORTED_FUNCTIONS` no longer works. As far as I understand exporting non-functions doesn't really make sense under emscripten anyway, so I've modified the symbol export code to not even try.

Closes #52323.

5 years agoUpdate Cargo submodule
Alex Crichton [Fri, 9 Nov 2018 20:55:25 +0000 (12:55 -0800)]
Update Cargo submodule

Hopefully a relatively routine update!

5 years agoSimplify logic
Esteban Küber [Fri, 9 Nov 2018 18:16:07 +0000 (10:16 -0800)]
Simplify logic

5 years agoPull in fix for dist-i686-linux build
Nikita Popov [Fri, 9 Nov 2018 09:32:24 +0000 (10:32 +0100)]
Pull in fix for dist-i686-linux build

5 years agoFix tidy
Oliver Scherer [Fri, 9 Nov 2018 09:11:20 +0000 (10:11 +0100)]
Fix tidy

5 years agoAuto merge of #55803 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Fri, 9 Nov 2018 06:56:25 +0000 (06:56 +0000)]
Auto merge of #55803 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 17 pull requests

Successful merges:

 - #55576 (Clarify error message for -C opt-level)
 - #55633 (Support memcpy/memmove with differing src/dst alignment)
 - #55638 (Fix ICE in msg_span_from_free_region on ReEmpty)
 - #55659 (rustc: Delete grouping logic from the musl target)
 - #55719 (Sidestep link error from rustfix'ed code by using a *defined* static.)
 - #55736 (Elide anon lifetimes in conflicting impl note)
 - #55739 (Consume optimization fuel from the MIR inliner)
 - #55742 (Avoid panic when matching function call)
 - #55753 (borrow_set: remove a helper function and a clone it uses)
 - #55755 (Improve creation of 3 IndexVecs)
 - #55758 ([regression - rust2018]: unused_mut lint false positives on nightly)
 - #55760 (Remove intermediate font specs)
 - #55761 (mir: remove a hacky recursive helper function)
 - #55774 (wasm32-unknown-emscripten expects the rust_eh_personality symbol)
 - #55777 (Use `Lit` rather than `P<Lit>` in `ast::ExprKind`.)
 - #55783 (Deprecate mpsc channel selection)
 - #55788 (rustc: Request ansi colors if stderr isn't a tty)

Failed merges:

r? @ghost

5 years agoRollup merge of #55788 - alexcrichton:wincolors, r=petrochenkov
Mark Rousskov [Fri, 9 Nov 2018 01:15:24 +0000 (18:15 -0700)]
Rollup merge of #55788 - alexcrichton:wincolors, r=petrochenkov

rustc: Request ansi colors if stderr isn't a tty

Currently Cargo will always capture the output of rustc meaning that
rustc is never hooked up to a tty. To retain colors Cargo uses the
`fwdansi` crate to ensure that ansi color codes are translated to
windows terminal methods (and ansi codes otherwise just go their natural
route on Unix).

Cargo passes `--color always` to rustc to ensure that using a pipe
doesn't trick it into not emitting colors at all. It turns out, however,
that `--color always` ends up still accidentally using the native shell
api on native windows shells.

The fix here is to instead pass `AlwaysAnsi` to `termcolor` instead of
`Always`, ensuring that when `--color always` is passed to rustc and its
output isn't a terminal, we're always generating ansi colors regardless
of the platform.

Closes #55769

5 years agoRollup merge of #55783 - stjepang:deprecate-select, r=SimonSapin
Mark Rousskov [Fri, 9 Nov 2018 01:15:21 +0000 (18:15 -0700)]
Rollup merge of #55783 - stjepang:deprecate-select, r=SimonSapin

Deprecate mpsc channel selection

Rationale: https://github.com/rust-lang/rust/issues/27800#issuecomment-421760863

r? @SimonSapin

5 years agoRollup merge of #55777 - nnethercote:less-P-in-ast, r=petrochenkov
Mark Rousskov [Fri, 9 Nov 2018 01:15:19 +0000 (18:15 -0700)]
Rollup merge of #55777 - nnethercote:less-P-in-ast, r=petrochenkov

Use `Lit` rather than `P<Lit>` in `ast::ExprKind`.

Because it results in fewer allocations and small speedups on some
benchmarks.

5 years agoRollup merge of #55774 - CryZe:patch-5, r=alexcrichton
Mark Rousskov [Fri, 9 Nov 2018 01:15:17 +0000 (18:15 -0700)]
Rollup merge of #55774 - CryZe:patch-5, r=alexcrichton

wasm32-unknown-emscripten expects the rust_eh_personality symbol

The `wasm32-unknown-emscripten` expects the `rust_eh_personality` symbol to be there, but a cfg checking for `target_arch = "wasm32"` which was meant to remove the symbol from the `wasm32-unknown-unknown` target, didn't check for whether `emscripten` is targeted or not, so the symbol accidentally got filtered out there as well.

Fixes #55276

5 years agoRollup merge of #55761 - ljedrz:fix_promote_candidate_hack, r=estebank
Mark Rousskov [Fri, 9 Nov 2018 01:15:14 +0000 (18:15 -0700)]
Rollup merge of #55761 - ljedrz:fix_promote_candidate_hack, r=estebank

mir: remove a hacky recursive helper function

It can be replaced with a `while let` loop.

5 years agoRollup merge of #55760 - jonhoo:no-intermediate-fonts, r=GuillaumeGomez
Mark Rousskov [Fri, 9 Nov 2018 01:15:12 +0000 (18:15 -0700)]
Rollup merge of #55760 - jonhoo:no-intermediate-fonts, r=GuillaumeGomez

Remove intermediate font specs

This is a (much) more constrained version of #54772 that also aims at improving the situation in #34681. It removes any font specifications that are not the "official" rustdoc font, and instead relies on the browser to provide the fallback font if the official on is not available. On Linux systems, this is particularly important, as fonts like Helvetica, Arial, and Times often look pretty bad since they're pulled from extracted MS fonts. A specification like `serif` or `sans-serif` lets the browser instead choose a good font.

5 years agoRollup merge of #55758 - davidtwco:issue-55344, r=pnkfelix
Mark Rousskov [Fri, 9 Nov 2018 01:15:10 +0000 (18:15 -0700)]
Rollup merge of #55758 - davidtwco:issue-55344, r=pnkfelix

[regression - rust2018]: unused_mut lint false positives on nightly

Fixes #55344.

This commit filters out locals that have never been initialized for
consideration in the `unused_mut` lint.

This is intended to detect when the statement that would have
initialized the local was removed as unreachable code. In these cases,
we would not want to lint. This is the same behaviour as the AST borrow
checker.

This is achieved by taking advantage of an existing pass over the MIR
for the `unused_mut` lint and creating a set of those locals that were
never initialized.

r? @pnkfelix

5 years agoRollup merge of #55755 - ljedrz:a_few_indexvec_tweaks, r=varkor
Mark Rousskov [Fri, 9 Nov 2018 01:15:08 +0000 (18:15 -0700)]
Rollup merge of #55755 - ljedrz:a_few_indexvec_tweaks, r=varkor

Improve creation of 3 IndexVecs

- preallocate when the minimal size is known
- use `from_elem_n` instead of `new`+`resize`

5 years agoRollup merge of #55753 - ljedrz:borrow_set_insert_clone, r=oli-obk
Mark Rousskov [Fri, 9 Nov 2018 01:15:05 +0000 (18:15 -0700)]
Rollup merge of #55753 - ljedrz:borrow_set_insert_clone, r=oli-obk

borrow_set: remove a helper function and a clone it uses

This clone doesn't seem necessary.

r? @oli-obk

5 years agoRollup merge of #55742 - F001:fix-55718, r=petrochenkov
Mark Rousskov [Fri, 9 Nov 2018 01:15:03 +0000 (18:15 -0700)]
Rollup merge of #55742 - F001:fix-55718, r=petrochenkov

Avoid panic when matching function call

Fix #55718

This bug is introduced by #53751. The original code checked `Def::AssociatedConst(..) | Def::Method(..)` before `pat_ty.no_bound_vars().expect("expected fn type")`. But somehow I exchanged the sequence carelessly. Sorry about that.

r? @petrochenkov

5 years agoRollup merge of #55739 - wesleywiser:mir_inline_fuel, r=nikomatsakis
Mark Rousskov [Fri, 9 Nov 2018 01:15:01 +0000 (18:15 -0700)]
Rollup merge of #55739 - wesleywiser:mir_inline_fuel, r=nikomatsakis

Consume optimization fuel from the MIR inliner

This makes it easier to debug mis-optimizations that occur during
inlining. Thanks to @nikomatsakis for the suggestion!

5 years agoRollup merge of #55736 - estebank:elide-anon-lt, r=petrochenkov
Mark Rousskov [Fri, 9 Nov 2018 01:14:58 +0000 (18:14 -0700)]
Rollup merge of #55736 - estebank:elide-anon-lt, r=petrochenkov

Elide anon lifetimes in conflicting impl note

Fix #54690.

5 years agoRollup merge of #55719 - pnkfelix:issue-54388-sidestep-link-error-from-rustfixed...
Mark Rousskov [Fri, 9 Nov 2018 01:14:56 +0000 (18:14 -0700)]
Rollup merge of #55719 - pnkfelix:issue-54388-sidestep-link-error-from-rustfixed-code, r=alexcrichton

Sidestep link error from rustfix'ed code by using a *defined* static.

As a drive-by, added `-g` to the compile-flags so that the test more
reliably fails to compile when the extern static in question is *not*
provided. (I.e. this is making the test more robust in the face of
potential future revisions.)

Fix #54388.

5 years agoRollup merge of #55659 - alexcrichton:musl-no-group, r=michaelwoerister
Mark Rousskov [Fri, 9 Nov 2018 01:14:53 +0000 (18:14 -0700)]
Rollup merge of #55659 - alexcrichton:musl-no-group, r=michaelwoerister

rustc: Delete grouping logic from the musl target

This commit deletes the injection of `-(` and `-)` options to the linker
for the musl targets. This actually causes problems today on nightly if
you execute:

    $ echo 'fn main() {}' >> foo.rs
    $ rustc --target x86_64-unknown-linux-musl -C panic=abort

you get a linker error about "cannot nest groups". This comes about
because rustc injects its own `--start-group` and `--end-group`
variables which clash with the outer `-(` and `-)` variables. It's not
entirely clear to me why this doesn't affect the musl target by default
(in `-C panic=unwind` mode).

The compiler's own injection of `--start-group` and `--end-group` should
solve the issues mentioned in the comment for injecting `-(` and `-)` as
well.

5 years agoRollup merge of #55638 - pnkfelix:issue-55608-ice-reempty-msg_span_from_free_region...
Mark Rousskov [Fri, 9 Nov 2018 01:14:51 +0000 (18:14 -0700)]
Rollup merge of #55638 - pnkfelix:issue-55608-ice-reempty-msg_span_from_free_region, r=estebank

Fix ICE in msg_span_from_free_region on ReEmpty

On an example like this:

```rust
#![feature(conservative_impl_trait)]

fn server() -> impl FilterBase2 {
    segment2(|| { loop { } }).map2(|| "")
}

trait FilterBase2 {
    fn map2<F>(self, _fn: F) -> Map2<F> where Self: Sized { loop { } }
}

struct Map2<F> { _func: F }

impl<F> FilterBase2 for Map2<F> { }

fn segment2<F>(_fn: F) -> Map2<F> where F: Fn() -> Result<(), ()> {
    loop { }
}
```

we now, instead of ICE'ing, get a diagnostic like:

```
error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds
 --> issue-55608.rs:3:16
  |
3 | fn server() -> impl FilterBase2 {
  |                ^^^^^^^^^^^^^^^^
  |
  = note: hidden type `Map2<[closure@issue-55608.rs:4:36: 4:41]>` captures an empty lifetime
```

Fix #55608

5 years agoRollup merge of #55633 - nikic:memcpy-align, r=nagisa
Mark Rousskov [Fri, 9 Nov 2018 01:14:49 +0000 (18:14 -0700)]
Rollup merge of #55633 - nikic:memcpy-align, r=nagisa

Support memcpy/memmove with differing src/dst alignment

If LLVM 7 is used, generate memcpy/memmove with differing src/dst alignment. I've added new FFI functions to construct these through the builder API, which is more convenient than dealing with differing intrinsic signatures depending on the LLVM version.

Fixes #49740.

5 years agoRollup merge of #55576 - birkenfeld:opt-level-error-msg, r=cramertj
Mark Rousskov [Fri, 9 Nov 2018 01:14:46 +0000 (18:14 -0700)]
Rollup merge of #55576 - birkenfeld:opt-level-error-msg, r=cramertj

Clarify error message for -C opt-level

The new levels s and z are not mentioned as possible values.

5 years agoFix the expected error annotations.
Felix S. Klock II [Thu, 8 Nov 2018 23:26:28 +0000 (00:26 +0100)]
Fix the expected error annotations.

(The commit prior to this actual passes our test suite, "thanks"
to #55695. But since I am aware of that bug, I took advantage of it
in choosing how to order my commit series...)

5 years agoSwitch to using `// revisions` to explicit encode NLL's change to `Box` treatment.
Felix S. Klock II [Thu, 8 Nov 2018 23:21:46 +0000 (00:21 +0100)]
Switch to using `// revisions` to explicit encode NLL's change to `Box` treatment.

5 years agoSidestep ICE in `type_of_def_id()` when called from `return_type_impl_trait`
Esteban Küber [Thu, 8 Nov 2018 23:18:55 +0000 (15:18 -0800)]
Sidestep ICE in `type_of_def_id()` when called from `return_type_impl_trait`

5 years agoMake test robust to NLL, in sense of ensuring borrows extend to something approximati...
Felix S. Klock II [Thu, 8 Nov 2018 23:10:19 +0000 (00:10 +0100)]
Make test robust to NLL, in sense of ensuring borrows extend to something approximating lexical scope.

5 years agoRemoved an unneeded instance of `// revisions`; the compare-mode NLL shows the output...
Felix S. Klock II [Thu, 8 Nov 2018 23:03:17 +0000 (00:03 +0100)]
Removed an unneeded instance of `// revisions`; the compare-mode NLL shows the output is identical now.

5 years agoDeprecate channel selection
Stjepan Glavina [Thu, 8 Nov 2018 13:20:45 +0000 (14:20 +0100)]
Deprecate channel selection

5 years agoAdd more regression tests
Oliver Scherer [Thu, 8 Nov 2018 19:18:26 +0000 (20:18 +0100)]
Add more regression tests

5 years agoPrevent ICE in const-prop array oob check
Oliver Scherer [Thu, 8 Nov 2018 19:15:13 +0000 (20:15 +0100)]
Prevent ICE in const-prop array oob check

5 years agoFix Rc/Arc allocation layout
Murarth [Wed, 7 Nov 2018 17:59:25 +0000 (10:59 -0700)]
Fix Rc/Arc allocation layout

* Rounds allocation layout up to a multiple of alignment
* Adds a convenience method `Layout::pad_to_align` to perform rounding

5 years agoFix some tests for wasm32-unknown-emscripten
Nikita Popov [Thu, 8 Nov 2018 16:18:21 +0000 (17:18 +0100)]
Fix some tests for wasm32-unknown-emscripten

5 years agoFix compiletest support for wasm32-unknown-emscripten
Nikita Popov [Thu, 8 Nov 2018 16:04:05 +0000 (17:04 +0100)]
Fix compiletest support for wasm32-unknown-emscripten

5 years agorustc: Request ansi colors if stderr isn't a tty
Alex Crichton [Thu, 8 Nov 2018 15:49:28 +0000 (07:49 -0800)]
rustc: Request ansi colors if stderr isn't a tty

Currently Cargo will always capture the output of rustc meaning that
rustc is never hooked up to a tty. To retain colors Cargo uses the
`fwdansi` crate to ensure that ansi color codes are translated to
windows terminal methods (and ansi codes otherwise just go their natural
route on Unix).

Cargo passes `--color always` to rustc to ensure that using a pipe
doesn't trick it into not emitting colors at all. It turns out, however,
that `--color always` ends up still accidentally using the native shell
api on native windows shells.

The fix here is to instead pass `AlwaysAnsi` to `termcolor` instead of
`Always`, ensuring that when `--color always` is passed to rustc and its
output isn't a terminal, we're always generating ansi colors regardless
of the platform.

Closes #55769

5 years agoUpdate the disabled wasm32 Dockerfile
Nikita Popov [Thu, 8 Nov 2018 15:32:42 +0000 (16:32 +0100)]
Update the disabled wasm32 Dockerfile

5 years agoDisable wasm32 features on emscripten
Nikita Popov [Thu, 8 Nov 2018 15:22:20 +0000 (16:22 +0100)]
Disable wasm32 features on emscripten

These are only supported by the native wasm32 backend.

5 years agoImprove creation of 3 IndexVecs
ljedrz [Wed, 7 Nov 2018 14:38:06 +0000 (15:38 +0100)]
Improve creation of 3 IndexVecs

5 years agoAuto merge of #55532 - pnkfelix:rustc_error-survey, r=nikomatsakis
bors [Thu, 8 Nov 2018 09:38:49 +0000 (09:38 +0000)]
Auto merge of #55532 - pnkfelix:rustc_error-survey, r=nikomatsakis

#[rustc_error] survey

Fix #55505

5 years agoUse `SmallVec` outparams in several functions.
Nicholas Nethercote [Thu, 1 Nov 2018 08:13:11 +0000 (19:13 +1100)]
Use `SmallVec` outparams in several functions.

This avoids some allocations, reducing instruction counts by 1% on a
couple of benchmarks.

5 years agoUse `Lit` rather than `P<Lit>` in `ast::ExprKind`.
Nicholas Nethercote [Thu, 8 Nov 2018 04:55:52 +0000 (15:55 +1100)]
Use `Lit` rather than `P<Lit>` in `ast::ExprKind`.

Because it results in fewer allocations and small speedups on some
benchmarks.

5 years agoAuto merge of #55366 - Amanieu:stable_layout, r=Amanieu
bors [Thu, 8 Nov 2018 06:52:27 +0000 (06:52 +0000)]
Auto merge of #55366 - Amanieu:stable_layout, r=Amanieu

Add tracking issue for Layout methods (and some API changes)

These methods are already useful when used with the stable global allocator API (stabilized in #51241).

```rust
pub fn align_to(&self, align: usize) -> Result<Layout, LayoutErr>;
pub fn padding_needed_for(&self, align: usize) -> usize;
pub fn repeat(&self, n: usize) -> Result<(Layout, usize), LayoutErr>;
pub fn extend(&self, next: Layout) -> Result<(Layout, usize), LayoutErr>;
pub fn repeat_packed(&self, n: usize) -> Result<Layout, LayoutErr>;
pub fn extend_packed(&self, next: Layout) -> Result<Layout, LayoutErr>;
pub fn array<T>(n: usize) -> Result<Layout, LayoutErr>;
```

cc #32838

r? @SimonSapin

5 years agowasm32-unknown-emscripten expects the rust_eh_personality symbol
Christopher Serr [Thu, 8 Nov 2018 01:56:25 +0000 (02:56 +0100)]
wasm32-unknown-emscripten expects the rust_eh_personality symbol

The `wasm32-unknown-emscripten` expects the `rust_eh_personality` symbol to be there, but a cfg checking for `target_arch = "wasm32"` which was meant to remove the symbol from the `wasm32-unknown-unknown` target, didn't check for whether `emscripten` is targeted or not, so the symbol accidentally got filtered out there as well.

Fixes #55276

5 years agoAuto merge of #55187 - malbarbo:fix-manifest, r=alexcrichton
bors [Thu, 8 Nov 2018 01:10:10 +0000 (01:10 +0000)]
Auto merge of #55187 - malbarbo:fix-manifest, r=alexcrichton

Remove targets from the manifest that are not built on travis

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

5 years agoRemoved `DUPLICATE_ASSOCIATED_TYPE_BINDINGS` lint.
Alexander Regueiro [Wed, 7 Nov 2018 21:47:19 +0000 (21:47 +0000)]
Removed `DUPLICATE_ASSOCIATED_TYPE_BINDINGS` lint.

This has been replaced by the hard error E0719.

5 years agoOnly do check for trait objects, not trait or trait alias definitions.
Alexander Regueiro [Tue, 6 Nov 2018 23:17:11 +0000 (23:17 +0000)]
Only do check for trait objects, not trait or trait alias definitions.

5 years agoAdded error for duplicate bindings of associated type.
Alexander Regueiro [Mon, 5 Nov 2018 02:02:43 +0000 (02:02 +0000)]
Added error for duplicate bindings of associated type.

5 years agoAdded tests.
Alexander Regueiro [Sun, 4 Nov 2018 04:47:10 +0000 (04:47 +0000)]
Added tests.

5 years agoLook at projections from supertraits when constructing trait objects.
Alexander Regueiro [Thu, 1 Nov 2018 19:43:38 +0000 (19:43 +0000)]
Look at projections from supertraits when constructing trait objects.

5 years agoRemove targets from the manifest that are not built on travis
Marco A L Barbosa [Thu, 18 Oct 2018 20:27:08 +0000 (17:27 -0300)]
Remove targets from the manifest that are not built on travis

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

5 years agoAuto merge of #55746 - kennytm:rollup, r=kennytm
bors [Wed, 7 Nov 2018 17:14:34 +0000 (17:14 +0000)]
Auto merge of #55746 - kennytm:rollup, r=kennytm

Rollup of 14 pull requests

Successful merges:

 - #55377 (Slight copy-editing for `std::cell::Cell` docs)
 - #55441 (Remove unused re import in gdb_rust_pretty_printing)
 - #55453 (Choose predicates without inference variables over those with them)
 - #55495 (Don't print opt fuel messages to stdout because it breaks Rustbuild)
 - #55501 (Make `process_obligations`' computation of `completed` optional.)
 - #55510 (Fix feature gate only being checked on first repr attr.)
 - #55609 (Run name-anon-globals after LTO passes as well)
 - #55645 (do not print wrapping ranges like normal ranges in validity diagnostics)
 - #55688 (Standardised names and location of ui issue tests)
 - #55692 (-C remark: fix incorrect warning about requiring "--debuginfo" instead of "-C debuginfo=n")
 - #55702 (Add `aarch64-pc-windows-msvc` to deployed targets)
 - #55728 (Update lldb)
 - #55730 (Use trait impl method span when type param mismatch is due to impl Trait)
 - #55734 (refactor: use shorthand fields)

5 years agoRemove intermediate font specs
Jon Gjengset [Wed, 7 Nov 2018 16:02:08 +0000 (11:02 -0500)]
Remove intermediate font specs

This is a (much) more constrained version of #54772 that also aims at
improving the situation in #34681. It removes any font specifications
that are not the "official" rustdoc font, and instead relies on the
browser to provide the fallback font if the official on is not
available. On Linux systems, this is particularly important, as fonts
like Helvetica, Arial, and Times often look pretty bad since they're
pulled from extracted MS fonts. A specification like `serif` or
`sans-serif` lets the browser instead choose a good font.

5 years agomir: remove a hacky recursive helper function
ljedrz [Wed, 7 Nov 2018 16:00:51 +0000 (17:00 +0100)]
mir: remove a hacky recursive helper function

5 years agoThis test will not link on wasm32.
Felix S. Klock II [Wed, 7 Nov 2018 15:33:41 +0000 (16:33 +0100)]
This test will not link on wasm32.

5 years agoIgnore never-initialized locals for `unused_mut`.
David Wood [Wed, 7 Nov 2018 12:40:55 +0000 (13:40 +0100)]
Ignore never-initialized locals for `unused_mut`.

This commit filters out locals that have never been initialized for
consideration in the `unused_mut` lint.

This is intended to detect when the statement that would have
initialized the local was removed as unreachable code. In these cases,
we would not want to lint. This is the same behaviour as the AST borrow
checker.

This is achieved by taking advantage of an existing pass over the MIR
for the `unused_mut` lint and creating a set of those locals that were
never initialized.

5 years agowork around deviation in diagnostic output for opt-level=0 by forcing `-O`.
Felix S. Klock II [Wed, 7 Nov 2018 14:58:59 +0000 (15:58 +0100)]
work around deviation in diagnostic output for opt-level=0 by forcing `-O`.

5 years agoUpdate output of `lint-type-overflow2.stderr` to reflect its output from `rustc -O`.
Felix S. Klock II [Wed, 7 Nov 2018 14:47:49 +0000 (15:47 +0100)]
Update output of `lint-type-overflow2.stderr` to reflect its output from `rustc -O`.

(The fact that output differs under `opt-level=0` is an instance of #55757.)

5 years agoborrow_set: remove a helper function and a clone it uses
ljedrz [Wed, 7 Nov 2018 14:32:58 +0000 (15:32 +0100)]
borrow_set: remove a helper function and a clone it uses

5 years agofix ICE
F001 [Wed, 7 Nov 2018 04:26:05 +0000 (12:26 +0800)]
fix ICE

5 years agoRollup merge of #55645 - RalfJung:validity-range-inclusive, r=oli-obk
kennytm [Wed, 7 Nov 2018 13:28:19 +0000 (21:28 +0800)]
Rollup merge of #55645 - RalfJung:validity-range-inclusive, r=oli-obk

do not print wrapping ranges like normal ranges in validity diagnostics

5 years agoRollup merge of #55734 - teresy:shorthand-fields, r=davidtwco
kennytm [Wed, 7 Nov 2018 10:02:05 +0000 (18:02 +0800)]
Rollup merge of #55734 - teresy:shorthand-fields, r=davidtwco

refactor: use shorthand fields

refactor: use shorthand for single fields everywhere (excluding tests).

5 years agoRollup merge of #55730 - estebank:impl-trait-arg-mismatch, r=varkor
kennytm [Wed, 7 Nov 2018 10:02:04 +0000 (18:02 +0800)]
Rollup merge of #55730 - estebank:impl-trait-arg-mismatch, r=varkor

Use trait impl method span when type param mismatch is due to impl Trait

Fix #55374.

5 years agoRollup merge of #55728 - tromey:update-lldb, r=alexcrichton
kennytm [Wed, 7 Nov 2018 10:02:03 +0000 (18:02 +0800)]
Rollup merge of #55728 - tromey:update-lldb, r=alexcrichton

Update lldb

This updates lldb to pick up some bug fixes, and makes one minor test
suite fix to account for this.

5 years agoConsume optimization fuel from the MIR inliner
Wesley Wiser [Sun, 21 Oct 2018 15:58:39 +0000 (11:58 -0400)]
Consume optimization fuel from the MIR inliner

This makes it easier to debug mis-optimizations that occur during
inlining. Thanks to @nikomatsakis for the suggestion!

5 years agotest diagnostics for more ranges
Ralf Jung [Sat, 3 Nov 2018 13:10:34 +0000 (14:10 +0100)]
test diagnostics for more ranges

5 years agopretty-print scalar range that only has an upper bound
Ralf Jung [Sat, 3 Nov 2018 12:21:09 +0000 (13:21 +0100)]
pretty-print scalar range that only has an upper bound

5 years agodo not print wrapping ranges like normal ranges in diagnostics
Ralf Jung [Sat, 3 Nov 2018 11:44:10 +0000 (12:44 +0100)]
do not print wrapping ranges like normal ranges in diagnostics

5 years agoRemoved `#[rustc_error]` from tests that are all `// compile-pass`.
Felix S. Klock II [Wed, 31 Oct 2018 12:08:01 +0000 (13:08 +0100)]
Removed `#[rustc_error]` from tests that are all `// compile-pass`.

I also added `// skip-codegen` to each one, to address potential concerns
that this change would otherwise slow down our test suite spending time
generating code for files that are really just meant to be checks of
compiler diagnostics.

(However, I will say: My preference is to not use `// skip-codegen` if
one can avoid it. We can use all the testing of how we drive LLVM that
we can get...)

(Updated post rebase.)

5 years agoReplaced use of `#[rustc_error]` with `// skip-codegen`.
Felix S. Klock II [Wed, 31 Oct 2018 11:24:01 +0000 (12:24 +0100)]
Replaced use of `#[rustc_error]` with `// skip-codegen`.

This test specifically notes that it does not want to invoke the
linker, due to the way it (IMO weakly) exercises the `#[link=...]`
attribute.

In any case, removing the the `#[rustc_error]` here uncovered an
"invalid windows subsystem" error that was previously not included in
the transcript of diagnostic output. So that's a step forward, (right?).

5 years agoremove `#[rustc_error]` from ui/ tests that remain compile-fail tests.
Felix S. Klock II [Tue, 30 Oct 2018 23:18:11 +0000 (00:18 +0100)]
remove `#[rustc_error]` from ui/ tests that remain compile-fail tests.

5 years agoRollup merge of #55702 - alexcrichton:arm64-msvc-deploy, r=michaelwoerister
kennytm [Wed, 7 Nov 2018 10:01:58 +0000 (18:01 +0800)]
Rollup merge of #55702 - alexcrichton:arm64-msvc-deploy, r=michaelwoerister

Add `aarch64-pc-windows-msvc` to deployed targets

Accidentally forgotten from #54718!

5 years agoRollup merge of #55692 - matthiaskrgr:remark_debuginfo_hint, r=michaelwoerister
kennytm [Wed, 7 Nov 2018 10:01:57 +0000 (18:01 +0800)]
Rollup merge of #55692 - matthiaskrgr:remark_debuginfo_hint, r=michaelwoerister

-C remark: fix incorrect warning about requiring "--debuginfo" instead of "-C debuginfo=n"

Previously suggested "--debuginfo" does not actually work.

5 years agoRollup merge of #55688 - alexreg:move-issue-tests, r=estebank
kennytm [Wed, 7 Nov 2018 10:01:56 +0000 (18:01 +0800)]
Rollup merge of #55688 - alexreg:move-issue-tests, r=estebank

Standardised names and location of ui issue tests

None

5 years agoRollup merge of #55609 - nikic:fix-51947, r=nagisa
kennytm [Wed, 7 Nov 2018 10:01:54 +0000 (18:01 +0800)]
Rollup merge of #55609 - nikic:fix-51947, r=nagisa

Run name-anon-globals after LTO passes as well

If we're going to emit bitcode (through ThinLTOBuffer), then we need to ensure that anon globals are named. This was already done after optimization passes, but also has to happen after LTO passes, as we always emit the final result in a ThinLTO-compatible manner.

I added the test as `run-make`. The important bit is that we emit bitcode in some way (e.g. `--crate-type rlib` or `--emit=llvm-bc`). Please tell me if there is a better way to test for that.

Fixes #51947

5 years agoRollup merge of #55510 - bitshifter:repr-feature-gate-fix, r=petrochenkov
kennytm [Wed, 7 Nov 2018 10:01:53 +0000 (18:01 +0800)]
Rollup merge of #55510 - bitshifter:repr-feature-gate-fix, r=petrochenkov

Fix feature gate only being checked on first repr attr.

Reported in https://github.com/rust-lang/rust/issues/33158#issuecomment-412185357.

5 years agoRollup merge of #55501 - nnethercote:DoCompleted, r=pnkfelix
kennytm [Wed, 7 Nov 2018 10:01:51 +0000 (18:01 +0800)]
Rollup merge of #55501 - nnethercote:DoCompleted, r=pnkfelix

Make `process_obligations`' computation of `completed` optional.

It's only used in tests.

This reduces instruction counts on several benchmarks by 0.5--1%.

5 years agoRollup merge of #55495 - wesleywiser:opt_fuel_rustbuild, r=nikomatsakis
kennytm [Wed, 7 Nov 2018 10:01:50 +0000 (18:01 +0800)]
Rollup merge of #55495 - wesleywiser:opt_fuel_rustbuild, r=nikomatsakis

Don't print opt fuel messages to stdout because it breaks Rustbuild

Rustbuild passes `--message-format json` to the compiler invocations
which causes JSON to be emitted on stdout. Printing optimization fuel
messages to stdout breaks the json and causes Rustbuild to fail.

Work around this by emitting optimization fuel related messages on
stderr instead.

5 years agoRollup merge of #55453 - Aaron1011:fix/rustdoc-lifetime, r=pnkfelix
kennytm [Wed, 7 Nov 2018 10:01:48 +0000 (18:01 +0800)]
Rollup merge of #55453 - Aaron1011:fix/rustdoc-lifetime, r=pnkfelix

Choose predicates without inference variables over those with them

Fixes #54705

When constructing synthetic auto trait impls, we may come across
multiple predicates involving the same type, trait, and substitutions.
Since we can only display one of these, we pick the one with the 'most
strict' lifetime paramters. This ensures that the impl we render the
user is actually valid (that is, a struct matching that impl will
actually implement the auto trait in question).

This commit exapnds the definition of 'more strict' to take into account
inference variables. We always choose a predicate without inference
variables over a predicate with inference variables.

5 years agoRollup merge of #55441 - xfix:patch-12, r=aturon
kennytm [Wed, 7 Nov 2018 10:01:47 +0000 (18:01 +0800)]
Rollup merge of #55441 - xfix:patch-12, r=aturon

Remove unused re import in gdb_rust_pretty_printing

5 years agoRollup merge of #55377 - goffrie:patch-2, r=joshtriplett
kennytm [Wed, 7 Nov 2018 10:01:45 +0000 (18:01 +0800)]
Rollup merge of #55377 - goffrie:patch-2, r=joshtriplett

Slight copy-editing for `std::cell::Cell` docs

Hopefully this is a bit more precise and also more correct English.

5 years agoAuto merge of #55549 - RalfJung:miri-visitor, r=oli-obk
bors [Wed, 7 Nov 2018 09:14:12 +0000 (09:14 +0000)]
Auto merge of #55549 - RalfJung:miri-visitor, r=oli-obk

Value visitors for miri

Generalize the traversal part of validation to a `ValueVisitor`.

~~This includes https://github.com/rust-lang/rust/pull/55316, [click here](https://github.com/RalfJung/rust/compare/retagging...RalfJung:miri-visitor) for just the new commits.~~

5 years agoAuto merge of #55262 - oli-obk:dangling_alloc_id_ice, r=RalfJung
bors [Tue, 6 Nov 2018 23:36:13 +0000 (23:36 +0000)]
Auto merge of #55262 - oli-obk:dangling_alloc_id_ice, r=RalfJung

Change the ICE from #55223 to a hard error

cc @SimonSapin

r? @RalfJung

fixes https://github.com/rust-lang/rust/issues/55287

5 years agoElide anon lifetimes in conflicting impl note
Esteban Küber [Tue, 6 Nov 2018 22:49:09 +0000 (14:49 -0800)]
Elide anon lifetimes in conflicting impl note

5 years agoAdd a tracking issue for extra Layout methods
Amanieu d'Antras [Thu, 25 Oct 2018 22:48:27 +0000 (23:48 +0100)]
Add a tracking issue for extra Layout methods

5 years agorefactor: use shorthand fields
teresy [Tue, 6 Nov 2018 20:05:44 +0000 (15:05 -0500)]
refactor: use shorthand fields

5 years agoUse trait impl method span when type param mismatch is due to impl Trait
Esteban Küber [Tue, 6 Nov 2018 19:24:48 +0000 (11:24 -0800)]
Use trait impl method span when type param mismatch is due to impl Trait

5 years agoAuto merge of #53996 - sekineh:thumb-run, r=japaric
bors [Tue, 6 Nov 2018 18:58:31 +0000 (18:58 +0000)]
Auto merge of #53996 - sekineh:thumb-run, r=japaric

[CI] Run a `thumbv7m-none-eabi` binary using `qemu-system-arm` [IRR-2018-embedded]

## What's included?

- Run a `thumbv7m-none-eabi` binary using `qemu-system-arm`
- We are using `cortex-m-rt = "=0.5.4"` which does not use `proc_macro`.
(reason: stage2 build of rustc does not work well with `proc_macro` in `run-make` phase.)
- We are using GNU LD for now.

## Blocker

All resolved.
- ~[Waiting] `#[panic_handler]` is not available in stable.~
  - [Merged] https://github.com/rust-lang/rust/pull/53619
- ~[Waiting] https://github.com/japaric/lm3s6965evb: does not compile on stable.~
  - [OK] dependent crate ~`panic-abort`~ `panic-halt`: already moved to use `#[panic_handler]`.

## Update

`#[panic_handler]` will be stabilized in Rust 1.30.

CC @kennytm @jamesmunns @nerdyvaishali