]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoAdd test for sidebar link generation
Guillaume Gomez [Wed, 21 Nov 2018 22:21:50 +0000 (23:21 +0100)]
Add test for sidebar link generation

5 years agoFixes primitive sidebar link generation
Guillaume Gomez [Sun, 4 Nov 2018 20:35:09 +0000 (21:35 +0100)]
Fixes primitive sidebar link generation

5 years agoAuto merge of #55859 - pietroalbini:rollup, r=kennytm
bors [Sun, 11 Nov 2018 06:26:21 +0000 (06:26 +0000)]
Auto merge of #55859 - pietroalbini:rollup, r=kennytm

Rollup of 17 pull requests

Successful merges:

 - #55630 (resolve: Filter away macro prelude in modules with `#[no_implicit_prelude]` on 2018 edition)
 - #55687 (Take supertraits into account when calculating associated types)
 - #55745 (Convert `outlives_components`' return value to a `SmallVec` outparam.)
 - #55764 (Fix Rc/Arc allocation layout)
 - #55792 (Prevent ICE in const-prop array oob check)
 - #55799 (Removed unneeded instance of `// revisions` from a lint test)
 - #55800 (Fix ICE in `return_type_impl_trait`)
 - #55801 (NLL: Update box insensitivity test)
 - #55802 (Don't inline virtual calls (take 2))
 - #55816 (Use `SmallVec` to avoid allocations in `from_decimal_string`.)
 - #55819 (Typecheck patterns of all match arms first, so we get types for bindings)
 - #55822 (ICE with #![feature(nll)] and elided lifetimes)
 - #55828 (Add missing `rustc_promotable` attribute to unsigned `min_value` and `max_value`)
 - #55839 (Fix docstring spelling mistakes)
 - #55844 (Fix documentation typos.)
 - #55845 (Set BINARYEN_TRAP_MODE=clamp)
 - #55856 (rustdoc: refactor: move all static-file include!s into a single module)

5 years agoRollup merge of #55856 - QuietMisdreavus:static-discharge, r=GuillaumeGomez
kennytm [Sun, 11 Nov 2018 04:34:23 +0000 (12:34 +0800)]
Rollup merge of #55856 - QuietMisdreavus:static-discharge, r=GuillaumeGomez

rustdoc: refactor: move all static-file include!s into a single module

This is a smaller refactor that creates a new module `rustdoc::html::static_files`, which contains a bunch of `static` variables with all the files in `html/static` that we use. The idea behind moving them all here was to remove the duplicate `include_bytes!()` that are used by the theme-checker code. It also continues to centralize more operations in rustdoc.

5 years agoRollup merge of #55845 - nikic:emscripten-clamp-mode, r=alexcrichton
kennytm [Sun, 11 Nov 2018 04:33:50 +0000 (12:33 +0800)]
Rollup merge of #55845 - nikic:emscripten-clamp-mode, r=alexcrichton

Set BINARYEN_TRAP_MODE=clamp

This fixes the wasm32-unknown-emscripten test failure mentioned in https://github.com/rust-lang/rust/pull/55626#issuecomment-437084774, by making binaryen operate in clamp rather than trap mode.

The issue is that the current `-Zsaturating-float-casts` implementation uses `fpto[us]i` unconditionally (and selects afterwards), which does not work with trapping implementations of fpto[su]i, which emscripten uses by default.

I've left a FIXME to drop this flag once we have a better solution for saturating casts on the LLVM side.
;

5 years agoRollup merge of #55630 - petrochenkov:noprelude, r=Centril
kennytm [Sun, 11 Nov 2018 04:32:01 +0000 (12:32 +0800)]
Rollup merge of #55630 - petrochenkov:noprelude, r=Centril

resolve: Filter away macro prelude in modules with `#[no_implicit_prelude]` on 2018 edition

This is a tiny thing.
For historical reasons macro prelude (macros from `#[macro_use] extern crate ...`, including `extern crate std`) is still available in modules with `#[no_implicit_prelude]`.
This PR provides proper isolation and removes those names from scope.

`#[no_implicit_prelude]` modules still have built-in types (`u8`), built-in attributes (`#[inline]`) and built-in macros (`env!("PATH")`) in scope. We can introduce some `#[no_implicit_prelude_at_all]` to remove those as well, but that's a separate issue.

The change is done only on 2018 edition for backward compatibility.
I'm pretty sure this can be done on 2015 as well because `#[no_implicit_prelude]` is rarely used, but I don't want to go through the crater/deprecation process right now, maybe later.

cc https://github.com/rust-lang/rust/issues/53977
r? @ghost

5 years agoAuto merge of #54993 - TimNN:pda-tdl, r=eddyb
bors [Sun, 11 Nov 2018 03:44:16 +0000 (03:44 +0000)]
Auto merge of #54993 - TimNN:pda-tdl, r=eddyb

Support for the program data address space option of LLVM's Target Datalayout

This was introduced recently (specifically, for AVR, cc @dylanmckay).

(I came up with this when attempting to run [avr-rust](https://github.com/avr-rust/rust) rebased on the latest [rust-lang](https://github.com/rust-lang/rust) commits. If this requires a different design, some additional discussions, or is not something to pursue right now, I'd be happy to close this PR).

Note that this somewhat overlaps with @DiamondLovesYou's #51576, I think, although the implementation here is significantly simpler: Since the address space applies to _all_ program data, we can just check the pointee's type whenever we create an LLVM pointer type. If it is a function we use the program data address space; if not we use the default address space.

cc @eddyb, who has been reviewing #51576

Ref: https://llvm.org/docs/LangRef.html#data-layout

5 years agoRollup merge of #55844 - waywardmonkeys:typo-fixes, r=varkor
Pietro Albini [Sat, 10 Nov 2018 23:21:25 +0000 (00:21 +0100)]
Rollup merge of #55844 - waywardmonkeys:typo-fixes, r=varkor

Fix documentation typos.

5 years agoRollup merge of #55839 - dralley:docstring-spelling, r=TimNN
Pietro Albini [Sat, 10 Nov 2018 23:21:24 +0000 (00:21 +0100)]
Rollup merge of #55839 - dralley:docstring-spelling, r=TimNN

Fix docstring spelling mistakes

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

Add missing `rustc_promotable` attribute to unsigned `min_value` and `max_value`

cc @pnkfelix

fixes #55806

5 years agoRollup merge of #55822 - davidtwco:issue-55394, r=pnkfelix
Pietro Albini [Sat, 10 Nov 2018 23:21:22 +0000 (00:21 +0100)]
Rollup merge of #55822 - davidtwco:issue-55394, r=pnkfelix

ICE with #![feature(nll)] and elided lifetimes

Fixes #55394.

This commit fixes an ICE and determines the correct return span in cases
with a method implemented on a struct with an an elided lifetime.

r? @pnkfelix

5 years agoRollup merge of #55819 - pnkfelix:issue-55810-must-typeck-pats-eagerly, r=oli-obk
Pietro Albini [Sat, 10 Nov 2018 23:21:21 +0000 (00:21 +0100)]
Rollup merge of #55819 - pnkfelix:issue-55810-must-typeck-pats-eagerly, r=oli-obk

Typecheck patterns of all match arms first, so we get types for bindings

Fix eventually (after backport to beta) the issue #55810

5 years agoRollup merge of #55816 - nnethercote:from_decimal_string-SmallVec, r=oli-obk
Pietro Albini [Sat, 10 Nov 2018 23:21:20 +0000 (00:21 +0100)]
Rollup merge of #55816 - nnethercote:from_decimal_string-SmallVec, r=oli-obk

Use `SmallVec` to avoid allocations in `from_decimal_string`.

This reduces the number of allocations in a "check clean" build of
`tuple-stress` by 14%, reducing instruction counts by 0.6%.

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 #54864 - ljedrz:cleanup_codegen_llvm_back, r=Mark-Simulacrum
bors [Sat, 10 Nov 2018 23:16:25 +0000 (23:16 +0000)]
Auto merge of #54864 - ljedrz:cleanup_codegen_llvm_back, r=Mark-Simulacrum

Cleanup codegen_llvm/back

- improve allocations
- use `Cow<'static, str>` where applicable
- use `to_owned` instead of `to_string` with string literals
- remove a redundant `continue`
- possible minor speedup in logic
- use `mem::replace` instead of `swap` where more concise
- remove `'static` from consts
- improve common patterns
- remove explicit `return`s
- whitespace & formatting fixes

5 years agomove all static-file include!s into a single module
QuietMisdreavus [Sat, 10 Nov 2018 22:05:29 +0000 (16:05 -0600)]
move all static-file include!s into a single module

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 agocodegen_llvm_back: simplify a conversion to char
ljedrz [Mon, 29 Oct 2018 09:19:09 +0000 (10:19 +0100)]
codegen_llvm_back: simplify a conversion to char

5 years agocodegen_llvm_back: remove a redundant continue
ljedrz [Sat, 6 Oct 2018 09:53:23 +0000 (11:53 +0200)]
codegen_llvm_back: remove a redundant continue

5 years agocodegen_llvm_back: possible minor speedup in logic
ljedrz [Sat, 6 Oct 2018 09:52:53 +0000 (11:52 +0200)]
codegen_llvm_back: possible minor speedup in logic

5 years agocodegen_llvm_back: use mem::replace instead of swap where more concise
ljedrz [Sat, 6 Oct 2018 09:51:14 +0000 (11:51 +0200)]
codegen_llvm_back: use mem::replace instead of swap where more concise

5 years agocodegen_llvm_back: remove 'static from consts
ljedrz [Sat, 6 Oct 2018 09:50:34 +0000 (11:50 +0200)]
codegen_llvm_back: remove 'static from consts

5 years agocodegen_llvm_back: use to_owned instead of to_string with string literals
ljedrz [Sat, 6 Oct 2018 09:50:00 +0000 (11:50 +0200)]
codegen_llvm_back: use to_owned instead of to_string with string literals

5 years agocodegen_llvm_back: improve common patterns
ljedrz [Sat, 6 Oct 2018 09:49:03 +0000 (11:49 +0200)]
codegen_llvm_back: improve common patterns

5 years agocodegen_llvm_back: remove explicit returns
ljedrz [Sat, 6 Oct 2018 09:46:46 +0000 (11:46 +0200)]
codegen_llvm_back: remove explicit returns

5 years agocodegen_llvm_back: use Cow<'static, str> where applicable
ljedrz [Sat, 6 Oct 2018 09:42:14 +0000 (11:42 +0200)]
codegen_llvm_back: use Cow<'static, str> where applicable

5 years agocodegen_llvm_back: whitespace & formatting fixes
ljedrz [Sat, 6 Oct 2018 09:37:28 +0000 (11:37 +0200)]
codegen_llvm_back: whitespace & formatting fixes

5 years agoSet BINARYEN_TRAP_MODE=clamp
Nikita Popov [Sat, 10 Nov 2018 13:09:49 +0000 (14:09 +0100)]
Set BINARYEN_TRAP_MODE=clamp

This avoids trapping in the -Zsaturating-float-casts implementation.

5 years agoFix documentation typos.
Bruce Mitchener [Sat, 10 Nov 2018 12:31:49 +0000 (19:31 +0700)]
Fix documentation typos.

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 agoFix docstring spelling mistakes
Daniel Alley [Sat, 10 Nov 2018 04:12:46 +0000 (23:12 -0500)]
Fix docstring spelling mistakes

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 agoAdd missing `rustc_promotable` attribute to unsigned `min_value` and `max_value`
Oliver Scherer [Fri, 9 Nov 2018 16:55:24 +0000 (17:55 +0100)]
Add missing `rustc_promotable` attribute to unsigned `min_value` and `max_value`

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 ICE and find correct return span.
David Wood [Fri, 9 Nov 2018 14:39:32 +0000 (15:39 +0100)]
Fix ICE and find correct return span.

This commit fixes an ICE and determines the correct return span in cases
with a method implemented on a struct with an an elided lifetime.

5 years agoTypecheck patterns of all match arms first, so we get types for bindings.
Felix S. Klock II [Fri, 9 Nov 2018 11:06:12 +0000 (12:06 +0100)]
Typecheck patterns of all match arms first, so we get types for bindings.

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

5 years agoUse `SmallVec` to avoid allocations in `from_decimal_string`.
Nicholas Nethercote [Fri, 9 Nov 2018 06:12:52 +0000 (17:12 +1100)]
Use `SmallVec` to avoid allocations in `from_decimal_string`.

This reduces the number of allocations in a "check clean" build of
`tuple-stress` by 14%, reducing instruction counts by 0.6%.

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 agoSupport for the program data address space option
Tim Neumann [Thu, 11 Oct 2018 15:50:00 +0000 (17:50 +0200)]
Support for the program data address space option

of LLVM's Target Datalayout.

https://llvm.org/docs/LangRef.html#data-layout

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.