Commit Graph

74495 Commits

Author SHA1 Message Date
kennytm
dc9d93f220
Rollup merge of #48167 - Mark-Simulacrum:remove-allocation-codemap, r=estebank
Remove allocation from width of character function.

Locally this seems to eliminate the problem or at least resolve most of the
issue.

Fixes #48153.

r? @estebank
2018-02-14 18:25:27 +08:00
kennytm
526e9548dc
Rollup merge of #48165 - alexcrichton:update-read2, r=Mark-Simulacrum
Update compiletest's `read2` function

This was originally copied over from Cargo and Cargo has since [been
updated][update] so let's pull in the fixes here too!

[update]: https://github.com/rust-lang/cargo/pull/5030
2018-02-14 18:25:26 +08:00
kennytm
92c66b78c8
Rollup merge of #48163 - alexcrichton:persistent-linker, r=rkruppe
rustc: Persist LLVM's `Linker` in Fat LTO

This commit updates our Fat LTO logic to tweak our custom wrapper around LLVM's
"link modules" functionality. Previously whenever the
`LLVMRustLinkInExternalBitcode` function was called it would call LLVM's
`Linker::linkModules` wrapper. Internally this would crate an instance of a
`Linker` which internally creates an instance of an `IRMover`. Unfortunately for
us the creation of `IRMover` is somewhat O(n) with the input module. This means
that every time we linked a module it was O(n) with respect to the entire module
we had built up!

Now the modules we build up during LTO are quite large, so this quickly started
creating an O(n^2) problem for us! Discovered in #48025 it turns out this has
always been a problem and we just haven't noticed it. It became particularly
worse recently though due to most libraries having 16x more object files than
they previously did (1 -> 16).

This commit fixes this performance issue by preserving the `Linker` instance
across all links into the main LLVM module. This means we only create one
`IRMover` and allows LTO to progress much speedier.

From the `cargo-cache` project in #48025 a **full build** locally went from
5m15s to 2m24s. Looking at the timing logs each object file was linked in in
single-digit millisecond rather than hundreds, clearly being a nice improvement!

Closes #48025
2018-02-14 18:25:24 +08:00
kennytm
d38e11ee10
Rollup merge of #48162 - michaelwoerister:stabler-svh, r=nikomatsakis
Handle path prefix mapping in a more stable way when computing the crate hash

This hopefully fixes issue https://github.com/rust-lang/rust/issues/48019.

cc @luser @infinity0
2018-02-14 18:25:23 +08:00
kennytm
bebd2fbfc8
Rollup merge of #48156 - Centril:feature/iterator_repeat_with, r=alexcrichton
Add std/core::iter::repeat_with

Adds an iterator primitive `repeat_with` which is the "lazy" version of `repeat` but also more flexible since you can build up state with the `FnMut`. The design is mostly taken from `repeat`.

r? @rust-lang/libs
cc @withoutboats, @scottmcm
2018-02-14 18:25:22 +08:00
kennytm
dcb15269f6
Rollup merge of #48154 - estebank:issue-31481, r=nikomatsakis
Continue parsing function after finding `...` arg

When encountering a variadic argument in a function definition that
doesn't accept it, if immediately after there's a closing paren,
continue parsing as normal. Otherwise keep current behavior of emitting
error and stopping.

Fix #31481.
2018-02-14 18:25:21 +08:00
kennytm
c4b211bdba
Rollup merge of #48151 - echochamber:update_range_example, r=estebank
Update ops range example to avoid confusion between indexes and values.

Makes clearer the numbers in the range refer to indexes, not the values at those indexes.
2018-02-14 18:25:19 +08:00
kennytm
5a193668db
Rollup merge of #48133 - matthiaskrgr:endianess_to_endianness, r=oli-obk
typo: correct endianess to endianness (this also changes function names!)
2018-02-14 18:25:18 +08:00
kennytm
3bcaaf47a1
Rollup merge of #48130 - ollie27:stab, r=Mark-Simulacrum
Correct a few stability attributes

* `core_float_bits`, `duration_core`, `path_component_asref`, and `repr_align` were stabalized in 1.25.0 not 1.24.0.
* Impls for `NonNull` involving unstable things should remain unstable.
* `Duration` should remain stable since 1.3.0 so it appears correctly in the `std` docs.
* `cursor_mut_vec` is an impl on only stable things so should be marked stable.
2018-02-14 18:25:16 +08:00
kennytm
83bed7d3a7
Rollup merge of #48126 - newpavlov:patch-1, r=alexcrichton
Whitelist pclmulqdq x86 feature flag

Relevant `stdsimd` [issue](https://github.com/rust-lang-nursery/stdsimd/issues/318).
2018-02-14 18:25:14 +08:00
kennytm
c02c5f4b60
Rollup merge of #48114 - kennytm:xcode9, r=alexcrichton
Upgrade the Travis CI macOS images for testing from Xcode 8.3 to 9.2.

Retry of #47749, since LLVM 6 has been merged.
2018-02-14 18:25:12 +08:00
kennytm
bd3674e4de
Rollup merge of #48087 - scottmcm:range_is_empty, r=kennytm,alexcrichton
Add Range[Inclusive]::is_empty

During https://github.com/rust-lang/rfcs/pull/1980, it was discussed that figuring out whether a range is empty was subtle, and thus there should be a clear and obvious way to do it.  It can't just be ExactSizeIterator::is_empty (also unstable) because not all ranges are ExactSize -- such as `Range<i64>` and `RangeInclusive<usize>`.

Things to ponder:
- Unless this is stabilized first, this makes stabilizing ExactSizeIterator::is_empty more icky, since this hides that.
- This is only on `Range` and `RangeInclusive`, as those are the only ones where it's interesting.  But one could argue that it should be on more for consistency, or on RangeArgument instead.
- The bound on this is PartialOrd, since that works ok (see tests for float examples) and is consistent with `contains`.  But ranges like `NAN..=NAN`_are_ kinda weird.
- [x] ~~There's not a real issue number on this yet~~
2018-02-14 16:14:33 +08:00
kennytm
3715f1e490
Rollup merge of #48065 - Xaeroxe:patch-1, r=alexcrichton
Apply optimization from #44355 to retain

As discussed in #44355 this PR applies a similar optimization to `Vec::retain`.  For `drain_filter`, a very similar function, this improved performance by up to 20%.
2018-02-14 16:14:32 +08:00
kennytm
a5c3209374
Rollup merge of #48033 - GuillaumeGomez:better-char-cast-message, r=estebank
Show better warning for trying to cast non-u8 scalar to char

Fixes #44201.
2018-02-14 16:14:31 +08:00
kennytm
c88a6fe569
Rollup merge of #48005 - panicbit:env_unimpl_send_sync, r=alexcrichton
Unimplement Send/Sync for ::env::{Args,ArgsOs,Vars,VarsOs}

Fixes #48004
2018-02-14 16:14:30 +08:00
kennytm
2be44ceaa2
Rollup merge of #47846 - roblabla:bugfix-ocaml, r=kennytm
Work around LLVM OCAML binding installation failure

Hello,

I have OCaml installed on my machine, and compiling rust systematically fails when LLVM attempts installing the OCaml bindings in `/usr/lib/ocaml`, which is write-protected. Here are the logs: https://gist.github.com/roblabla/3f147914c5df627c9d97ab311ba133ad

Some digging around the issue reveals:

- The code that finds if OCaml is installed, and sets the bindings to be compiled/installed: b24a45d2e9/cmake/config-ix.cmake (L612)
- b24a45d2e9/bindings/ocaml/llvm/CMakeLists.txt Some code that does the installation.

The problem seems to be that `LLVM_OCAML_INSTALL_PATH` is set to `OCAML_STDLIB_PATH` by default, which is in `/usr/lib/ocaml`, instead of the prefix.

This PR "fixes" the issue by setting `LLVM_OCAML_INSTALL_PATH` to `usr/lib/ocaml`. I haven't found a way to make LLVM not build OCaml, which would probably be a superior fix.
2018-02-14 16:14:29 +08:00
kennytm
c89976e556
Rollup merge of #47806 - PramodBisht:feature/47801, r=steveklabnik
Changed color of struct link from #ff794d to #2dbfb8 for Rust docs

This is in reference to https://github.com/rust-lang/rust/issues/47801

here I have changed the default color of struct link for `#ff794d` to `#2dbfb8`

cc: @nagisa  @timClicks
2018-02-14 16:14:28 +08:00
kennytm
8671f6931f
Rollup merge of #47784 - alexcrichton:less-dsymutil, r=michaelwoerister
rustc: Add the ability to not run dsymutil

This commit adds the ability for rustc to not run `dsymutil` by default
on OSX. A new codegen option, `-Z run-dsymutil=no`, was added to specify
that `dsymutil` should *not* run and instead the compiler should
unconditionally keep the object files around in a compilation if
necessary for debug information.

cc #47240
2018-02-14 16:14:27 +08:00
Nick Cameron
fa94c5c311 Update RLS 2018-02-14 21:13:30 +13:00
Mark Simulacrum
a64575c3bd Fix default Steps without paths.
Some Steps are by-default run but don't have any paths associated with
them. We need to have at least one PathSet per each Step, though, so we
add an empty one on calls to `never()`.
2018-02-13 18:46:29 -07:00
Guillaume Gomez
9a30673d2b Add missing feature 2018-02-14 01:34:30 +01:00
Paolo Teti
893fc32744 Update compiler-builtins to latest master.
- Rebase compiler-rt to LLVM 6
- New VFP intrinsics on ARM
- Add generic conversion from a narrower to a wider FP type (f32->f64)
- Fixes minor issues on _subsf3, __subdf3 and __aeabi_fcmple
- Split test suite to a separate crate
2018-02-13 22:39:11 +01:00
Shaun Steenkamp
e034dddb32 38880 remove unnecessary self.table.size check 2018-02-13 20:25:10 +00:00
Shaun Steenkamp
f3330cea7f 38880 fix incorrect negation 2018-02-13 17:15:58 +00:00
Shaun Steenkamp
94c3c84b6a 38880 hashmap check size=0, not just capacity=0 2018-02-13 16:40:02 +00:00
Shaun Steenkamp
a295ec1ec9 38880 restore original entry(key) method 2018-02-13 16:32:35 +00:00
Jacob Kiesel
fbad3b2468
Switch to retain calling drain_filter. 2018-02-13 08:48:25 -07:00
Mark Simulacrum
7cf5ea02a9 Add note about Cargo cwd change to release notes 2018-02-13 08:08:38 -07:00
kennytm
7984c895b6
Improve debuggability of #48116.
1. When the invalid condition is hit, write out the relevant variables too
2. In compile-fail/parse-fail tests, check for ICE first, so the invalid
   error patterns won't mask our ICE output.
2018-02-13 22:48:16 +08:00
Michael Woerister
580dd42cfa incr.comp.: Run cache directory garbage collection before loading dep-graph. 2018-02-13 13:37:32 +01:00
Michael Woerister
0397fc1b3a Handle path prefix mapping in a more stable way when computing the crate hash. 2018-02-13 10:55:54 +01:00
Mazdak Farrokhzad
db13296b6f core::iter::repeat_with: fix missing word, see @Pazzaz's review 2018-02-13 06:20:17 +01:00
bors
4d2d3fc5da Auto merge of #47804 - retep007:recursive-requirements, r=pnkfelix
Optimized error reporting for recursive requirements #47720

Fixes #47720
2018-02-13 00:14:11 +00:00
Mazdak Farrokhzad
91a4b9044d core::iter::repeat_with: tracking issue is #48169 2018-02-12 21:47:59 +01:00
Mark Simulacrum
f237e9e2e7 Remove allocation from width of character function. 2018-02-12 12:28:32 -07:00
Alex Crichton
4c658f76c1 Update compiletest's read2 function
This was originally copied over from Cargo and Cargo has since [been
updated][update] so let's pull in the fixes here too!

[update]: https://github.com/rust-lang/cargo/pull/5030
2018-02-12 10:46:31 -08:00
Alex Crichton
43e8ac27d9 rustc: Persist LLVM's Linker in Fat LTO
This commit updates our Fat LTO logic to tweak our custom wrapper around LLVM's
"link modules" functionality. Previously whenever the
`LLVMRustLinkInExternalBitcode` function was called it would call LLVM's
`Linker::linkModules` wrapper. Internally this would crate an instance of a
`Linker` which internally creates an instance of an `IRMover`. Unfortunately for
us the creation of `IRMover` is somewhat O(n) with the input module. This means
that every time we linked a module it was O(n) with respect to the entire module
we had built up!

Now the modules we build up during LTO are quite large, so this quickly started
creating an O(n^2) problem for us! Discovered in #48025 it turns out this has
always been a problem and we just haven't noticed it. It became particularly
worse recently though due to most libraries having 16x more object files than
they previously did (1 -> 16).

This commit fixes this performance issue by preserving the `Linker` instance
across all links into the main LLVM module. This means we only create one
`IRMover` and allows LTO to progress much speedier.

From the `cargo-cache` project in #48025 a **full build** locally when from
5m15s to 2m24s. Looking at the timing logs each object file was linked in in
single-digit millisecond rather than hundreds, clearly being a nice improvement!

Closes #48025
2018-02-12 09:11:06 -08:00
Mazdak Farrokhzad
9cee79a7ff core::iter::repeat_with: document DoubleEndedIterator behavior 2018-02-12 18:03:56 +01:00
Alex Crichton
0f16eee013 rustc: Add the ability to not run dsymutil
This commit adds the ability for rustc to not run `dsymutil` by default
on OSX. A new codegen option, `-Z run-dsymutil=no`, was added to specify
that `dsymutil` should *not* run and instead the compiler should
unconditionally keep the object files around in a compilation if
necessary for debug information.

cc #47240
2018-02-12 07:44:40 -08:00
Shaun Steenkamp
fd78621717 38880 fixup add missing mut 2018-02-12 14:53:29 +00:00
Shaun Steenkamp
29f71488bc 38880 remove redundant extra function 2018-02-12 14:00:08 +00:00
Antoni Boucher
146b81c2c6 Fix tidy errors 2018-02-12 08:07:10 -05:00
bors
16362c737f Auto merge of #47843 - estebank:teach, r=nikomatsakis
Add `-Zteach` documentation

Add extra inline documentation to E0019, E0016, E0013, E0396, E0017,
E0018, E0010, E0022, E0030, E0029, E0033, E0026 and E0027.

Follow up to #47652.
2018-02-12 09:38:40 +00:00
Mazdak Farrokhzad
efa332038c core::iter::repeat_with: fix doc tests 2018-02-12 09:18:22 +01:00
Mazdak Farrokhzad
55c669c4d9 core::iter::repeat_with: fix tests some more 2018-02-12 09:15:13 +01:00
Mazdak Farrokhzad
f025eff21d core::iter::repeat_with: fix tests 2018-02-12 09:13:47 +01:00
Mazdak Farrokhzad
1af9ee1350 core::iter::repeat_with: derive Copy, Clone, Debug 2018-02-12 08:35:12 +01:00
Mazdak Farrokhzad
c4099ca4b1 core::iter::repeat_with: general fixes 2018-02-12 08:25:39 +01:00
Mazdak Farrokhzad
0f789aad2b add core::iter::repeat_with 2018-02-12 08:05:46 +01:00
bors
b54f27ba36 Auto merge of #48144 - kennytm:reduce-musl-test-size, r=Mark-Simulacrum
Compiletest: delete the compiled program once its test is done.

Reduces CI disk usage which prevents #48118 from succeeding.
2018-02-12 06:43:24 +00:00