]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoRollup merge of #44158 - dtolnay:zero48, r=sfackler
Ariel Ben-Yehuda [Tue, 29 Aug 2017 21:41:04 +0000 (21:41 +0000)]
Rollup merge of #44158 - dtolnay:zero48, r=sfackler

Use a byte literal ASCII 0 instead of its decimal value

@SimonSapin noticed this in https://github.com/dtolnay/itoa/pull/8.

6 years agoRollup merge of #44144 - alexcrichton:faster-hash-and-sign, r=Mark-Simulacrum
Ariel Ben-Yehuda [Tue, 29 Aug 2017 21:41:03 +0000 (21:41 +0000)]
Rollup merge of #44144 - alexcrichton:faster-hash-and-sign, r=Mark-Simulacrum

rustbuild: Fix dependencies of build-manifest

No need to depend on librustc! All we need is libstd

Closes #44140

6 years agoRollup merge of #44141 - nrc:rls-preview-beta, r=alexcrichton
Ariel Ben-Yehuda [Tue, 29 Aug 2017 21:41:02 +0000 (21:41 +0000)]
Rollup merge of #44141 - nrc:rls-preview-beta, r=alexcrichton

Rename the rls component to rls-preview on beta/stable

Background is that we will have automatic renaming with the next rustup release. We'll then rename rls to rls-preview. In the meantime, this ensures beta/stable users will always have rls-preview.

r? @alexcrichton

6 years agoRollup merge of #44135 - GuillaumeGomez:fix-css-links, r=QuietMisdreavus
Ariel Ben-Yehuda [Tue, 29 Aug 2017 21:41:01 +0000 (21:41 +0000)]
Rollup merge of #44135 - GuillaumeGomez:fix-css-links, r=QuietMisdreavus

Fix invalid linker position

Fixes #44120.

Result isn't "optimal" though because there are spaces at the end of some lines.

6 years agoRollup merge of #44134 - vorner:x-py-unknown-cmd, r=nikomatsakis
Ariel Ben-Yehuda [Tue, 29 Aug 2017 21:41:00 +0000 (21:41 +0000)]
Rollup merge of #44134 - vorner:x-py-unknown-cmd, r=nikomatsakis

Fail ./x.py on invalid command

Make the ./x.py script fail when run with an invalid command, like:

```
./x.py nonsense
```

This helps in case of chaining multiple runs, eg.:

```
./x.py biuld && ./x.py test
```

6 years agoRollup merge of #44126 - laumann:config-doc-comments, r=nikomatsakis
Ariel Ben-Yehuda [Tue, 29 Aug 2017 21:40:59 +0000 (21:40 +0000)]
Rollup merge of #44126 - laumann:config-doc-comments, r=nikomatsakis

compiletest: Change Config comments to doc comments

I plan to make the same change in compiletest-rs, to have some documentation in [the docs](https://docs.rs/compiletest_rs/0.2.9/compiletest_rs/common/struct.Config.html).

6 years agoRollup merge of #44121 - ishitatsuyuki:bootstrap-deps-purge, r=Mark-Simulacrum
Ariel Ben-Yehuda [Tue, 29 Aug 2017 21:40:58 +0000 (21:40 +0000)]
Rollup merge of #44121 - ishitatsuyuki:bootstrap-deps-purge, r=Mark-Simulacrum

bootstrap: remove unneeded extern crate

The crate itself is internally referenced by serde_derive.

6 years agoRollup merge of #44117 - frewsxcv:frewsxcv-to-socket-addrs-examples, r=QuietMisdreavus
Ariel Ben-Yehuda [Tue, 29 Aug 2017 21:40:57 +0000 (21:40 +0000)]
Rollup merge of #44117 - frewsxcv:frewsxcv-to-socket-addrs-examples, r=QuietMisdreavus

Rewrite `std::net::ToSocketAddrs` doc examples.

in particular:

* show how to create an iterator that yields multiple socket addresses
* show more failing scenarios

done this as preliminary work while investigating https://github.com/rust-lang/rust/issues/22569

note: i haven't run doc tests on my machine for this, so would be good to confirm CI passes before approving

6 years agoRollup merge of #44076 - RalfJung:src, r=alexcrichton
Ariel Ben-Yehuda [Tue, 29 Aug 2017 21:40:56 +0000 (21:40 +0000)]
Rollup merge of #44076 - RalfJung:src, r=alexcrichton

include Cargo.{toml,lock} in rust-src tarball

The lock file is interesting because e.g. xargo could use it to build libstd against the same dependencies that were used for the main build. More generally speaking, just documenting in this form which exact dependencies should be used IMHO makes lots of sense.

I added the Cargo.toml mostly because having the lock without the toml feels odd. Of course, the toml contains references to paths that don't actually exist in the rust-src tarball. Not sure if that is considered a problem.

6 years agoRollup merge of #43918 - mystor:rustdoc-pound, r=QuietMisdreavus
Ariel Ben-Yehuda [Tue, 29 Aug 2017 21:40:55 +0000 (21:40 +0000)]
Rollup merge of #43918 - mystor:rustdoc-pound, r=QuietMisdreavus

Don't highlight # which does not start an attribute in rustdoc

Currently when we highlight some macros for rustdoc (e.g. `quote!` from https://github.com/dtolnay/quote), we get really bad syntax highlighting, because we assume that every token between a `#` character and the next `]` in the source must be an attribute.

This patch improves that highlighting behavior to instead only highlight after finding the `[` token after the `#` token.

(NOTE: I've only run this patch against https://github.com/nrc/rustdoc-highlight so if it doesn't build on travis that's why - I don't have a recent rustc build on this laptop)

I'm guessing r? @steveklabnik

6 years agoRollup merge of #43778 - topecongiro:handler-reset-err-count, r=arielb1
Ariel Ben-Yehuda [Tue, 29 Aug 2017 21:40:54 +0000 (21:40 +0000)]
Rollup merge of #43778 - topecongiro:handler-reset-err-count, r=arielb1

Add reset_err_count() to errors::Handler

The motivation here is to allow rustfmt to recover from parse errors after failing to parse macros (cc https://github.com/rust-lang-nursery/rustfmt/issues/1742).
r? @nrc

6 years agoRollup merge of #43705 - panicbit:option_ref_mut_cloned, r=aturon
Ariel Ben-Yehuda [Tue, 29 Aug 2017 21:40:53 +0000 (21:40 +0000)]
Rollup merge of #43705 - panicbit:option_ref_mut_cloned, r=aturon

libcore: Implement cloned() for Option<&mut T>

None

6 years agoAuto merge of #43648 - RalfJung:jemalloc-debug, r=alexcrichton
bors [Tue, 29 Aug 2017 17:32:13 +0000 (17:32 +0000)]
Auto merge of #43648 - RalfJung:jemalloc-debug, r=alexcrichton

Fix alloc_jemalloc debug feature

At least, I think that's how it should be.  'debug' is how the feature is called in liballoc_jemalloc/Cargo.toml and libstd/Cargo.toml. I verified this by making the build script panic rather than adding `--enable-debug`, and without this PR, the panic does not occur even when I set `debug-jemalloc = true` in config.toml. With the PR, the panic occurs as expected.

However, I actually have no idea what I am doing here.

6 years agoUse a byte literal ASCII 0 instead of its decimal value
David Tolnay [Tue, 29 Aug 2017 17:01:12 +0000 (10:01 -0700)]
Use a byte literal ASCII 0 instead of its decimal value

6 years agogive up on trying to fix the assertion failure
Ralf Jung [Tue, 29 Aug 2017 14:09:38 +0000 (16:09 +0200)]
give up on trying to fix the assertion failure

6 years agoFix alloc_jemalloc debug feature
Ralf Jung [Fri, 4 Aug 2017 06:39:23 +0000 (23:39 -0700)]
Fix alloc_jemalloc debug feature

At least, I think that's how it should be.  'debug' is how the feature is called in Cargo.toml.

6 years agoAuto merge of #44111 - zackmdavis:feature_attr_error_span, r=nikomatsakis
bors [Tue, 29 Aug 2017 10:22:14 +0000 (10:22 +0000)]
Auto merge of #44111 - zackmdavis:feature_attr_error_span, r=nikomatsakis

feature error span on attribute for fn_must_use, SIMD/align reprs, macro reëxport

There were several feature-gated attributes for which the feature-not-available
error spans would point to the item annotated with the gated attribute, when it
would make more sense for the span to point to the attribute itself: if the
attribute is removed, the function/struct/_&c._ likely still makes sense and the
program will compile. (Note that we decline to make the analogous change for
the `main`, `start`, and `plugin_registrar` features, for in those cases it
makes sense for the span to implicate the entire function, of which there is
little hope of using without the gated attribute.)

![feature_attr_error_span](https://user-images.githubusercontent.com/1076988/29746531-fd700bfe-8a91-11e7-9c5b-6f5324083887.png)

6 years agoAuto merge of #44059 - oli-obk:ok_suggestion, r=nikomatsakis
bors [Tue, 29 Aug 2017 06:18:23 +0000 (06:18 +0000)]
Auto merge of #44059 - oli-obk:ok_suggestion, r=nikomatsakis

Suggest `Ok(())` when encountering `Result::<(), E>::Ok()`

6 years agorustbuild: Fix dependencies of build-manifest
Alex Crichton [Tue, 29 Aug 2017 01:40:57 +0000 (18:40 -0700)]
rustbuild: Fix dependencies of build-manifest

No need to depend on librustc! All we need is libstd

Closes #44140

6 years agoRename the rls component to rls-preview on beta/stable
Nick Cameron [Tue, 29 Aug 2017 01:03:37 +0000 (13:03 +1200)]
Rename the rls component to rls-preview on beta/stable

6 years agoAuto merge of #44049 - alexcrichton:nounwind-allocators, r=BurntSushi
bors [Tue, 29 Aug 2017 00:58:17 +0000 (00:58 +0000)]
Auto merge of #44049 - alexcrichton:nounwind-allocators, r=BurntSushi

std: Mark allocation functions as nounwind

This commit flags all allocation-related functions in liballoc as "this can't
unwind" which should largely resolve the size-related issues found on #42808.
The documentation on the trait was updated with such a restriction (they can't
panic) as well as some other words about the relative instability about
implementing a bullet-proof allocator.

Closes #42808

6 years agoAuto merge of #43999 - arielb1:immediate-project, r=nikomatsakis
bors [Mon, 28 Aug 2017 20:42:27 +0000 (20:42 +0000)]
Auto merge of #43999 - arielb1:immediate-project, r=nikomatsakis

clear out projection subobligations after they are processed

After a projection was processed, its derived subobligations no longer
need any processing when encountered, and can be removed. This improves
the status of #43787.

This is actually complementary to #43938 - that PR fixes selection
caching (and @remram44's example, which "accidentally" worked because of
the buggy projection caching) while this PR fixes projection caching.

r? @nikomatsakis

6 years agoFix invalid linker position
Guillaume Gomez [Mon, 28 Aug 2017 20:40:09 +0000 (22:40 +0200)]
Fix invalid linker position

6 years agoAuto merge of #43076 - Zoxc:gen, r=arielb1
bors [Mon, 28 Aug 2017 16:36:03 +0000 (16:36 +0000)]
Auto merge of #43076 - Zoxc:gen, r=arielb1

Generator support

This adds experimental support for generators intended to land once https://github.com/rust-lang/rfcs/pull/2033 is approved.

This is not yet ready to be merged. Things to do:
- [x] Make closure arguments on generators an error
- [x] Spot FIXMEs
- [x] Pass make tidy
- [x] Write tests
- [x] Document the current syntax and semantics for generators somewhere
- [x] Use proper error message numbers
- [x] ~~Make the implicit argument type default to `()`~~

6 years agostd: Mark allocation functions as nounwind
Alex Crichton [Tue, 22 Aug 2017 21:36:49 +0000 (14:36 -0700)]
std: Mark allocation functions as nounwind

This commit flags all allocation-related functions in liballoc as "this can't
unwind" which should largely resolve the size-related issues found on #42808.
The documentation on the trait was updated with such a restriction (they can't
panic) as well as some other words about the relative instability about
implementing a bullet-proof allocator.

Closes #42808

6 years agoUpdate test issue-41783.rs for new attribute highlighting behaviour
Michael Layzell [Mon, 28 Aug 2017 14:52:49 +0000 (10:52 -0400)]
Update test issue-41783.rs for new attribute highlighting behaviour

6 years agoTweak rls submodule again
Alex Crichton [Mon, 28 Aug 2017 14:14:52 +0000 (07:14 -0700)]
Tweak rls submodule again

6 years agoRewrite `std::net::ToSocketAddrs` doc examples.
Corey Farwell [Sun, 27 Aug 2017 19:17:07 +0000 (12:17 -0700)]
Rewrite `std::net::ToSocketAddrs` doc examples.

in particular:

* show how to create an iterator that yields multiple socket addresses
* show more failing scenarios

6 years agoSuggest `Ok(())` when encountering `Ok()`
Oliver Schneider [Wed, 23 Aug 2017 13:40:05 +0000 (15:40 +0200)]
Suggest `Ok(())` when encountering `Ok()`

6 years agocompiletest: Change Config comments to doc comments
Thomas Jespersen [Mon, 28 Aug 2017 11:35:53 +0000 (13:35 +0200)]
compiletest: Change Config comments to doc comments

6 years agoAuto merge of #44114 - daboross:patch-1, r=dtolnay
bors [Mon, 28 Aug 2017 10:42:11 +0000 (10:42 +0000)]
Auto merge of #44114 - daboross:patch-1, r=dtolnay

Clarify that VecDeque::swap can panic

The previous documentation mentioned this, but ambiguously used the term "fail".

This clarifies that the function will panic if the index is out of bounds, instead of silently failing and not doing anything.

If there's anything else I can do to improve this PR, I'd be happy to do so! Just saw this when reading through the docs in passing - it was slightly unclear what "fail" meant.

6 years agofeature error span on attr. for fn_must_use, SIMD/align, macro reëxport
Zack M. Davis [Sun, 27 Aug 2017 01:00:33 +0000 (18:00 -0700)]
feature error span on attr. for fn_must_use, SIMD/align, macro reëxport

There were several feature-gated attributes for which the
feature-not-available error spans would point to the item annotated with
the gated attribute, when it would make more sense for the span to point
to the attribute itself: if the attribute is removed, the
function/struct/&c. likely still makes sense and the program will
compile. (Note that we decline to make the analogous change for the
`main`, `start`, and `plugin_registrar` features, for in those cases it
makes sense for the span to implicate the entire function, of which
there is little hope of using without the gated attribute.)

6 years agoIgnore a threaded test on emscripten
Alex Crichton [Mon, 28 Aug 2017 06:37:50 +0000 (23:37 -0700)]
Ignore a threaded test on emscripten

6 years agoAuto merge of #44107 - alexcrichton:no-shell-configure, r=Mark-Simulacrum
bors [Mon, 28 Aug 2017 06:04:10 +0000 (06:04 +0000)]
Auto merge of #44107 - alexcrichton:no-shell-configure, r=Mark-Simulacrum

rustbuild: Rewrite the configure script in Python

This commit rewrites our ancient `./configure` script from shell into Python.
The impetus for this change is to remove `config.mk` which is just a vestige of
the old makefile build system at this point. Instead all configuration is now
solely done through `config.toml`.

The python script allows us to more flexibly program (aka we can use loops
easily) and create a `config.toml` which is based off `config.toml.example`.
This way we can preserve comments and munge various values as we see fit.

It is intended that the configure script here is a drop-in replacement for the
previous configure script, no functional change is intended. Also note that the
rationale for this is also because our build system requires Python, so having a
python script a bit earlier shouldn't cause too many problems.

Closes #40730
Closes #43295
Closes #42255
Closes #38058
Closes #32176

6 years agoUpdate the rls submodule again
Alex Crichton [Mon, 28 Aug 2017 04:01:16 +0000 (21:01 -0700)]
Update the rls submodule again

6 years agobootstrap: remove unneeded extern crate
Tatsuyuki Ishi [Mon, 28 Aug 2017 03:52:02 +0000 (12:52 +0900)]
bootstrap: remove unneeded extern crate

The crate itself is internally referenced by serde_derive.

6 years agorustbuild: Rewrite the configure script in Python
Alex Crichton [Sat, 26 Aug 2017 22:01:48 +0000 (15:01 -0700)]
rustbuild: Rewrite the configure script in Python

This commit rewrites our ancient `./configure` script from shell into Python.
The impetus for this change is to remove `config.mk` which is just a vestige of
the old makefile build system at this point. Instead all configuration is now
solely done through `config.toml`.

The python script allows us to more flexibly program (aka we can use loops
easily) and create a `config.toml` which is based off `config.toml.example`.
This way we can preserve comments and munge various values as we see fit.

It is intended that the configure script here is a drop-in replacement for the
previous configure script, no functional change is intended. Also note that the
rationale for this is also because our build system requires Python, so having a
python script a bit earlier shouldn't cause too many problems.

Closes #40730

6 years agoUpdate lock file
Alex Crichton [Mon, 28 Aug 2017 01:52:02 +0000 (18:52 -0700)]
Update lock file

6 years agoMerge branch 'master' of https://github.com/rust-lang/rust into gen
John Kåre Alsaker [Mon, 28 Aug 2017 00:41:16 +0000 (02:41 +0200)]
Merge branch 'master' of https://github.com/rust-lang/rust into gen

6 years agoUpdate rls
John Kåre Alsaker [Mon, 28 Aug 2017 00:39:17 +0000 (02:39 +0200)]
Update rls

6 years agoFail ./x.py on invalid command
Michal 'vorner' Vaner [Sun, 27 Aug 2017 17:20:03 +0000 (19:20 +0200)]
Fail ./x.py on invalid command

Make the ./x.py script fail when run with an invalid command, like:

  ./x.py nonsense

This helps in case of chaining multiple runs, eg.:

  ./x.py biuld && ./x.py test

6 years agoAuto merge of #44110 - alexcrichton:docker-init, r=Mark-Simulacrum
bors [Sun, 27 Aug 2017 15:31:11 +0000 (15:31 +0000)]
Auto merge of #44110 - alexcrichton:docker-init, r=Mark-Simulacrum

ci: Remove the need for `dumb-init`

Newer versions of Docker have a `--init` argument which spawns an init process
in the container, which we should be able to use everywhere now.

6 years agoclear out projection subobligations after they are processed
Ariel Ben-Yehuda [Sun, 20 Aug 2017 16:16:36 +0000 (19:16 +0300)]
clear out projection subobligations after they are processed

After a projection was processed, its derived subobligations no longer
need any processing when encountered, and can be removed. This improves
the status of #43787.

This is actually complementary to #43938 - that PR fixes selection
caching (and @remram44's example, which "accidentally" worked because of
the buggy projection caching) while this PR fixes projection caching

6 years agoAuto merge of #44060 - taleks:issue-43205, r=arielb1
bors [Sun, 27 Aug 2017 12:53:48 +0000 (12:53 +0000)]
Auto merge of #44060 - taleks:issue-43205, r=arielb1

Fixes issue #43205: ICE in Rvalue::Len evaluation.

- fixes evaluation of array length for zero-sized type referenced by rvalue operand.
- adds test to verify fix.

*Cause of the issue*.

Zero-sized aggregates are handled as operands, not lvalues. Therefore while visiting `Assign` statement by `LocalAnalyser`, `mark_as_lvalue()` is not called for related `Local`. This behaviour is controlled by `rvalue_creates_operand()` method.

As result it causes error later, when rvalue operand is evaluated in `trans_rvalue_operand()` while handling `Rvalue::Len` case. Array length evaluation invokes `trans_lvalue()` which expects referenced `Local` to be value, not operand.

*How it is fixed*.

In certain cases result of `Rvalue::Len` can be evaluated without calling
`trans_lvalue()`. Method `evaluate_array_len()` is introduced to handle length
evaluation for zero-sized types referenced by Locals.

*Some concerns*.

- `trans_lvalue()` has two other entry points in `rvalue.rs`: it is invoked while handling `Rvalue::Ref` and `Rvalue::Discriminant`. There is a chance those may produce the same issue, but I've failed to write a specific test that leads to this.
- `evaluate_array_len()` performs the same check (matches lvalue and `Local`), which is performed again in `trans_lvalue()`. Without changing `trans_lvalue()` signature to make it aware that caller deals with rvalue, it seems there is no cheap solution to avoid this check.

6 years agoClarify that VecDeque::swap can panic
David Ross [Sun, 27 Aug 2017 10:22:53 +0000 (03:22 -0700)]
Clarify that VecDeque::swap can panic

The previous documentation mentioned this, but ambiguously used the term "fail".

This clarifies that the function will panic if the index is out of bounds, instead of silently failing and not doing anything.

6 years agoAuto merge of #42588 - ishitatsuyuki:patch-1, r=petrochenkov
bors [Sun, 27 Aug 2017 10:02:51 +0000 (10:02 +0000)]
Auto merge of #42588 - ishitatsuyuki:patch-1, r=petrochenkov

Make unused-extern-crate warn-by-default

Apart from enabling the lint, this pull request also removes existing unused crates in the codebase, and fix some amount of false positives on crates with special purposes.

Now that all false positive issues are closed, it should be possible to make it available to wider users.

Quote:
> Now that macro modularization is implemented, this is true today! *https://github.com/rust-lang/rust/issues/30849#issuecomment-286573218*

Concerns: can break some `#[deny(warnings)]`.

Close #42591

6 years agoUpdate Cargo submodule
Tatsuyuki Ishi [Fri, 25 Aug 2017 06:54:15 +0000 (15:54 +0900)]
Update Cargo submodule

6 years agoWhitelist for dummy_jemalloc
Tatsuyuki Ishi [Thu, 24 Aug 2017 00:27:12 +0000 (09:27 +0900)]
Whitelist for dummy_jemalloc

6 years agoAdditional libc cleanup
Tatsuyuki Ishi [Wed, 23 Aug 2017 00:57:05 +0000 (09:57 +0900)]
Additional libc cleanup

6 years agoPlatform gate libc in libtest
Tatsuyuki Ishi [Tue, 22 Aug 2017 04:33:43 +0000 (13:33 +0900)]
Platform gate libc in libtest

6 years agoWhitelist unwind import in std
Tatsuyuki Ishi [Tue, 22 Aug 2017 01:30:51 +0000 (10:30 +0900)]
Whitelist unwind import in std

This is a part of libbacktrace linkage and thus the compiler cannot detect if it's used or not.

6 years agoAdd missing dependency for Windows
Tatsuyuki Ishi [Mon, 14 Aug 2017 00:26:14 +0000 (09:26 +0900)]
Add missing dependency for Windows

6 years agoAddress review comments, second turn
Tatsuyuki Ishi [Sun, 13 Aug 2017 02:58:17 +0000 (11:58 +0900)]
Address review comments, second turn

6 years agoMove unused-extern-crate to late pass
Tatsuyuki Ishi [Sat, 24 Jun 2017 08:48:27 +0000 (17:48 +0900)]
Move unused-extern-crate to late pass

6 years agoMake unused-extern-crate warn-by-default
Tatsuyuki Ishi [Sun, 11 Jun 2017 02:44:22 +0000 (11:44 +0900)]
Make unused-extern-crate warn-by-default

6 years agoAuto merge of #44112 - alexcrichton:thread-join, r=sfackler
bors [Sun, 27 Aug 2017 04:20:28 +0000 (04:20 +0000)]
Auto merge of #44112 - alexcrichton:thread-join, r=sfackler

std: Handle OS errors when joining threads

Also add to the documentation that the `join` method can panic.

cc #34971
cc #43539

6 years agostd: Handle OS errors when joining threads
Alex Crichton [Sun, 27 Aug 2017 02:36:46 +0000 (19:36 -0700)]
std: Handle OS errors when joining threads

Also add to the documentation that the `join` method can panic.

cc #34971
cc #43539

6 years agoAuto merge of #44102 - Mark-Simulacrum:update-cargo, r=alexcrichton
bors [Sun, 27 Aug 2017 01:41:45 +0000 (01:41 +0000)]
Auto merge of #44102 - Mark-Simulacrum:update-cargo, r=alexcrichton

Update cargo

Should permit https://github.com/rust-lang/rust/pull/41991 to move forward. I think it's best to land this as a separate patch and rebase that, though.

r? @alexcrichton

6 years agoci: Remove the need for `dumb-init`
Alex Crichton [Sun, 27 Aug 2017 01:34:13 +0000 (18:34 -0700)]
ci: Remove the need for `dumb-init`

Newer versions of Docker have a `--init` argument which spawns an init process
in the container, which we should be able to use everywhere now.

6 years agoAuto merge of #44096 - Dushistov:master, r=japaric
bors [Sat, 26 Aug 2017 23:11:44 +0000 (23:11 +0000)]
Auto merge of #44096 - Dushistov:master, r=japaric

Add test for wrong code generation for HashSet creation on arm cpu

This is test for #42918.
To reproduce bug you need machine with arm cpu and compile with optimization.
I tried with rustc 1.19.0-nightly (3d5b8c626 2017-06-09),
if compile test with -C opt-level=3 for target=arm-linux-androideabi
and run on "Qualcomm MSM 8974 arm cpu" then assert fails,
if compile and run with -C opt-level=2 it gives segmentation fault.
So I add `compile-flags: -O`.
With rustc 1.19.0 (0ade33941 2017-07-17) all works fine.
Closes #42918

6 years agoAuto merge of #44084 - alexcrichton:msvc-ninja, r=Mark-Simulacrum
bors [Sat, 26 Aug 2017 20:21:28 +0000 (20:21 +0000)]
Auto merge of #44084 - alexcrichton:msvc-ninja, r=Mark-Simulacrum

rustbuild: Automatically enable Ninja on MSVC

Discovered in #43767 it turns out the default MSBuild generator in CMake for
whatever reason isn't supporting many of the configuration options we give to
LLVM. To improve the contributor experience automatically enable Ninja if we
find it to ensure that "flavorful" configurations of LLVM work by default in
more situations.

Closes #43767

6 years agoUpdate cargo
Mark Simulacrum [Sat, 26 Aug 2017 18:26:19 +0000 (12:26 -0600)]
Update cargo

6 years agoAuto merge of #44082 - pnkfelix:issue-43457, r=eddyb
bors [Sat, 26 Aug 2017 17:48:29 +0000 (17:48 +0000)]
Auto merge of #44082 - pnkfelix:issue-43457, r=eddyb

Fix destruction extent lookup during HIR -> HAIR translation

My method for finding the destruction extent, if any, from cbed41a174aad44e069bec09bf1e502591c132ae (in #39409), was buggy in that it sometimes failed to find an extent that was nonetheless present.

This fixes that, and is cleaner code to boot.

Fix #43457

6 years agoAuto merge of #44098 - frewsxcv:rollup, r=frewsxcv
bors [Sat, 26 Aug 2017 15:17:32 +0000 (15:17 +0000)]
Auto merge of #44098 - frewsxcv:rollup, r=frewsxcv

Rollup of 7 pull requests

- Successful merges: #43776, #43966, #43979, #44072, #44086, #44090, #44091
- Failed merges:

6 years agoRollup merge of #44091 - kallisti5:haiku-fix, r=eddyb
Corey Farwell [Sat, 26 Aug 2017 13:46:37 +0000 (06:46 -0700)]
Rollup merge of #44091 - kallisti5:haiku-fix, r=eddyb

haiku/librustc_back: Remove incorrect no_integrated_as

* Makes rust bootstrap incorrectly search for xxx.s vs xxx.0.s
* Not needed or incorrect fix for another issue.

6 years agoRollup merge of #44090 - GuillaumeGomez:str-doc, r=steveklabnik
Corey Farwell [Sat, 26 Aug 2017 13:46:36 +0000 (06:46 -0700)]
Rollup merge of #44090 - GuillaumeGomez:str-doc, r=steveklabnik

Add missing link in string doc

r? @rust-lang/docs

6 years agoRollup merge of #44086 - kennytm:htmldocck-python3, r=Mark-Simulacrum
Corey Farwell [Sat, 26 Aug 2017 13:46:35 +0000 (06:46 -0700)]
Rollup merge of #44086 - kennytm:htmldocck-python3, r=Mark-Simulacrum

Allow `htmldocck.py` to run using Python 3

6 years agoRollup merge of #44072 - lukaramu:fix-doc-headings, r=steveklabnik
Corey Farwell [Sat, 26 Aug 2017 13:46:34 +0000 (06:46 -0700)]
Rollup merge of #44072 - lukaramu:fix-doc-headings, r=steveklabnik

Fix inconsistent doc headings

This fixes headings reading "Unsafety" and "Example", they should be "Safety" and "Examples" according to RFC 1574.

r? @steveklabnik

6 years agoRollup merge of #43979 - Jouan:Add-links-for-impls, r=GuillaumeGomez
Corey Farwell [Sat, 26 Aug 2017 13:46:33 +0000 (06:46 -0700)]
Rollup merge of #43979 - Jouan:Add-links-for-impls, r=GuillaumeGomez

Add links for impls

Implements a solution for issue #23552
r? @QuietMisdreavus

6 years agoRollup merge of #43966 - GuillaumeGomez:remove-dup, r=QuietMisdreavus
Corey Farwell [Sat, 26 Aug 2017 13:46:32 +0000 (06:46 -0700)]
Rollup merge of #43966 - GuillaumeGomez:remove-dup, r=QuietMisdreavus

Remove duplicates in rustdoc

Fixes #43934.

Two things however:

 1. I'm not happy with the current check. It seems completely overkill and unsatisfying.
 2. I have no idea how to test if there is only one element and not two.

r? @rust-lang/docs

6 years agoRollup merge of #43776 - zackmdavis:feature_gate_fn_must_use, r=alexcrichton
Corey Farwell [Sat, 26 Aug 2017 13:46:31 +0000 (06:46 -0700)]
Rollup merge of #43776 - zackmdavis:feature_gate_fn_must_use, r=alexcrichton

feature-gate #[must_use] for functions as `fn_must_use`

@eddyb I [was](https://github.com/rust-lang/rust/pull/43728#issuecomment-320854120) [dithering](https://github.com/rust-lang/rust/pull/43728#issuecomment-320856407) on this, but [your comment](https://github.com/rust-lang/rust/issues/43302#issuecomment-321174989) makes it sound like we do want a feature gate for this? Please advise.

r? @eddyb

6 years agoDo not include the src/Cargo.toml
Ralf Jung [Sat, 26 Aug 2017 13:29:17 +0000 (15:29 +0200)]
Do not include the src/Cargo.toml

distcheck complains that this file references projects not cotnained in the tarball

6 years agoAuto merge of #44081 - est31:master, r=eddyb
bors [Sat, 26 Aug 2017 12:50:11 +0000 (12:50 +0000)]
Auto merge of #44081 - est31:master, r=eddyb

Fix a byte/char confusion issue in the error emitter

Fixes #44078. Fixes #44023.

The start_col member is given in chars, while the code previously assumed it was given in bytes.

The more basic issue #44080 doesn't get fixed.

6 years agoAuto merge of #44071 - alexcrichton:no-cycles, r=nikomatsakis
bors [Sat, 26 Aug 2017 08:25:44 +0000 (08:25 +0000)]
Auto merge of #44071 - alexcrichton:no-cycles, r=nikomatsakis

rustc: Start moving toward "try_get is a bug" for incremental

This PR is an effort to burn down some of the work items on #42633. The basic change here was to leave the `try_get` function exposed but have it return a `DiagnosticBuilder` instead of a `CycleError`. This means that it should be a compiler bug to *not* handle the error as dropping a diagnostic should result in a complier panic.

After that change it was then necessary to update the compiler's callsites of `try_get` to handle the error coming out. These were handled as:

* The `sized_constraint` and `needs_drop_raw` checks take the diagnostic and defer it as a compiler bug. This was a new piece of functionality added to the error handling infrastructure, and the idea is that for both these checks a "real" compiler error should be emitted elsewhere, so it's only a bug if we don't actually emit the complier error elsewhere.
* MIR inlining was updated to just ignore the diagnostic. This is being tracked by https://github.com/rust-lang/rust/issues/43542 which sounded like it either already had some work underway or was planning to change regardless.
* The final case, `item_path`, is still sort of up for debate. At the time of this writing this PR simply removes the invocations of `try_get` there, assuming that the query will always succeed. This turns out to be true for the test suite anyway! It sounds like, though, that this logic was intended to assist in "weird" situations like `RUST_LOG` where debug implementations can trigger at any time. This PR would therefore, however, break those implementations.

I'm unfortunately sort of out of ideas on how to handle `item_path`, but other thoughts would be welcome!

Closes #42633

6 years agoAdd test for wrong code generation for HashSet creation on arm cpu
Evgeniy A. Dushistov [Sat, 26 Aug 2017 05:24:26 +0000 (08:24 +0300)]
Add test for wrong code generation for HashSet creation on arm cpu

This is test for #42918.
To reproduce bug you need machine with arm cpu and compile with optimization.
I tried with rustc 1.19.0-nightly (3d5b8c626 2017-06-09),
if compile test with -C opt-level=3 for target=arm-linux-androideabi
and run on "Qualcomm MSM 8974 arm cpu" then assert fails,
if compile and run with -C opt-level=2 it gives segmentation fault.
So I add `compile-flags: -O`.
With rustc 1.19.0 (0ade33941 2017-07-17) all works fine.
Closes #42918

6 years agoAuto merge of #44028 - nrc:rls-update, r=alexcrichton
bors [Sat, 26 Aug 2017 01:28:57 +0000 (01:28 +0000)]
Auto merge of #44028 - nrc:rls-update, r=alexcrichton

Update RLS and Cargo

r? @alexcrichton

6 years agoUpdate RLS and Cargo
Nick Cameron [Thu, 24 Aug 2017 05:52:28 +0000 (17:52 +1200)]
Update RLS and Cargo

6 years agorustc: Make `report_cycle` and `CycleError` private
Alex Crichton [Thu, 24 Aug 2017 22:13:55 +0000 (15:13 -0700)]
rustc: Make `report_cycle` and `CycleError` private

6 years agorustc: Skip cyclic checks in `item_path`
Alex Crichton [Thu, 24 Aug 2017 14:37:09 +0000 (07:37 -0700)]
rustc: Skip cyclic checks in `item_path`

This seems like it may be likely to cause bugs with `RUST_LOG` and other
"interesting" scenarios, but it removes the usage of `try_get` for now!

6 years agorustc: Add a FIXME for `try_get` in MIR inlining
Alex Crichton [Thu, 24 Aug 2017 14:00:44 +0000 (07:00 -0700)]
rustc: Add a FIXME for `try_get` in MIR inlining

It sounds like this is being handled elsewhere, so for now just preserve the
existing behavior of ignoring th error.

6 years agorustc: Fix two instances of `try_get`
Alex Crichton [Wed, 23 Aug 2017 19:54:36 +0000 (12:54 -0700)]
rustc: Fix two instances of `try_get`

The `sized_constraint` and `needs_drop_raw` queries both use `try_get` to detect
cycles, but in both of these cases the cycle indicates an error has happened
elsewhere in compilation. In these cases we can just delay the diagnostic to get
emitted as a bug later if we ended up forgetting to emit the error diagnostic.

6 years agorustc: Change the return of a query's `try_get`
Alex Crichton [Wed, 23 Aug 2017 19:53:29 +0000 (12:53 -0700)]
rustc: Change the return of a query's `try_get`

This alters the return value of the `try_get` function so the error contains a
diagnostic rather than a `CycleError`. This way consumers are forced to take
*some* action (else they get a bug to an un-emitted diagnostic). This action
could be to emit the error itself, or in some cases delay the diagnostic as a
bug and continue.

6 years agorustc_errors: Add the ability to delay as bugs
Alex Crichton [Wed, 23 Aug 2017 19:52:22 +0000 (12:52 -0700)]
rustc_errors: Add the ability to delay as bugs

This adds a function to `DiagnosticBuilder` to delay the entire diagnostic as a
bug to be emitted at a later time. This'll end up getting used in the compiler
in the subsequent commits...

6 years agoAuto merge of #43994 - tamird:remove-attributes, r=alexcrichton
bors [Fri, 25 Aug 2017 22:54:00 +0000 (22:54 +0000)]
Auto merge of #43994 - tamird:remove-attributes, r=alexcrichton

*: remove crate_{name,type} attributes

Fixes #41701.

r? @arielb1

6 years agohaiku/librustc_back: Remove incorrect no_integrated_as
Alexander von Gluck IV [Fri, 25 Aug 2017 22:12:20 +0000 (17:12 -0500)]
haiku/librustc_back: Remove incorrect no_integrated_as

* Makes rust bootstrap incorrectly search for xxx.s vs xxx.0.s
* Not needed or incorrect fix for another issue.

6 years agoAdd missing link in string doc
Guillaume Gomez [Fri, 25 Aug 2017 21:09:00 +0000 (23:09 +0200)]
Add missing link in string doc

6 years ago*: remove crate_{name,type} attributes
Tamir Duberstein [Sat, 19 Aug 2017 23:54:17 +0000 (16:54 -0700)]
*: remove crate_{name,type} attributes

Fixes #41701.

6 years agosyntax: clarify field name
Tamir Duberstein [Sun, 20 Aug 2017 15:40:07 +0000 (08:40 -0700)]
syntax: clarify field name

The value of this field is meant to indicate whether or not the
crate is rustc's libtest itself - not whether or not it is a test
crate generally.

6 years agoAuto merge of #44046 - alexcrichton:capture-diagnostics, r=michaelwoerister
bors [Fri, 25 Aug 2017 20:11:25 +0000 (20:11 +0000)]
Auto merge of #44046 - alexcrichton:capture-diagnostics, r=michaelwoerister

rustc: Capture diagnostics from all queries

This commit alters the `rustc::ty::maps` implementation to ensure that all
output diagnostics from the compiler are tracked for the duration of each query.
These are then intended to be replayed back the first time a cached value is
loaded, and otherwise the cache should operate the same as it does today.

Closes #42513

6 years agosyntax: remove unused field
Tamir Duberstein [Sun, 20 Aug 2017 15:22:46 +0000 (08:22 -0700)]
syntax: remove unused field

6 years agoFix a byte/char confusion issue in the error emitter
est31 [Fri, 25 Aug 2017 10:25:22 +0000 (12:25 +0200)]
Fix a byte/char confusion issue in the error emitter

Fixes #44078. Fixes #44023.

The start_col member is given in chars,
while the code previously assumed it was given in bytes.

The more basic issue #44080 doesn't get fixed.

6 years agoClean up YieldFinder
John Kåre Alsaker [Fri, 25 Aug 2017 18:10:23 +0000 (20:10 +0200)]
Clean up YieldFinder

6 years agoAllow htmldocck to run using Python 3.
kennytm [Fri, 25 Aug 2017 15:27:42 +0000 (23:27 +0800)]
Allow htmldocck to run using Python 3.

6 years agoAuto merge of #44053 - alexcrichton:no-choco, r=Mark-Simulacrum
bors [Fri, 25 Aug 2017 17:26:15 +0000 (17:26 +0000)]
Auto merge of #44053 - alexcrichton:no-choco, r=Mark-Simulacrum

appveyor: Use InnoSetup from our mirror

Chocolatey has been pretty flaky, so let's not rely on it.

Closes #43985

6 years agoAdd some comments and fix a typo
John Kåre Alsaker [Thu, 24 Aug 2017 22:57:08 +0000 (00:57 +0200)]
Add some comments and fix a typo

6 years agorustbuild: Automatically enable Ninja on MSVC
Alex Crichton [Fri, 25 Aug 2017 17:10:27 +0000 (10:10 -0700)]
rustbuild: Automatically enable Ninja on MSVC

Discovered in #43767 it turns out the default MSBuild generator in CMake for
whatever reason isn't supporting many of the configuration options we give to
LLVM. To improve the contributor experience automatically enable Ninja if we
find it to ensure that "flavorful" configurations of LLVM work by default in
more situations.

Closes #43767

6 years agoComment about generators and drops
Alex Crichton [Fri, 25 Aug 2017 14:41:30 +0000 (07:41 -0700)]
Comment about generators and drops

6 years agoAdd some suggested comments around drops
Alex Crichton [Fri, 25 Aug 2017 14:38:57 +0000 (07:38 -0700)]
Add some suggested comments around drops

6 years agoRegression test.
Felix S. Klock II [Fri, 25 Aug 2017 14:35:42 +0000 (16:35 +0200)]
Regression test.

6 years agoRemove unneeded FIXME for now
Alex Crichton [Fri, 25 Aug 2017 14:31:05 +0000 (07:31 -0700)]
Remove unneeded FIXME for now