]> git.lizzy.rs Git - rust.git/log
rust.git
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 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 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 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 agoDeprecate channel selection
Stjepan Glavina [Thu, 8 Nov 2018 13:20:45 +0000 (14:20 +0100)]
Deprecate channel selection

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 `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 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

5 years agoUpdate lldb
Tom Tromey [Thu, 1 Nov 2018 20:22:55 +0000 (14:22 -0600)]
Update lldb

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

5 years agoRun name-anon-globals after LTO passes as well
Nikita Popov [Fri, 2 Nov 2018 12:22:48 +0000 (13:22 +0100)]
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.

Fixes #51947.

5 years agoAPI changes as discussed in the comments
Amanieu d'Antras [Tue, 30 Oct 2018 21:36:43 +0000 (21:36 +0000)]
API changes as discussed in the comments

5 years agoAdd a comment about how Layout::extend matches the C struct layout
Amanieu d'Antras [Sat, 27 Oct 2018 21:38:37 +0000 (22:38 +0100)]
Add a comment about how Layout::extend matches the C struct layout

5 years agoAdd explcit `--error-format` options to tests of print-fuel to sidestep compiletests...
Felix S. Klock II [Tue, 6 Nov 2018 16:07:17 +0000 (17:07 +0100)]
Add explcit `--error-format` options to tests of print-fuel to sidestep compiletests presumption of JSON.

As a driveby, rename the stdout files to stderr, which should have been part of the earlier commit.

5 years agoSidestep link error from rustfix'ed code by using a *defined* static.
Felix S. Klock II [Tue, 6 Nov 2018 13:21:52 +0000 (14:21 +0100)]
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 agoAuto merge of #55610 - gnzlbg:update_stdsimd, r=alexcrichton
bors [Tue, 6 Nov 2018 13:08:17 +0000 (13:08 +0000)]
Auto merge of #55610 - gnzlbg:update_stdsimd, r=alexcrichton

[breaking change] update stdsimd

r? @alexcrichton

5 years agoBubble up an overflow error so that rustdoc can ignore it
Oliver Scherer [Tue, 6 Nov 2018 12:01:44 +0000 (13:01 +0100)]
Bubble up an overflow error so that rustdoc can ignore it

5 years agoAuto merge of #55710 - kennytm:rollup, r=kennytm
bors [Tue, 6 Nov 2018 09:20:31 +0000 (09:20 +0000)]
Auto merge of #55710 - kennytm:rollup, r=kennytm

Rollup of 11 pull requests

Successful merges:

 - #55490 (resolve: Fix ICE in macro import error recovery)
 - #55597 (std: Enable usage of `thread_local!` through imports)
 - #55601 (Fix tracking issue numbers for some unstable features)
 - #55621 (Add precision for create_dir function)
 - #55644 (ci: Add Dockerfile for dist-powerpcspe-linux)
 - #55664 (Make "all possible cases" help message uniform with existing help messages)
 - #55689 (miri: binary_op_val -> binary_op_imm)
 - #55694 (Fixes #31076)
 - #55696 (NLL Diagnostic Review 3: Missing errors for borrows of union fields)
 - #55700 (Update ui tests with respect to NLL)
 - #55703 (Update `configure --help` (via configure.py) to reflect decoupling of debug+optimize)

5 years agoRollup merge of #55703 - pnkfelix:update-configure-help-to-reflect-pr-54811, r=Mark...
kennytm [Tue, 6 Nov 2018 07:21:12 +0000 (15:21 +0800)]
Rollup merge of #55703 - pnkfelix:update-configure-help-to-reflect-pr-54811, r=Mark-Simulacrum

Update `configure --help` (via configure.py) to reflect decoupling of debug+optimize

This should have been part of PR #54811 (my bad).

5 years agoRollup merge of #55700 - pnkfelix:issue-55533-update-ui-tests-wrt-nll, r=davidtwco
kennytm [Tue, 6 Nov 2018 07:21:11 +0000 (15:21 +0800)]
Rollup merge of #55700 - pnkfelix:issue-55533-update-ui-tests-wrt-nll, r=davidtwco

Update ui tests with respect to NLL

Fix #55533

5 years agoRollup merge of #55696 - davidtwco:issue-55675, r=pnkfelix
kennytm [Tue, 6 Nov 2018 07:21:10 +0000 (15:21 +0800)]
Rollup merge of #55696 - davidtwco:issue-55675, r=pnkfelix

NLL Diagnostic Review 3: Missing errors for borrows of union fields

Fixes #55675.

This PR modifies a test to make it more robust (it also fixes indentation on a doc comment, but that's not the point of the PR). See the linked issue for details.

r? @pnkfelix

5 years agoRollup merge of #55694 - jsirs:issue-31076, r=oli-obk
kennytm [Tue, 6 Nov 2018 07:21:09 +0000 (15:21 +0800)]
Rollup merge of #55694 - jsirs:issue-31076, r=oli-obk

Fixes #31076

5 years agoRollup merge of #55689 - RalfJung:miri-immediate, r=oli-obk
kennytm [Tue, 6 Nov 2018 07:21:07 +0000 (15:21 +0800)]
Rollup merge of #55689 - RalfJung:miri-immediate, r=oli-obk

miri: binary_op_val -> binary_op_imm

Seems like this was overlooked during the value -> immediate rename.

r? @oli-obk

5 years agoRollup merge of #55664 - varkor:all-possible-cases-message, r=zackmdavis
kennytm [Tue, 6 Nov 2018 07:21:06 +0000 (15:21 +0800)]
Rollup merge of #55664 - varkor:all-possible-cases-message, r=zackmdavis

Make "all possible cases" help message uniform with existing help messages

Specifically no capitalisation or trailing full stops.

5 years agoRollup merge of #55644 - glaubitz:powerpcspe-linux, r=alexcrichton
kennytm [Tue, 6 Nov 2018 07:21:05 +0000 (15:21 +0800)]
Rollup merge of #55644 - glaubitz:powerpcspe-linux, r=alexcrichton

ci: Add Dockerfile for dist-powerpcspe-linux

This adds the Dockerfile for cross-building Rust for the powerpcspe target. It's currently disabled.

5 years agoRollup merge of #55621 - GuillaumeGomez:create-dir, r=QuietMisdreavus
kennytm [Tue, 6 Nov 2018 07:21:02 +0000 (15:21 +0800)]
Rollup merge of #55621 - GuillaumeGomez:create-dir, r=QuietMisdreavus

Add precision for create_dir function

Took me a while to find the other equivalent so it seems to be necessary.

r? @QuietMisdreavus

5 years agoRollup merge of #55601 - petrochenkov:featissue, r=pnkfelix
kennytm [Tue, 6 Nov 2018 07:21:01 +0000 (15:21 +0800)]
Rollup merge of #55601 - petrochenkov:featissue, r=pnkfelix

Fix tracking issue numbers for some unstable features

And also remove deprecated unstable `#[panic_implementation]` attribute that was superseded by stable `#[panic_handler]` and doesn't have an open tracking issue.

5 years agoRollup merge of #55597 - alexcrichton:thread-local-inner, r=KodrAus
kennytm [Tue, 6 Nov 2018 07:20:59 +0000 (15:20 +0800)]
Rollup merge of #55597 - alexcrichton:thread-local-inner, r=KodrAus

std: Enable usage of `thread_local!` through imports

The `thread_local!` macro delegated to an internal macro but it didn't
do so in a macros-and-the-module-system compatible fashion, meaning if a
`#![no_std]` crate imported `std` and tried to use `thread_local!` it
would fail due to missing a lookup of an internal macro.

This commit switches the macro to instead use `$crate` to invoke other
macros, ensuring that it'll work when `thread_local!` is imported alone.

5 years agoRollup merge of #55490 - petrochenkov:resolveice, r=eddyb
kennytm [Tue, 6 Nov 2018 07:20:57 +0000 (15:20 +0800)]
Rollup merge of #55490 - petrochenkov:resolveice, r=eddyb

resolve: Fix ICE in macro import error recovery

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

5 years agoAuto merge of #55518 - alexcrichton:smaller-wasm, r=sfackler
bors [Tue, 6 Nov 2018 04:04:33 +0000 (04:04 +0000)]
Auto merge of #55518 - alexcrichton:smaller-wasm, r=sfackler

std: Improve codegen size of accessing TLS

Some code in the TLS implementation in libstd stores `Some(val)` into an
`&mut Option<T>` (effectively) and then pulls out `&T`, but it currently
uses `.unwrap()` which can codegen into a panic even though it can never
panic. With sufficient optimizations enabled (like LTO) the compiler can
see through this but this commit helps it along in normal mode
(`--release` with Cargo by default) to avoid codegen'ing the panic path.

This ends up improving the optimized codegen on wasm by ensuring that a
call to panic pulling in more file size doesn't stick around.

5 years agoMoved and renamed ui issue tests.
Alexander Regueiro [Mon, 5 Nov 2018 04:00:03 +0000 (04:00 +0000)]
Moved and renamed ui issue tests.

5 years agoAuto merge of #55106 - petrhosek:fuchsia-lld, r=alexcrichton
bors [Tue, 6 Nov 2018 01:20:58 +0000 (01:20 +0000)]
Auto merge of #55106 - petrhosek:fuchsia-lld, r=alexcrichton

Use lld directly for Fuchsia target

Fuchsia already uses lld as the default linker, so there's no reason
to always invoke it through Clang, instead we can simply invoke lld
directly and pass the set of flags that matches Clang.

5 years agoUse lld directly for Fuchsia target
Petr Hosek [Tue, 16 Oct 2018 00:27:07 +0000 (17:27 -0700)]
Use lld directly for Fuchsia target

Fuchsia already uses lld as the default linker, so there's no reason
to always invoke it through Clang, instead we can simply invoke lld
directly and pass the set of flags that matches Clang.

5 years agoAuto merge of #54922 - murarth:rc-ub-fix, r=alexcrichton
bors [Mon, 5 Nov 2018 22:20:25 +0000 (22:20 +0000)]
Auto merge of #54922 - murarth:rc-ub-fix, r=alexcrichton

Fix undefined behavior in Rc/Arc allocation

Manually calculate allocation layout for `Rc`/`Arc` to avoid undefined behavior

Closes #54908