]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoMerge branch 'master' into inform_type_annotations
moe [Sat, 17 Feb 2018 14:22:26 +0000 (22:22 +0800)]
Merge branch 'master' into inform_type_annotations

6 years agofix stderr
csmoe [Sat, 17 Feb 2018 14:18:53 +0000 (14:18 +0000)]
fix stderr

6 years agoAuto merge of #47926 - mikhail-m1:subslice_pattern_array_drop2, r=nikomatsakis
bors [Sat, 17 Feb 2018 08:44:41 +0000 (08:44 +0000)]
Auto merge of #47926 - mikhail-m1:subslice_pattern_array_drop2, r=nikomatsakis

add transform for uniform array move out

reworked second step for fix #34708
previous try #46686
r? @nikomatsakis

6 years agoAuto merge of #47917 - davidtwco:issue-47703, r=nikomatsakis
bors [Sat, 17 Feb 2018 05:53:55 +0000 (05:53 +0000)]
Auto merge of #47917 - davidtwco:issue-47703, r=nikomatsakis

Fixes NLL: error from URL crate

Fixes #47703.

r? @nikomatsakis

6 years agoAuto merge of #47906 - Zoxc:nocycle, r=nikomatsakis
bors [Sat, 17 Feb 2018 02:58:21 +0000 (02:58 +0000)]
Auto merge of #47906 - Zoxc:nocycle, r=nikomatsakis

Add a `fatal_cycle` attribute for queries which indicates that they will cause a fatal error on query cycles

This moves us towards the goal of having cycle errors be non-fatal by not relying on the default implementation of `ty::maps::values::Value` which aborts on errors.

r? @nikomatsakis

6 years agoAuto merge of #48252 - Mark-Simulacrum:exclude-paths, r=alexcrichton
bors [Fri, 16 Feb 2018 15:20:10 +0000 (15:20 +0000)]
Auto merge of #48252 - Mark-Simulacrum:exclude-paths, r=alexcrichton

Fix not running some steps in CI

We'd previously assumed that these paths would be relative to the src
dir, and that for example our various CI scripts would, when calling
x.py, use `../x.py build ../src/tools/...` but this isn't the case --
they use `../x.py` without using the relevant source-relative path.

We eventually may want to make this (actually somewhat logical) change,
but this is not that time.

r? @kennytm

6 years agoFix panic when `x.py` is called without any arguments.
kennytm [Fri, 16 Feb 2018 06:27:45 +0000 (14:27 +0800)]
Fix panic when `x.py` is called without any arguments.

6 years agoAuto merge of #46714 - leodasvacas:refactor-structurally-resolve-type, r=nikomatsakis
bors [Fri, 16 Feb 2018 03:38:44 +0000 (03:38 +0000)]
Auto merge of #46714 - leodasvacas:refactor-structurally-resolve-type, r=nikomatsakis

Refactor diverging and numeric fallback.

This refactoring tries to make numeric fallback easier to reason about. Instead of applying all fallbacks at an arbitrary point in the middle of inference, we apply the fallback only when necessary and only for
the variable that requires it. The only place that requires early fallback is the target of numeric casts.

The  visible consequences is that some error messages that got `i32` now get `{integer}` because we are less eager about fallback.

The bigger goal is to make it easier to integrate user fallbacks into inference, if we ever figure that out.

6 years agoConsider paths passed to x.py to be root-relative.
Mark Simulacrum [Fri, 16 Feb 2018 01:12:04 +0000 (18:12 -0700)]
Consider paths passed to x.py to be root-relative.

We'd previously assumed that these paths would be relative to the src
dir, and that for example our various CI scripts would, when calling
x.py, use `../x.py build ../src/tools/...` but this isn't the case --
they use `../x.py` without using the relevant source-relative path.

We eventually may want to make this (actually somewhat logical) change,
but this is not that time.

6 years agoPrevent silently ignoring unmatched paths
Mark Simulacrum [Fri, 16 Feb 2018 01:01:26 +0000 (18:01 -0700)]
Prevent silently ignoring unmatched paths

Primarily for CI purposes; this is intended to avoid cases where we
update rustbuild and unintentionally make CI stop running some builds to
the arguments being passed no longer applying for some reason.

6 years agoAuto merge of #45404 - giannicic:defaultimpl2, r=nikomatsakis
bors [Fri, 16 Feb 2018 00:03:10 +0000 (00:03 +0000)]
Auto merge of #45404 - giannicic:defaultimpl2, r=nikomatsakis

#37653 support `default impl` for specialization

this commit implements the second part of the `default impl` feature:

>  - a `default impl` need not include all items from the trait
>  - a `default impl` alone does not mean that a type implements the trait

The first point allows rustc to compile and run something like this:

```
trait Foo {
    fn foo_one(&self) -> &'static str;
    fn foo_two(&self) -> &'static str;
}

default impl<T> Foo for T {
    fn foo_one(&self) -> &'static str {
        "generic"
    }
}

struct MyStruct;

fn  main() {
    assert!(MyStruct.foo_one() == "generic");
}
```

but it shows a proper error if trying to call `MyStruct.foo_two()`

The second point allows a `default impl` to be considered as not implementing the `Trait` if it doesn't implement all the trait items.
The tests provided (in the compile-fail section) should cover all the possible trait resolutions.
Let me know if some tests is missed.

See [referenced ](https://github.com/rust-lang/rust/issues/37653) issue for further info

r? @nikomatsakis

6 years agoadd Self: Trait<..> inside the param_env of a default impl
Gianni Ciccarelli [Wed, 14 Feb 2018 17:25:42 +0000 (17:25 +0000)]
add Self: Trait<..> inside the param_env of a default impl

6 years agoAuto merge of #48203 - kennytm:rollup, r=kennytm
bors [Thu, 15 Feb 2018 13:35:20 +0000 (13:35 +0000)]
Auto merge of #48203 - kennytm:rollup, r=kennytm

Rollup of 23 pull requests

- Successful merges: #47784, #47806, #47846, #48005, #48033, #48065, #48087, #48114, #48126, #48130, #48133, #48151, #48154, #48156, #48162, #48163, #48165, #48167, #48181, #48186, #48195, #48035, #48210
- Failed merges:

6 years agoAuto merge of #48105 - Mark-Simulacrum:exclude-paths, r=alexcrichton
bors [Thu, 15 Feb 2018 10:32:33 +0000 (10:32 +0000)]
Auto merge of #48105 - Mark-Simulacrum:exclude-paths, r=alexcrichton

Implement excluding a build-step via --exclude

First step to fixing https://github.com/rust-lang/rust/issues/47911. This doesn't change any CI configuration, but implements what I believe necessary to make that feasible in rustbuild.

In theory this should be sufficient to allow someone to open a PR against .travis.yml and appveyor.yml which splits the Windows 32-bit tests and maybe the OS X tests into multiple builders (depending on what our cost-concerns are) to reduce runtimes.

r? @alexcrichton
cc @kennytm

6 years agoRollup merge of #48210 - jacob-hughes:clarify_sized_trait_in_api_docs, r=QuietMisdreavus
kennytm [Thu, 15 Feb 2018 06:36:48 +0000 (14:36 +0800)]
Rollup merge of #48210 - jacob-hughes:clarify_sized_trait_in_api_docs, r=QuietMisdreavus

Clarified why `Sized` bound not implicit on trait's implicit `Self` type.

This part of the documentation was a little confusing to me on first read. I've added a couple lines for further explanation. Hopefully this makes things a bit clearer for new readers.

6 years agoAuto merge of #48202 - nrc:update, r=kennytm
bors [Thu, 15 Feb 2018 04:37:19 +0000 (04:37 +0000)]
Auto merge of #48202 - nrc:update, r=kennytm

Update RLS

Should fix the RLS test breakage.

r? @alexcrichton

6 years agoNormalizing associated types when checking borrows in drops.
David Wood [Wed, 14 Feb 2018 18:14:31 +0000 (18:14 +0000)]
Normalizing associated types when checking borrows in drops.

6 years agoReview change - Expanded on explanation.
Jacob Hughes [Wed, 14 Feb 2018 19:14:25 +0000 (19:14 +0000)]
Review change - Expanded on explanation.

6 years agocheck that types "need drop" before we access them
Niko Matsakis [Mon, 5 Feb 2018 19:49:27 +0000 (14:49 -0500)]
check that types "need drop" before we access them

Also, add some comments and remove extra deref.

6 years agoSimplified logic and corrected shallow to deep.
David Wood [Mon, 5 Feb 2018 17:04:25 +0000 (17:04 +0000)]
Simplified logic and corrected shallow to deep.

6 years agoHandle recursive case of dropping structs with field accesses when struct has no...
David Wood [Thu, 1 Feb 2018 12:27:56 +0000 (12:27 +0000)]
Handle recursive case of dropping structs with field accesses when struct has no dtor.

6 years agoFixed incorrect reporting of errors when checking borrows in drops.
David Wood [Wed, 31 Jan 2018 23:46:05 +0000 (23:46 +0000)]
Fixed incorrect reporting of errors when checking borrows in drops.

6 years agoAdded tests for #47703
David Wood [Sat, 27 Jan 2018 20:15:18 +0000 (20:15 +0000)]
Added tests for #47703

6 years agoExclude clippy lints from tidy license check
Mark Simulacrum [Wed, 14 Feb 2018 16:57:21 +0000 (09:57 -0700)]
Exclude clippy lints from tidy license check

6 years agoAuto merge of #48209 - kennytm:try-fix-48116, r=alexcrichton
bors [Wed, 14 Feb 2018 16:05:19 +0000 (16:05 +0000)]
Auto merge of #48209 - kennytm:try-fix-48116, r=alexcrichton

Try to fix 48116 and 48192

The bug #48116 happens because of a misoptimization of the `import_path_to_string` function, where a `names` slice is empty but the `!names.is_empty()` branch is executed.

https://github.com/rust-lang/rust/blob/4d2d3fc5dadf894a8ad709a5860a549f2c0b1032/src/librustc_resolve/resolve_imports.rs#L1015-L1042

Yesterday, @eddyb had locally reproduced the bug, and [came across the `position` function](https://mozilla.logbot.info/rust-infra/20180214#c14296834) where the `assume()` call is found to be suspicious. We have *not* concluded that this `assume()` causes #48116, but given [the reputation of `assume()`](https://github.com/rust-lang/rust/pull/45501#issuecomment-340159627), this seems higher relevant. Here we try to see if commenting it out can fix the errors.

Later @alexcrichton has bisected and found a potential bug [in the LLVM side](https://github.com/rust-lang/rust/issues/48116#issuecomment-365624777). We are currently testing if reverting that LLVM commit is enough to stop the bug. If true, this PR can be reverted (keep the `assume()`) and we could backport the LLVM patch instead.

(This PR also includes an earlier commit from #48127 for help debugging ICE happening in compile-fail/parse-fail tests.)

The PR also reverts #48059, which seems to cause #48192.

r? @alexcrichton
cc @eddyb, @arthurprs (#47333)

6 years agoRevert "rustbuild: Pass `ccache` to build scripts"
Alex Crichton [Wed, 14 Feb 2018 15:44:53 +0000 (07:44 -0800)]
Revert "rustbuild: Pass `ccache` to build scripts"

This reverts commit 64a8730e171367e4979cd9c25f0e0fdc2c157446.

6 years agoPartially revert #47333.
kennytm [Wed, 14 Feb 2018 15:18:18 +0000 (23:18 +0800)]
Partially revert #47333.

Removed the `assume()` which we assumed is the cause of misoptimization in
issue #48116.

6 years agoClarified why `Sized` bound not implicit on trait's implicit `Self` type.
Jacob Hughes [Wed, 14 Feb 2018 11:30:53 +0000 (11:30 +0000)]
Clarified why `Sized` bound not implicit on trait's implicit `Self` type.

6 years agoRollup merge of #48035 - technicalguy:Early-exit-empty-hashmap-38880, r=arthurprs
kennytm [Wed, 14 Feb 2018 10:28:39 +0000 (18:28 +0800)]
Rollup merge of #48035 - technicalguy:Early-exit-empty-hashmap-38880, r=arthurprs

Early exit for empty HashMap (issue #38880)

Addresses issue #38880 by checking if the HashMap is empty before computing the value of the hash.

Before (integer keys)
```
running 4 tests
test empty_once ... bench:          13 ns/iter (+/- 0)
test empty_100  ... bench:       1,367 ns/iter (+/- 35)
test exist_once ... bench:          14 ns/iter (+/- 0)
test exist_100  ... bench:       1,518 ns/iter (+/- 40)
```

After
```
running 4 tests
test empty_once ... bench:           2 ns/iter (+/- 0)
test empty_100  ... bench:         221 ns/iter (+/- 0)
test exist_once ... bench:          15 ns/iter (+/- 0)
test exist_100  ... bench:       1,515 ns/iter (+/- 92)
```

When the HashMap is not empty, the performance remains the same, and when it is empty the performance is significantly improved.

6 years agoRollup merge of #48195 - paoloteti:compiler-builtins-update, r=alexcrichton
kennytm [Wed, 14 Feb 2018 08:14:50 +0000 (16:14 +0800)]
Rollup merge of #48195 - paoloteti:compiler-builtins-update, r=alexcrichton

Update compiler-builtins to latest master.

- Rebase compiler-rt submodule to LLVM 6
- New VFP intrinsics on ARM
- Add generic conversion from a narrower to a wider FP type (f32 to f64)
- Fixes minor issues on _subsf3, __subdf3 and __aeabi_fcmple
- Split test suite to a separate crate

6 years agoRollup merge of #48186 - Mark-Simulacrum:release-notes-cargo, r=alexcrichton
kennytm [Wed, 14 Feb 2018 08:14:49 +0000 (16:14 +0800)]
Rollup merge of #48186 - Mark-Simulacrum:release-notes-cargo, r=alexcrichton

Add note about Cargo cwd change to release notes

r? @alexcrichton

6 years agoRollup merge of #48181 - michaelwoerister:fix-incr-dir-finalization, r=nikomatsakis
kennytm [Wed, 14 Feb 2018 08:14:48 +0000 (16:14 +0800)]
Rollup merge of #48181 - michaelwoerister:fix-incr-dir-finalization, r=nikomatsakis

incr.comp.: Run cache directory garbage collection before loading dep-graph.

Prior to this PR, the incr. comp. cache directory would only be garbage collected after the final output artifacts were generated. However, compilation often aborts earlier and in the case of the RLS, which starts lots of compilation sessions, we might fill up the cache directory with chunk sessions.

This PR makes the compiler do a garbage collection run before loading the dep-graph.

cc @nrc https://github.com/rust-lang/rust/issues/48172

r? @nikomatsakis

6 years agoRollup merge of #48167 - Mark-Simulacrum:remove-allocation-codemap, r=estebank
kennytm [Wed, 14 Feb 2018 08:14:47 +0000 (16:14 +0800)]
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

6 years agoRollup merge of #48165 - alexcrichton:update-read2, r=Mark-Simulacrum
kennytm [Wed, 14 Feb 2018 08:14:46 +0000 (16:14 +0800)]
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

6 years agoRollup merge of #48163 - alexcrichton:persistent-linker, r=rkruppe
kennytm [Wed, 14 Feb 2018 08:14:44 +0000 (16:14 +0800)]
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

6 years agoRollup merge of #48162 - michaelwoerister:stabler-svh, r=nikomatsakis
kennytm [Wed, 14 Feb 2018 08:14:43 +0000 (16:14 +0800)]
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

6 years agoRollup merge of #48156 - Centril:feature/iterator_repeat_with, r=alexcrichton
kennytm [Wed, 14 Feb 2018 08:14:42 +0000 (16:14 +0800)]
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

6 years agoRollup merge of #48154 - estebank:issue-31481, r=nikomatsakis
kennytm [Wed, 14 Feb 2018 08:14:41 +0000 (16:14 +0800)]
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.

6 years agoRollup merge of #48151 - echochamber:update_range_example, r=estebank
kennytm [Wed, 14 Feb 2018 08:14:40 +0000 (16:14 +0800)]
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.

6 years agoRollup merge of #48133 - matthiaskrgr:endianess_to_endianness, r=oli-obk
kennytm [Wed, 14 Feb 2018 08:14:39 +0000 (16:14 +0800)]
Rollup merge of #48133 - matthiaskrgr:endianess_to_endianness, r=oli-obk

typo: correct endianess to endianness (this also changes function names!)

6 years agoRollup merge of #48130 - ollie27:stab, r=Mark-Simulacrum
kennytm [Wed, 14 Feb 2018 08:14:38 +0000 (16:14 +0800)]
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.

6 years agoRollup merge of #48126 - newpavlov:patch-1, r=alexcrichton
kennytm [Wed, 14 Feb 2018 08:14:37 +0000 (16:14 +0800)]
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).

6 years agoRollup merge of #48114 - kennytm:xcode9, r=alexcrichton
kennytm [Wed, 14 Feb 2018 08:14:36 +0000 (16:14 +0800)]
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.

6 years agoRollup merge of #48087 - scottmcm:range_is_empty, r=kennytm,alexcrichton
kennytm [Wed, 14 Feb 2018 08:14:33 +0000 (16:14 +0800)]
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~~

6 years agoRollup merge of #48065 - Xaeroxe:patch-1, r=alexcrichton
kennytm [Wed, 14 Feb 2018 08:14:32 +0000 (16:14 +0800)]
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%.

6 years agoRollup merge of #48033 - GuillaumeGomez:better-char-cast-message, r=estebank
kennytm [Wed, 14 Feb 2018 08:14:31 +0000 (16:14 +0800)]
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.

6 years agoRollup merge of #48005 - panicbit:env_unimpl_send_sync, r=alexcrichton
kennytm [Wed, 14 Feb 2018 08:14:30 +0000 (16:14 +0800)]
Rollup merge of #48005 - panicbit:env_unimpl_send_sync, r=alexcrichton

Unimplement Send/Sync for ::env::{Args,ArgsOs,Vars,VarsOs}

Fixes #48004

6 years agoRollup merge of #47846 - roblabla:bugfix-ocaml, r=kennytm
kennytm [Wed, 14 Feb 2018 08:14:29 +0000 (16:14 +0800)]
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: https://github.com/llvm-mirror/llvm/blob/b24a45d2e9f4fc10c3f9e16172104910b38637f2/cmake/config-ix.cmake#L612
- https://github.com/llvm-mirror/llvm/blob/b24a45d2e9f4fc10c3f9e16172104910b38637f2/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.

6 years agoRollup merge of #47806 - PramodBisht:feature/47801, r=steveklabnik
kennytm [Wed, 14 Feb 2018 08:14:28 +0000 (16:14 +0800)]
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

6 years agoRollup merge of #47784 - alexcrichton:less-dsymutil, r=michaelwoerister
kennytm [Wed, 14 Feb 2018 08:14:27 +0000 (16:14 +0800)]
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

6 years agoUpdate RLS
Nick Cameron [Wed, 14 Feb 2018 08:09:51 +0000 (21:09 +1300)]
Update RLS

6 years agoinform type annotations
csmoe [Wed, 14 Feb 2018 03:06:08 +0000 (11:06 +0800)]
inform type annotations

6 years agoFix default Steps without paths.
Mark Simulacrum [Wed, 14 Feb 2018 01:42:26 +0000 (18:42 -0700)]
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()`.

6 years agoUpdate compiler-builtins to latest master.
Paolo Teti [Tue, 13 Feb 2018 21:25:41 +0000 (22:25 +0100)]
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

6 years ago38880 remove unnecessary self.table.size check
Shaun Steenkamp [Tue, 13 Feb 2018 20:25:10 +0000 (20:25 +0000)]
38880 remove unnecessary self.table.size check

6 years ago38880 fix incorrect negation
Shaun Steenkamp [Tue, 13 Feb 2018 17:15:58 +0000 (17:15 +0000)]
38880 fix incorrect negation

6 years ago38880 hashmap check size=0, not just capacity=0
Shaun Steenkamp [Tue, 13 Feb 2018 16:33:00 +0000 (16:33 +0000)]
38880 hashmap check size=0, not just capacity=0

6 years ago38880 restore original entry(key) method
Shaun Steenkamp [Tue, 13 Feb 2018 16:32:35 +0000 (16:32 +0000)]
38880 restore original entry(key) method

6 years agoSwitch to retain calling drain_filter.
Jacob Kiesel [Tue, 13 Feb 2018 15:48:25 +0000 (08:48 -0700)]
Switch to retain calling drain_filter.

6 years agoAdd note about Cargo cwd change to release notes
Mark Simulacrum [Tue, 13 Feb 2018 15:08:38 +0000 (08:08 -0700)]
Add note about Cargo cwd change to release notes

6 years agoImprove debuggability of #48116.
kennytm [Sat, 10 Feb 2018 21:05:11 +0000 (05:05 +0800)]
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.

6 years agoincr.comp.: Run cache directory garbage collection before loading dep-graph.
Michael Woerister [Tue, 13 Feb 2018 12:37:32 +0000 (13:37 +0100)]
incr.comp.: Run cache directory garbage collection before loading dep-graph.

6 years agoHandle path prefix mapping in a more stable way when computing the crate hash.
Michael Woerister [Mon, 12 Feb 2018 16:21:01 +0000 (17:21 +0100)]
Handle path prefix mapping in a more stable way when computing the crate hash.

6 years agocore::iter::repeat_with: fix missing word, see @Pazzaz's review
Mazdak Farrokhzad [Tue, 13 Feb 2018 05:20:17 +0000 (06:20 +0100)]
core::iter::repeat_with: fix missing word, see @Pazzaz's review

6 years agoAuto merge of #47804 - retep007:recursive-requirements, r=pnkfelix
bors [Tue, 13 Feb 2018 00:14:11 +0000 (00:14 +0000)]
Auto merge of #47804 - retep007:recursive-requirements, r=pnkfelix

Optimized error reporting for recursive requirements #47720

Fixes #47720

6 years agocore::iter::repeat_with: tracking issue is #48169
Mazdak Farrokhzad [Mon, 12 Feb 2018 20:47:59 +0000 (21:47 +0100)]
core::iter::repeat_with: tracking issue is #48169

6 years agoRemove allocation from width of character function.
Mark Simulacrum [Mon, 12 Feb 2018 19:28:32 +0000 (12:28 -0700)]
Remove allocation from width of character function.

6 years agoUpdate compiletest's `read2` function
Alex Crichton [Mon, 12 Feb 2018 18:46:31 +0000 (10:46 -0800)]
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

6 years agorustc: Persist LLVM's `Linker` in Fat LTO
Alex Crichton [Mon, 12 Feb 2018 16:38:46 +0000 (08:38 -0800)]
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

6 years agocore::iter::repeat_with: document DoubleEndedIterator behavior
Mazdak Farrokhzad [Mon, 12 Feb 2018 17:03:56 +0000 (18:03 +0100)]
core::iter::repeat_with: document DoubleEndedIterator behavior

6 years agorustc: Add the ability to not run dsymutil
Alex Crichton [Fri, 26 Jan 2018 05:21:02 +0000 (21:21 -0800)]
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

6 years ago38880 fixup add missing mut
Shaun Steenkamp [Mon, 12 Feb 2018 14:53:09 +0000 (14:53 +0000)]
38880 fixup add missing mut

6 years ago38880 remove redundant extra function
Shaun Steenkamp [Mon, 12 Feb 2018 14:00:08 +0000 (14:00 +0000)]
38880 remove redundant extra function

6 years agoAuto merge of #47843 - estebank:teach, r=nikomatsakis
bors [Mon, 12 Feb 2018 09:38:40 +0000 (09:38 +0000)]
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.

6 years agocore::iter::repeat_with: fix doc tests
Mazdak Farrokhzad [Mon, 12 Feb 2018 08:18:22 +0000 (09:18 +0100)]
core::iter::repeat_with: fix doc tests

6 years agocore::iter::repeat_with: fix tests some more
Mazdak Farrokhzad [Mon, 12 Feb 2018 08:15:13 +0000 (09:15 +0100)]
core::iter::repeat_with: fix tests some more

6 years agocore::iter::repeat_with: fix tests
Mazdak Farrokhzad [Mon, 12 Feb 2018 08:13:47 +0000 (09:13 +0100)]
core::iter::repeat_with: fix tests

6 years agocore::iter::repeat_with: derive Copy, Clone, Debug
Mazdak Farrokhzad [Mon, 12 Feb 2018 07:35:12 +0000 (08:35 +0100)]
core::iter::repeat_with: derive Copy, Clone, Debug

6 years agocore::iter::repeat_with: general fixes
Mazdak Farrokhzad [Mon, 12 Feb 2018 07:25:39 +0000 (08:25 +0100)]
core::iter::repeat_with: general fixes

6 years agoadd core::iter::repeat_with
Mazdak Farrokhzad [Mon, 12 Feb 2018 07:05:46 +0000 (08:05 +0100)]
add core::iter::repeat_with

6 years agoAuto merge of #48144 - kennytm:reduce-musl-test-size, r=Mark-Simulacrum
bors [Mon, 12 Feb 2018 06:43:24 +0000 (06:43 +0000)]
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.

6 years agoContinue parsing function after finding `...` arg
Esteban Küber [Mon, 12 Feb 2018 06:10:35 +0000 (22:10 -0800)]
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.

6 years agoUpdate ops range example to avoid confusion between indexes and values.
Jason Schein [Mon, 12 Feb 2018 01:54:44 +0000 (17:54 -0800)]
Update ops range example to avoid confusion between indexes and values.

6 years agoDelete executables if the test ran successfully.
Mark Simulacrum [Sun, 11 Feb 2018 23:27:33 +0000 (16:27 -0700)]
Delete executables if the test ran successfully.

This isn't a perfect heuristic, but since the amount of run-fail tests
is far lower than run-pass tests for now, it should be sufficient to
ensure that we don't run into CI limits. This makes it possible to run
the test binary manually (e.g., under gdb/lldb) if it failed to attempt
to find out why.

6 years agocompiletest: Delete the executable immediately after running.
kennytm [Sun, 11 Feb 2018 19:04:43 +0000 (03:04 +0800)]
compiletest: Delete the executable immediately after running.

This should save a lot of space on musl test cases (whose standard library
are linked statically).

6 years agoAuto merge of #47752 - mark-i-m:at-most-once-rep, r=nikomatsakis
bors [Sun, 11 Feb 2018 18:11:01 +0000 (18:11 +0000)]
Auto merge of #47752 - mark-i-m:at-most-once-rep, r=nikomatsakis

Implement `?` macro repetition

See rust-lang/rfcs#2298 (with disposition merge)

6 years agoChange Step to be invoked with a path when in default mode.
Mark Simulacrum [Sun, 11 Feb 2018 16:51:58 +0000 (09:51 -0700)]
Change Step to be invoked with a path when in default mode.

Previously, a Step would be able to tell on its own when it was invoked
"by-default" (that is, `./x.py test` was called instead of `./x.py test
some/path`). This commit replaces that functionality, invoking each Step
with each of the paths it has specified as "should be invoked by."

For example, if a step calls `path("src/tools/cargo")` and
`path("src/doc/cargo")` then it's make_run will be called twice, with
"src/tools/cargo" and "src/doc/cargo." This makes it so that default
handling logic is in builder, instead of spread across various Steps.

However, this meant that some Step specifications needed to be updated,
since for example `rustdoc` can be built by `./x.py build
src/librustdoc` or `./x.py build src/tools/rustdoc`. A `PathSet`
abstraction is added that handles this: now, each Step can not only list
`path(...)` but also `paths(&[a, b, ...])` which will make it so that we
don't invoke it with each of the individual paths, instead invoking it
with the first path in the list (though this shouldn't be depended on).

Future work likely consists of implementing a better/easier way for a
given Step to work with "any" crate in-tree, especially those that want
to run tests, build, or check crates in the std, test, or rustc crate
trees. Currently this is rather painful to do as most of the logic is
duplicated across should_run and make_run. It seems likely this can be
abstracted away into builder somehow.

6 years agoAuto merge of #47614 - dotdash:x86_64_sysv_ffi, r=eddyb
bors [Sun, 11 Feb 2018 15:10:46 +0000 (15:10 +0000)]
Auto merge of #47614 - dotdash:x86_64_sysv_ffi, r=eddyb

Fix oversized loads on x86_64 SysV FFI calls

The x86_64 SysV ABI should use exact sizes for small structs passed in
registers, i.e. a struct that occupies 3 bytes should use an i24,
instead of the i32 it currently uses.

Refs #45543

6 years agoDangling pointer fix
Artyom Pavlov [Sun, 11 Feb 2018 12:57:07 +0000 (15:57 +0300)]
Dangling pointer fix

6 years agoUpgrade the Travis CI macOS images for testing from Xcode 8.3 to 9.2.
kennytm [Thu, 25 Jan 2018 19:14:20 +0000 (03:14 +0800)]
Upgrade the Travis CI macOS images for testing from Xcode 8.3 to 9.2.

6 years agoAuto merge of #47657 - algesten:save-analysis-impls, r=nrc
bors [Sun, 11 Feb 2018 05:29:20 +0000 (05:29 +0000)]
Auto merge of #47657 - algesten:save-analysis-impls, r=nrc

Emit data::Impl in save-analysis

As discussed on [internals.rust-lang](https://internals.rust-lang.org/t/rustdoc2-rls-analysis-and-the-compiler-help-wanted/6592/5), this PR emits `rls-data::Impl` in the save-analysis.

A number of questions are outstanding:

- [x] A few `???` around row 356. We need to discuss what goes here, if anything.
- [ ] ~~Deriving `id` for impl using hashing. Is this going to clash with rustc defids?~~
- [ ] ~~Deriving `id` for impl using hashing. Is the conversion from 64 bit -> 32 bit problematic?~~
- [x] Need a new rls-data with an `id` field in `Impl` struct.
- [ ] ~~Need a new rls-data which `derive` `Hash` for `ImplKind` enum.~~

6 years agoAuto merge of #48092 - eddyb:discriminate-the-void, r=nikomatsakis
bors [Sun, 11 Feb 2018 02:42:19 +0000 (02:42 +0000)]
Auto merge of #48092 - eddyb:discriminate-the-void, r=nikomatsakis

 rustc_mir: insert a dummy access to places being matched on, when building MIR.

Fixes #47412 by adding a `_dummy = Discriminant(place)` before each `match place {...}`.

r? @nikomatsakis

6 years agoRemove DontDistWithMiri struct and instead just directly check it in builder
Mark Simulacrum [Sun, 11 Feb 2018 01:18:41 +0000 (18:18 -0700)]
Remove DontDistWithMiri struct and instead just directly check it in builder

6 years agoMake exclude and paths relative to root of checkout
Mark Simulacrum [Sun, 11 Feb 2018 01:15:34 +0000 (18:15 -0700)]
Make exclude and paths relative to root of checkout

6 years agoImplement excluding a build-step via --exclude
Mark Simulacrum [Fri, 9 Feb 2018 20:40:23 +0000 (13:40 -0700)]
Implement excluding a build-step via --exclude

6 years agoAdd the emptiness condition to the docs; add a PartialOrd example with NAN
Scott McMurray [Sun, 11 Feb 2018 00:32:05 +0000 (16:32 -0800)]
Add the emptiness condition to the docs; add a PartialOrd example with NAN

6 years agofixed errors
Артём Павлов [Artyom Pavlov] [Sun, 11 Feb 2018 00:27:04 +0000 (03:27 +0300)]
fixed errors

6 years agotypo: correct endianess to endianness (this also changes function names!)
Matthias Krüger [Sat, 10 Feb 2018 23:56:24 +0000 (00:56 +0100)]
typo: correct endianess to endianness (this also changes function names!)

6 years agoAuto merge of #47286 - Aaronepower:master, r=Mark-Simulacrum
bors [Sat, 10 Feb 2018 23:50:18 +0000 (23:50 +0000)]
Auto merge of #47286 - Aaronepower:master, r=Mark-Simulacrum

Update RELEASES.md for 1.24.0

[rendered](https://github.com/Aaronepower/rust/blob/master/RELEASES.md)

6 years agoiterator instead loop
Артём Павлов [Artyom Pavlov] [Sat, 10 Feb 2018 23:36:22 +0000 (02:36 +0300)]
iterator instead loop