Commit Graph

86258 Commits

Author SHA1 Message Date
QuietMisdreavus
401cb6bb53 don't inline pub use some_crate unless directly asked to 2018-11-09 09:07:57 -06: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
Aaron Power
efad877c44 Updated RELEASES.md for 1.31.0 2018-11-09 12:12:31 +00: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
Mark Rousskov
d293d1eea0
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
2018-11-08 18:15:24 -07:00
Mark Rousskov
667904f049
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
2018-11-08 18:15:21 -07:00
Mark Rousskov
686de87d2f
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.
2018-11-08 18:15:19 -07:00
Mark Rousskov
7125b8fa07
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
2018-11-08 18:15:17 -07:00
Mark Rousskov
6117195bac
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.
2018-11-08 18:15:14 -07:00
Mark Rousskov
2d0a697852
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.
2018-11-08 18:15:12 -07:00
Mark Rousskov
7944075e0b
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
2018-11-08 18:15:10 -07:00
Mark Rousskov
660340e4aa
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`
2018-11-08 18:15:08 -07:00
Mark Rousskov
7864780f9e
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
2018-11-08 18:15:05 -07:00
Mark Rousskov
792476516f
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
2018-11-08 18:15:03 -07:00
Mark Rousskov
96ee13a56d
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!
2018-11-08 18:15:01 -07:00
Mark Rousskov
e873984fa8
Rollup merge of #55736 - estebank:elide-anon-lt, r=petrochenkov
Elide anon lifetimes in conflicting impl note

Fix #54690.
2018-11-08 18:14:58 -07:00
Mark Rousskov
8fd4e5a467
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.
2018-11-08 18:14:56 -07:00
Mark Rousskov
602a8b400f
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.
2018-11-08 18:14:53 -07:00
Mark Rousskov
4805a97274
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
2018-11-08 18:14:51 -07:00
Mark Rousskov
78cab36139
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.
2018-11-08 18:14:49 -07:00
Mark Rousskov
6153ce127a
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.
2018-11-08 18:14:46 -07:00
Felix S. Klock II
9b6a568c6f 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...)
2018-11-09 00:26:28 +01:00
Felix S. Klock II
d0151cac17 Switch to using // revisions to explicit encode NLL's change to Box treatment. 2018-11-09 00:21:46 +01:00
Esteban Küber
24289a050a Sidestep ICE in type_of_def_id() when called from return_type_impl_trait 2018-11-08 15:18:55 -08:00
Felix S. Klock II
92ef0c4bff Make test robust to NLL, in sense of ensuring borrows extend to something approximating lexical scope. 2018-11-09 00:14:11 +01:00
Felix S. Klock II
918f70f628 Removed an unneeded instance of // revisions; the compare-mode NLL shows the output is identical now. 2018-11-09 00:03:17 +01:00
Stjepan Glavina
d75dae3069 Deprecate channel selection 2018-11-08 22:51:46 +01:00
Oliver Scherer
ffa7ce4290 Add more regression tests 2018-11-08 20:18:26 +01:00
Oliver Scherer
df10965dc0 Prevent ICE in const-prop array oob check 2018-11-08 20:15:13 +01:00
Murarth
317f494c72 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
2018-11-08 11:50:02 -07:00
Nikita Popov
b1a33971ab Fix some tests for wasm32-unknown-emscripten 2018-11-08 18:17:57 +01:00
varkor
56acb2a001
Fix typo in comment
Co-Authored-By: Aaron1011 <aa1ronham@gmail.com>
2018-11-08 12:15:26 -05:00
Stjepan Glavina
f211581330 Use T: ?Sized in intrinsics::forget 2018-11-08 17:58:12 +01:00
Tim Neumann
50a2d47b4f Support for the program data address space option
of LLVM's Target Datalayout.

https://llvm.org/docs/LangRef.html#data-layout
2018-11-08 17:46:30 +01:00
Stjepan Glavina
06cf9ae7f9 Fix return type of forget intrinsic 2018-11-08 17:12:14 +01:00
Nikita Popov
6fb701e874 Fix compiletest support for wasm32-unknown-emscripten 2018-11-08 17:04:22 +01:00
Alex Crichton
255cc1aed3 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
2018-11-08 07:53:03 -08:00
Nikita Popov
ffdb2bc1c5 Update the disabled wasm32 Dockerfile 2018-11-08 16:32:42 +01:00
Nikita Popov
8407612a8d Disable wasm32 features on emscripten
These are only supported by the native wasm32 backend.
2018-11-08 16:22:20 +01:00
Stjepan Glavina
39771339fd Allow unsized types in mem::drop and mem::forget 2018-11-08 16:09:20 +01:00
Oliver Scherer
428af73e7c Rebase fallout 2018-11-08 14:52:02 +01:00
Oliver Scherer
5d58a036de Give AllocationExtras access to their entire Allocation 2018-11-08 14:52:02 +01:00
Oliver Scherer
769ee79a69 Fallout 2018-11-08 14:52:02 +01:00
Oliver Scherer
00e524ce34 Move Pointer to its own module 2018-11-08 14:52:02 +01:00
Oliver Scherer
99ed98b1ff Move ScalarMaybeUndef into value.rs 2018-11-08 14:52:02 +01:00
Oliver Scherer
2108b6bc95 Move UndefMask and Relocations into allocation.rs 2018-11-08 14:52:02 +01:00
Oliver Scherer
6def30ba6a Move the memory_accessed hook onto the Extra value 2018-11-08 14:52:02 +01:00