]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoStart moving to the rustc guide!
Mark Mansi [Fri, 23 Feb 2018 19:20:56 +0000 (13:20 -0600)]
Start moving to the rustc guide!

6 years agoAuto merge of #48322 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Sun, 18 Feb 2018 17:50:21 +0000 (17:50 +0000)]
Auto merge of #48322 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 6 pull requests

- Successful merges: #48194, #48273, #48274, #48275, #48282, #48312
- Failed merges:

6 years agoRollup merge of #48312 - frewsxcv:frewsxcv-section-headings, r=QuietMisdreavus
Guillaume Gomez [Sun, 18 Feb 2018 12:21:03 +0000 (13:21 +0100)]
Rollup merge of #48312 - frewsxcv:frewsxcv-section-headings, r=QuietMisdreavus

Unify 'Platform-specific behavior' documentation headings.

None

6 years agoRollup merge of #48282 - Centril:spelling-fix/iter-repeat-with, r=kennytm
Guillaume Gomez [Sun, 18 Feb 2018 12:21:02 +0000 (13:21 +0100)]
Rollup merge of #48282 - Centril:spelling-fix/iter-repeat-with, r=kennytm

Fix spelling in core::iter::repeat_with: s/not/note

Fixes spelling error in https://github.com/rust-lang/rust/pull/48156#discussion_r168718452.
Tracking issue: https://github.com/rust-lang/rust/issues/48169

6 years agoRollup merge of #48275 - matthiaskrgr:codespell, r=kennytm,varkor
Guillaume Gomez [Sun, 18 Feb 2018 12:21:01 +0000 (13:21 +0100)]
Rollup merge of #48275 - matthiaskrgr:codespell, r=kennytm,varkor

fix more typos found by codespell.

6 years agoRollup merge of #48274 - GuillaumeGomez:remove-hoedown, r=QuietMisdreavus
Guillaume Gomez [Sun, 18 Feb 2018 12:20:59 +0000 (13:20 +0100)]
Rollup merge of #48274 - GuillaumeGomez:remove-hoedown, r=QuietMisdreavus

Remove hoedown from rustdoc

Finally the time has come!

r? @QuietMisdreavus

6 years agoRollup merge of #48273 - alercah:file-warning, r=joshtriplett
Guillaume Gomez [Sun, 18 Feb 2018 12:20:58 +0000 (13:20 +0100)]
Rollup merge of #48273 - alercah:file-warning, r=joshtriplett

Add a warning to File about mutability.

Fixes #47708.

6 years agoRollup merge of #48194 - GuillaumeGomez:doc-test-command, r=Mark-Simulacrum
Guillaume Gomez [Sun, 18 Feb 2018 12:20:57 +0000 (13:20 +0100)]
Rollup merge of #48194 - GuillaumeGomez:doc-test-command, r=Mark-Simulacrum

Doc test command

r? @Mark-Simulacrum

6 years agoAuto merge of #47687 - SimonSapin:panic-impl, r=sfackler
bors [Sun, 18 Feb 2018 06:02:35 +0000 (06:02 +0000)]
Auto merge of #47687 - SimonSapin:panic-impl, r=sfackler

RFC 2070 part 1: PanicInfo and Location API changes

This implements part of https://rust-lang.github.io/rfcs/2070-panic-implementation.html
Tracking issue: https://github.com/rust-lang/rust/issues/44489

* Move `std::panic::PanicInfo` and `std::panic::Location` to a new `core::panic` module. The two types and the `std` module were already `#[stable]` and stay that way, the new `core` module is `#[unstable]`.
* Add a new `PanicInfo::message(&self) -> Option<&fmt::Arguments>` method, which is `#[unstable]`.
* Implement `Display` for `PanicInfo` and `Location`

6 years agoAuto merge of #47544 - U007D:master, r=nikomatsakis
bors [Sun, 18 Feb 2018 03:12:14 +0000 (03:12 +0000)]
Auto merge of #47544 - U007D:master, r=nikomatsakis

Relax termination_trait's error bound

As per [this conversation](https://github.com/withoutboats/failure/issues/130#issuecomment-358572413) with @withoutboats and @bkchr

6 years agoUnify 'Platform-specific behavior' documentation headings.
Corey Farwell [Sun, 18 Feb 2018 01:54:26 +0000 (20:54 -0500)]
Unify 'Platform-specific behavior' documentation headings.

6 years agoRemove useless comment
Guillaume Gomez [Sat, 17 Feb 2018 22:47:45 +0000 (23:47 +0100)]
Remove useless comment

6 years agoAuto merge of #47408 - eddyb:deref-danger, r=nikomatsakis
bors [Sat, 17 Feb 2018 19:32:25 +0000 (19:32 +0000)]
Auto merge of #47408 - eddyb:deref-danger, r=nikomatsakis

Don't promote to 'static the result of dereferences.

This is a **breaking change**, removing copies out of dereferences from rvalue-to-`'static` promotion.

With miri we won't easily know whether the dereference itself would see the same value at runtime as miri (e.g. after mutating a `static`) or even if it can be interpreted (e.g. integer pointers).
One alternative to this ban is defining at least *some* of those situations as UB, i.e. you shouldn't have a reference in the first place, and you should work through raw pointers instead, to avoid promotion.

**EDIT**: The other *may seem* to be to add some analysis which whitelists references-to-constant-values and assume any values produced by arbitrary computation to not be safe to promote dereferences thereof - but that means producing a reference from an associated constant or `const fn` would necessarily obscure it, and in the former case, this could still impact code that runs on stable today. What we do today to track "references to statics" only works because we restrict taking a reference to a `static` at all to other `static`s (which, again, are currently limited in that they can't be read at compile-time) and to runtime-only `fn`s (*not* `const fn`s).

I'm primarily opening this PR with a conservative first approximation (e.g. `&(*r).a` is not allowed, only reborrows are, and in the old borrow only implicit ones from adjustments, at that) for cratering.

r? @nikomatsakis

6 years agoFix unstable book
Guillaume Gomez [Sat, 17 Feb 2018 17:27:46 +0000 (18:27 +0100)]
Fix unstable book

6 years agofix more typos found by codespell.
Matthias Krüger [Fri, 16 Feb 2018 14:56:50 +0000 (15:56 +0100)]
fix more typos found by codespell.

6 years agoAdd command to launch only doc tests
Guillaume Gomez [Sat, 17 Feb 2018 14:45:39 +0000 (15:45 +0100)]
Add command to launch only doc tests

6 years agoUpdate to last repository version
Guillaume Gomez [Sat, 17 Feb 2018 13:22:00 +0000 (14:22 +0100)]
Update to last repository version

6 years agoAuto merge of #48294 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Sat, 17 Feb 2018 14:31:32 +0000 (14:31 +0000)]
Auto merge of #48294 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 8 pull requests

- Successful merges: #48095, #48152, #48234, #48239, #48243, #48260, #48284, #48286
- Failed merges:

6 years agoWording fixes from review for File.
Alexis Hunt [Sat, 17 Feb 2018 13:47:03 +0000 (08:47 -0500)]
Wording fixes from review for File.

6 years agoRollup merge of #48286 - SergioBenitez:master, r=BurntSushi
Guillaume Gomez [Sat, 17 Feb 2018 13:45:28 +0000 (14:45 +0100)]
Rollup merge of #48286 - SergioBenitez:master, r=BurntSushi

Clarify contiguity of Vec's elements.

Small doc changes for clarity.

6 years agoRollup merge of #48284 - crawford:string, r=sfackler
Guillaume Gomez [Sat, 17 Feb 2018 13:45:27 +0000 (14:45 +0100)]
Rollup merge of #48284 - crawford:string, r=sfackler

Remove unneeded string allocations

6 years agoRollup merge of #48260 - dns2utf8:add_link_to_yield, r=kennytm
Guillaume Gomez [Sat, 17 Feb 2018 13:45:26 +0000 (14:45 +0100)]
Rollup merge of #48260 - dns2utf8:add_link_to_yield, r=kennytm

[doc] Add link to yield_now

A convenient link.

6 years agoRollup merge of #48243 - rust-lang:steveklabnik-patch-1, r=kennytm
Guillaume Gomez [Sat, 17 Feb 2018 13:45:24 +0000 (14:45 +0100)]
Rollup merge of #48243 - rust-lang:steveklabnik-patch-1, r=kennytm

spelling fix in comment

r? @Manishearth

6 years agoRollup merge of #48239 - GuillaumeGomez:fix-condvar-example, r=QuietMisdreavus
Guillaume Gomez [Sat, 17 Feb 2018 13:45:23 +0000 (14:45 +0100)]
Rollup merge of #48239 - GuillaumeGomez:fix-condvar-example, r=QuietMisdreavus

Fix condvar example

Fixes #48230.

r? @QuietMisdreavus

6 years agoRollup merge of #48234 - zombiezen:patch-1, r=steveklabnik
Guillaume Gomez [Sat, 17 Feb 2018 13:45:22 +0000 (14:45 +0100)]
Rollup merge of #48234 - zombiezen:patch-1, r=steveklabnik

Remove "empty buffer" doc in read_until

This appears copied from fill_buf, but the above paragraph already indicates that a lack of delimiter at the end is EOF.

6 years agoRollup merge of #48152 - antoyo:primitive-docs-relevant, r=QuietMisdreavus
Guillaume Gomez [Sat, 17 Feb 2018 13:45:21 +0000 (14:45 +0100)]
Rollup merge of #48152 - antoyo:primitive-docs-relevant, r=QuietMisdreavus

Primitive docs relevant

This fixes the documentation to show the right types in the examples for many integer methods.

I need to check if the result is correct before we merge.

6 years agoRollup merge of #48095 - QuietMisdreavus:doctest-assembly, r=GuillaumeGomez
Guillaume Gomez [Sat, 17 Feb 2018 13:45:20 +0000 (14:45 +0100)]
Rollup merge of #48095 - QuietMisdreavus:doctest-assembly, r=GuillaumeGomez

add unit tests for rustdoc's processing of doctests

cc #42018

There's a lot of things that rustdoc will do to massage doctests into something that can be compiled, and a lot of options that can be toggled to affect this. Hopefully this list of tests can show off that functionality.

The first commit is slightly unrelated but doesn't touch public functionality, because i found that if you have a manual `fn main`, it adds an extra line break at the end, whereas it would trim this extra line break if it were putting a `fn main` in automatically. That first commit makes it trim out that whitespace ahead of time.

6 years agoAuto merge of #47956 - retep998:is-nibbles, r=BurntSushi
bors [Sat, 17 Feb 2018 11:32:16 +0000 (11:32 +0000)]
Auto merge of #47956 - retep998:is-nibbles, r=BurntSushi

This is the ideal FileType on Windows. You may not like it, but this is what peak performance looks like.

Theoretically this would fix https://github.com/rust-lang/rust/issues/46484

The current iteration of this PR should not cause existing code to break, but instead merely improves handling around reparse points. Specifically...

* Reparse points are considered to be symbolic links if they have the name surrogate bit set. Name surrogates are reparse points that effectively act like symbolic links, redirecting you to a different directory/file. By checking for this bit instead of specific tags, we become much more general in our handling of reparse points, including those added by third parties.
* If something is a reparse point but does not have the name surrogate bit set, then we ignore the fact that it is a reparse point because it is actually a file or directory directly there, despite having additional handling by drivers due to the reparse point.
* For everything which is not a symbolic link (including non-surrogate reparse points) we report whether it is a directory or a file based on the presence of the directory attribute bit.
* Notably this still preserves invariant that when `is_symlink` returns `true`, both `is_dir` and `is_file` will return `false`. The potential for breakage was far too high.
* Adds an unstable `FileTypeExt` to allow users to determine whether a symbolic link is a directory or a file, since `FileType` by design is incapable of reporting this information.

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 agoClarify contiguity of Vec's elements.
Sergio Benitez [Sat, 17 Feb 2018 01:05:49 +0000 (17:05 -0800)]
Clarify contiguity of Vec's elements.

6 years agoRemove unneeded string allocations
Alex Crawford [Fri, 16 Feb 2018 22:08:12 +0000 (14:08 -0800)]
Remove unneeded string allocations

6 years agoRemove hoedown from rustdoc
Guillaume Gomez [Fri, 16 Feb 2018 14:09:19 +0000 (15:09 +0100)]
Remove hoedown from rustdoc

Is it really time? Have our months, no, *years* of suffering come to an end? Are we finally able to cast off the pall of Hoedown? The weight which has dragged us down for so long?

-----

So, timeline for those who need to catch up:

* Way back in December 2016, [we decided we wanted to switch out the markdown renderer](https://github.com/rust-lang/rust/issues/38400). However, this was put on hold because the build system at the time made it difficult to pull in dependencies from crates.io.
* A few months later, in March 2017, [the first PR was done, to switch out the renderers entirely](https://github.com/rust-lang/rust/pull/40338). The PR itself was fraught with CI and build system issues, but eventually landed.
* However, not all was well in the Rustdoc world. During the PR and shortly after, we noticed [some differences in the way the two parsers handled some things](https://github.com/rust-lang/rust/issues/40912), and some of these differences were major enough to break the docs for some crates.
* A couple weeks afterward, [Hoedown was put back in](https://github.com/rust-lang/rust/pull/41290), at this point just to catch tests that Pulldown was "spuriously" running. This would at least provide some warning about spurious tests, rather than just breaking spontaneously.
* However, the problems had created enough noise by this point that just a few days after that, [Hoedown was switched back to the default](https://github.com/rust-lang/rust/pull/41431) while we came up with a solution for properly warning about the differences.
* That solution came a few weeks later, [as a series of warnings when the HTML emitted by the two parsers was semantically different](https://github.com/rust-lang/rust/pull/41991). But that came at a cost, as now rustdoc needed proc-macro support (the new crate needed some custom derives farther down its dependency tree), and the build system was not equipped to handle it at the time. It was worked on for three months as the issue stumped more and more people.
  * In that time, [bootstrap was completely reworked](https://github.com/rust-lang/rust/pull/43059) to change how it ordered compilation, and [the method by which it built rustdoc would change](https://github.com/rust-lang/rust/pull/43482), as well. This allowed it to only be built after stage1, when proc-macros would be available, allowing the "rendering differences" PR to finally land.
  * The warnings were not perfect, and revealed a few [spurious](https://github.com/rust-lang/rust/pull/44368) [differences](https://github.com/rust-lang/rust/pull/45421) between how we handled the renderers.
  * Once these were handled, [we flipped the switch to turn on the "rendering difference" warnings all the time](https://github.com/rust-lang/rust/pull/45324), in October 2017. This began the "warning cycle" for this change, and landed in stable in 1.23, on 2018-01-04.
  * Once those warnings hit stable, and after a couple weeks of seeing whether we would get any more reports than what we got from sitting on nightly/beta, [we switched the renderers](https://github.com/rust-lang/rust/pull/47398), making Pulldown the default but still offering the option to use Hoedown.

And that brings us to the present. We haven't received more new issues from this in the meantime, and the "switch by default" is now on beta. Our reasoning is that, at this point, anyone who would have been affected by this has run into it already.

6 years agocore::iter::repeat_with: fix spelling, s/not/note
Mazdak Farrokhzad [Fri, 16 Feb 2018 21:14:32 +0000 (22:14 +0100)]
core::iter::repeat_with: fix spelling, s/not/note

6 years agoNotify users that this example is shared through integer types
Guillaume Gomez [Wed, 14 Feb 2018 18:44:07 +0000 (19:44 +0100)]
Notify users that this example is shared through integer types

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 agoAdd a warning to File about mutability.
Alexis Hunt [Fri, 16 Feb 2018 13:51:40 +0000 (08:51 -0500)]
Add a warning to File about mutability.

Fixes #47708.

6 years agoForce the link to std::thread::yield_now()
Stefan Schindler [Fri, 16 Feb 2018 11:20:54 +0000 (12:20 +0100)]
Force the link to std::thread::yield_now()

6 years agoAdd link to yield_now
Stefan Schindler [Fri, 16 Feb 2018 09:30:31 +0000 (10:30 +0100)]
Add link to yield_now

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 agospelling fix in comment
Steve Klabnik [Thu, 15 Feb 2018 19:44:58 +0000 (14:44 -0500)]
spelling fix in comment

6 years agoFix condvar example
Guillaume Gomez [Thu, 15 Feb 2018 17:59:00 +0000 (18:59 +0100)]
Fix condvar example

6 years agoRemove "empty buffer" doc in read_until
Ross Light [Thu, 15 Feb 2018 15:32:42 +0000 (07:32 -0800)]
Remove "empty buffer" doc in read_until

This appears copied from fill_buf, but the above paragraph already indicates that a lack of delimiter at the end is EOF.

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 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 agoAdd missing feature
Guillaume Gomez [Mon, 12 Feb 2018 20:27:40 +0000 (21:27 +0100)]
Add missing feature

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.