Commit Graph

85846 Commits

Author SHA1 Message Date
Guillaume Gomez
4381772695 Fix invalid panic setup message 2018-11-23 00:13:44 +01:00
bors
b76ee83254 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)
2018-11-11 06:26:21 +00:00
kennytm
7031e4e7c7
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.
2018-11-11 12:34:23 +08:00
kennytm
d0b68c0dde
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.
;
2018-11-11 12:33:50 +08:00
kennytm
75e920f847
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
2018-11-11 12:32:01 +08:00
bors
9b8f902976 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
2018-11-11 03:44:16 +00:00
Pietro Albini
17ae50765e
Rollup merge of #55844 - waywardmonkeys:typo-fixes, r=varkor
Fix documentation typos.
2018-11-11 00:21:25 +01:00
Pietro Albini
417b10a0e3
Rollup merge of #55839 - dralley:docstring-spelling, r=TimNN
Fix docstring spelling mistakes
2018-11-11 00:21:24 +01:00
Pietro Albini
0f1c1eb480
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
2018-11-11 00:21:23 +01:00
Pietro Albini
4c50964c5f
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
2018-11-11 00:21:22 +01:00
Pietro Albini
c4ca49aebd
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
2018-11-11 00:21:21 +01:00
Pietro Albini
e8a3934599
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%.
2018-11-11 00:21:20 +01:00
Pietro Albini
5b0b0ce61e
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.
2018-11-11 00:21:19 +01:00
Pietro Albini
18195d4133
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 )
2018-11-11 00:21:17 +01:00
Pietro Albini
ff8ee964ae
Rollup merge of #55800 - estebank:abolish-ice-for-lifetime, r=oli-obk
Fix ICE in `return_type_impl_trait`

Fix #55796.
2018-11-11 00:21:16 +01:00
Pietro Albini
8c4bfb833b
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
2018-11-11 00:21:15 +01:00
Pietro Albini
e121305abd
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
2018-11-11 00:21:14 +01:00
Pietro Albini
d2aeef06f2
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
2018-11-11 00:21:13 +01:00
Pietro Albini
f0a6e3a583
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.
2018-11-11 00:21:12 +01:00
Pietro Albini
0e912b2c17
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
2018-11-11 00:21:11 +01:00
bors
6408162ea1 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
2018-11-10 23:16:25 +00:00
QuietMisdreavus
2f8ce732e1 move all static-file include!s into a single module 2018-11-10 16:05:29 -06:00
bors
6e9b842962 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.
2018-11-10 19:58:14 +00:00
ljedrz
2f99d09ef7 codegen_llvm_back: simplify a conversion to char 2018-11-10 19:25:25 +01:00
ljedrz
815a3b6b69 codegen_llvm_back: remove a redundant continue 2018-11-10 19:25:25 +01:00
ljedrz
4d88914a27 codegen_llvm_back: possible minor speedup in logic 2018-11-10 19:25:24 +01:00
ljedrz
3968ada006 codegen_llvm_back: use mem::replace instead of swap where more concise 2018-11-10 19:25:24 +01:00
ljedrz
ed5802c4d1 codegen_llvm_back: remove 'static from consts 2018-11-10 19:25:23 +01:00
ljedrz
0195d9b95f codegen_llvm_back: use to_owned instead of to_string with string literals 2018-11-10 19:25:23 +01:00
ljedrz
3dbb2cc864 codegen_llvm_back: improve common patterns 2018-11-10 19:25:22 +01:00
ljedrz
4286c3c1b0 codegen_llvm_back: remove explicit returns 2018-11-10 19:25:21 +01:00
ljedrz
c4c39e9395 codegen_llvm_back: use Cow<'static, str> where applicable 2018-11-10 19:22:38 +01:00
ljedrz
1d1dc48407 codegen_llvm_back: whitespace & formatting fixes 2018-11-10 19:22:37 +01:00
Nikita Popov
48aa602548 Set BINARYEN_TRAP_MODE=clamp
This avoids trapping in the -Zsaturating-float-casts implementation.
2018-11-10 14:09:49 +01:00
Bruce Mitchener
9b4d68e53b Fix documentation typos. 2018-11-10 19:31:49 +07:00
bors
42959a24a1 Auto merge of #55830 - alexcrichton:update-cargo, r=alexcrichton
Update Cargo submodule

Hopefully a relatively routine update!
2018-11-10 12:21:58 +00:00
bors
4cd3294a1d 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
2018-11-10 09:38:10 +00:00
bors
0366ccafa6 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
2018-11-10 07:03:04 +00:00
Daniel Alley
38d2f9b470 Fix docstring spelling mistakes 2018-11-09 23:14:46 -05:00
Wesley Wiser
3cce5c7977 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.
2018-11-09 22:11:40 -05:00
bors
06118eac4c 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.
2018-11-10 01:16:02 +00:00
Alex Crichton
62d78010a9 Update Cargo submodule
Hopefully a relatively routine update!
2018-11-09 12:59:05 -08:00
Esteban Küber
a90240d279 Simplify logic 2018-11-09 10:16:07 -08:00
Oliver Scherer
f4c9dd55d6 Add missing rustc_promotable attribute to unsigned min_value and max_value 2018-11-09 17:55:24 +01:00
Nikita Popov
82574e9ec8 Pull in fix for dist-i686-linux build 2018-11-09 16:59:45 +01:00
David Wood
e6a466e60c
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.
2018-11-09 15:39:32 +01:00
Felix S. Klock II
5f91373c77 Typecheck patterns of all match arms first, so we get types for bindings. 2018-11-09 12:06:12 +01:00
Oliver Scherer
1206549d1b Fix tidy 2018-11-09 10:11:20 +01:00
Nicholas Nethercote
a66d7b2001 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%.
2018-11-09 18:57:18 +11:00
bors
36a50c29f6 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
2018-11-09 06:56:25 +00:00