]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRollup merge of #65920 - smaeul:patch/workspace-hack, r=alexcrichton
Tyler Mandry [Tue, 29 Oct 2019 19:01:46 +0000 (12:01 -0700)]
Rollup merge of #65920 - smaeul:patch/workspace-hack, r=alexcrichton

Use rustc-workspace-hack for rustbook

As rustbook now depends transitively on openssl, it needs access to the
rustc-workspace-hack/all-static feature to pick up openssl-sys/vendored.
This fixes the rust build with `all-static = true` on systems where
openssl is not installed (e.g. when cross-compiling).

4 years agoRollup merge of #65906 - integer32llc:update-mdbook, r=alexcrichton
Tyler Mandry [Tue, 29 Oct 2019 19:01:44 +0000 (12:01 -0700)]
Rollup merge of #65906 - integer32llc:update-mdbook, r=alexcrichton

Update mdbook to 0.3.3

There are some new features of mdbook that I'd like to use in TRPL.

4 years agoRollup merge of #65900 - eddyb:proc-macro-cleanup, r=alexcrichton
Tyler Mandry [Tue, 29 Oct 2019 19:01:43 +0000 (12:01 -0700)]
Rollup merge of #65900 - eddyb:proc-macro-cleanup, r=alexcrichton

proc_macro: clean up bridge::client::__run_expand{1,2} a bit.

See commit titles/diffs for more details.

The first commit is made possible by #53451 being fixed (almost a year ago).
The last commit should remove the need for `#[allow(improper_ctypes)]` in #65134.

4 years agoRollup merge of #65898 - hermitcore:rusty-hermit, r=kennytm
Tyler Mandry [Tue, 29 Oct 2019 19:01:41 +0000 (12:01 -0700)]
Rollup merge of #65898 - hermitcore:rusty-hermit, r=kennytm

add basic HermitCore support within libtest

This an extension to #65167. The current pull request extend libtest to support HermitCore as target OS.

4 years agoRollup merge of #65843 - xen0n:mips64-musl-targets-with-ci, r=alexcrichton
Tyler Mandry [Tue, 29 Oct 2019 19:01:40 +0000 (12:01 -0700)]
Rollup merge of #65843 - xen0n:mips64-musl-targets-with-ci, r=alexcrichton

Enable dist for MIPS64 musl targets

Continuing work in #63165, necessary libc changes are in place and published so here we go!

4 years agoRollup merge of #65832 - tlively:emscripten-exception-handling, r=alexcrichton
Tyler Mandry [Tue, 29 Oct 2019 19:01:38 +0000 (12:01 -0700)]
Rollup merge of #65832 - tlively:emscripten-exception-handling, r=alexcrichton

Re-enable Emscripten's exception handling support

Passes LLVM codegen and Emscripten link-time flags for exception
handling if and only if the panic strategy is `unwind`. Sets the
default panic strategy for Emscripten targets to `unwind`. Re-enables
tests that depend on unwinding support for Emscripten, including
`should_panic` tests.

r? @alexcrichton

4 years agoRollup merge of #65741 - GuillaumeGomez:help-popup, r=Dylan-DPC
Tyler Mandry [Tue, 29 Oct 2019 19:01:37 +0000 (12:01 -0700)]
Rollup merge of #65741 - GuillaumeGomez:help-popup, r=Dylan-DPC

Prevent help popup to disappear when clicking on it

Fixes #65736.

r? @kinnison

4 years agoRollup merge of #65724 - pietroalbini:ci-remove-template-parameter, r=alexcrichton
Tyler Mandry [Tue, 29 Oct 2019 19:01:35 +0000 (12:01 -0700)]
Rollup merge of #65724 - pietroalbini:ci-remove-template-parameter, r=alexcrichton

ci: refactor pr tools job skipping

We have a job in our CI (PR's x86_64-gnu-tools) that's supposed to run only when a submodule is changed in the PR, and it works by having a task at the start of the build that skips all the following tasks if the condition isn't met.

Before this commit that task was gated with template parameters, which is a unique feature of Azure Pipelines. To make our CI more generic this commit switches the gate to use a simple environment variable plus a condition, which should be supported on more CI providers.

This PR also extracts the skipping logic into a script.

r? @alexcrichton

4 years agoRollup merge of #65539 - traxys:fix_62334, r=petrochenkov
Tyler Mandry [Tue, 29 Oct 2019 19:01:33 +0000 (12:01 -0700)]
Rollup merge of #65539 - traxys:fix_62334, r=petrochenkov

resolve: Turn the "non-empty glob must import something" error into a lint

This fixes #62334 by changing the error to a lint warning the glob. I changed the test but I'm very unsure of what I did as I do not know how to correctly check for the warning

4 years agoRollup merge of #65405 - GuillaumeGomez:long-err-explanation-E0740, r=Dylan-DPC
Tyler Mandry [Tue, 29 Oct 2019 19:01:31 +0000 (12:01 -0700)]
Rollup merge of #65405 - GuillaumeGomez:long-err-explanation-E0740, r=Dylan-DPC

Create new error E0742 and add long error explanation

Part of #61137.

Creates E0742 error code and add its long error explanation.

4 years agoChange E0741 into E0742
Guillaume Gomez [Tue, 29 Oct 2019 12:59:22 +0000 (13:59 +0100)]
Change E0741 into E0742

4 years agoUpdate ui tests
Guillaume Gomez [Mon, 14 Oct 2019 12:07:05 +0000 (14:07 +0200)]
Update ui tests

4 years agoAdd long error explanation for E0740
Guillaume Gomez [Mon, 14 Oct 2019 12:06:54 +0000 (14:06 +0200)]
Add long error explanation for E0740

4 years agoCreate new error code E0740 for visibility restrictions to ancestor module issues
Guillaume Gomez [Mon, 14 Oct 2019 11:13:38 +0000 (13:13 +0200)]
Create new error code E0740 for visibility restrictions to ancestor module issues

4 years agoAuto merge of #65927 - eddyb:eval-always-considered-harmful, r=michaelwoerister
bors [Tue, 29 Oct 2019 11:28:28 +0000 (11:28 +0000)]
Auto merge of #65927 - eddyb:eval-always-considered-harmful, r=michaelwoerister

Don't use eval_always for miri queries used from codegen.

This should fix the [massive incremental perf regression](https://perf.rust-lang.org/compare.html?start=95f437b3cfb2fec966d7eaf69d7c2e36f9c274d1&end=9285d401a6070094747465962bc49969b93e14c5&stat=instructions:u) introduced in #65664.

It seems that `eval_always` was mistakenly(?) added to `const_field` and then it ended up on `const_caller_location` (which is used much more often than `const_field` is).

r? @michaelwoerister cc @oli-obk @nnethercote

4 years agoDon't use eval_always for miri queries used from codegen.
Eduard-Mihai Burtescu [Tue, 29 Oct 2019 11:04:29 +0000 (13:04 +0200)]
Don't use eval_always for miri queries used from codegen.

4 years agoApply suggestions from lzutao
Pietro Albini [Tue, 29 Oct 2019 09:32:51 +0000 (10:32 +0100)]
Apply suggestions from lzutao

Co-Authored-By: lzutao <taolzu@gmail.com>
4 years agoci: extract job skipping logic into a script
Pietro Albini [Wed, 23 Oct 2019 14:07:13 +0000 (16:07 +0200)]
ci: extract job skipping logic into a script

4 years agoci: enable "run when submodule changes" with environment variables
Pietro Albini [Wed, 23 Oct 2019 13:56:21 +0000 (15:56 +0200)]
ci: enable "run when submodule changes" with environment variables

We have a job in our CI (PR's x86_64-gnu-tools) that's supposed to run
only when a submodule is changed in the PR, and it works by having a
task at the start of the build that skips all the following tasks if the
condition isn't met.

Before this commit that task was gated with template parameters, which
is a unique feature of Azure Pipelines. To make our CI more generic this
commit switches the gate to use a simple environment variable plus a
condition, which should be supported on more CI providers.

4 years agoAuto merge of #65435 - michaelwoerister:fix-issue-64153, r=alexcrichton
bors [Tue, 29 Oct 2019 07:38:50 +0000 (07:38 +0000)]
Auto merge of #65435 - michaelwoerister:fix-issue-64153, r=alexcrichton

Fix #64153

This PR changes how the compiler detects if an object file from an upstream crate is a Rust object file or not. Instead of checking if the name starts with the crate name and ends with `.o` (which is not always the case, as described in #64153), it now just checks if the filename ends with `.rcgu.o`.

This fixes #64153. However, ideally we'd clean up the code around filename generation some more. Then this check could be made more robust.

r? @alexcrichton

4 years agoAuto merge of #65919 - Centril:rollup-qrgwnt6, r=Centril
bors [Tue, 29 Oct 2019 04:12:23 +0000 (04:12 +0000)]
Auto merge of #65919 - Centril:rollup-qrgwnt6, r=Centril

Rollup of 5 pull requests

Successful merges:

 - #65294 (Lint ignored `#[inline]` on function prototypes)
 - #65318 (Call out the types that are non local on E0117)
 - #65531 (Update backtrace to 0.3.40)
 - #65562 (Improve the "try using a variant of the expected type" hint.)
 - #65809 (Add new EFIAPI ABI)

Failed merges:

r? @ghost

4 years agoUse rustc-workspace-hack for rustbook
Samuel Holland [Sun, 6 Oct 2019 22:30:11 +0000 (17:30 -0500)]
Use rustc-workspace-hack for rustbook

As rustbook now depends transitively on openssl, it needs access to the
rustc-workspace-hack/all-static feature to pick up openssl-sys/vendored.
This fixes the rust build with `all-static = true` on systems where
openssl is not installed (e.g. when cross-compiling).

4 years agoRollup merge of #65809 - roblabla:eficall-abi, r=nagisa
Mazdak Farrokhzad [Tue, 29 Oct 2019 03:08:23 +0000 (04:08 +0100)]
Rollup merge of #65809 - roblabla:eficall-abi, r=nagisa

Add new EFIAPI ABI

Fixes #54527

Adds a new ABI, "efiapi", which reflects the calling convention as specified by [the current spec UEFI spec](https://uefi.org/sites/default/files/resources/UEFI%20Spec%202_7_A%20Sept%206.pdf#G6.999903). When compiling for x86_64, we should select the `win64` ABI, while on all other architectures (Itanium, x86, ARM and ARM64 and RISC-V), we should select the `C` ABI.

Currently, this is done by just turning it into the C ABI everywhere except on x86_64, where it's turned into the win64 ABI. Should we prevent this ABI from being used on unsupported architectures, and if so, how would this be done?

4 years agoRollup merge of #65562 - Patryk27:master, r=estebank
Mazdak Farrokhzad [Tue, 29 Oct 2019 03:08:21 +0000 (04:08 +0100)]
Rollup merge of #65562 - Patryk27:master, r=estebank

Improve the "try using a variant of the expected type" hint.

Fix https://github.com/rust-lang/rust/issues/65494.

- Change type-printing output.
- Use `span_to_snippet` when possible.
- Change the message to `try using a variant of the expected enum`

4 years agoRollup merge of #65531 - tmandry:bump-backtrace, r=cramertj
Mazdak Farrokhzad [Tue, 29 Oct 2019 03:08:20 +0000 (04:08 +0100)]
Rollup merge of #65531 - tmandry:bump-backtrace, r=cramertj

Update backtrace to 0.3.40

Diff: https://github.com/rust-lang/backtrace-rs/compare/0.3.37...b5cc5b12fa4fd03cb83546a7c62b9fff40086b63

Pretty low risk, considering the only changes are in low-tier targets.

r? @cramertj
cc @alexcrichton

4 years agoRollup merge of #65318 - estebank:coherence, r=varkor
Mazdak Farrokhzad [Tue, 29 Oct 2019 03:08:19 +0000 (04:08 +0100)]
Rollup merge of #65318 - estebank:coherence, r=varkor

Call out the types that are non local on E0117

CC #24745.

4 years agoRollup merge of #65294 - varkor:lint-inline-prototype, r=matthewjasper
Mazdak Farrokhzad [Tue, 29 Oct 2019 03:08:18 +0000 (04:08 +0100)]
Rollup merge of #65294 - varkor:lint-inline-prototype, r=matthewjasper

Lint ignored `#[inline]` on function prototypes

Fixes https://github.com/rust-lang/rust/issues/51280.

- Adds a `unused_attribute` lint for `#[inline]` on function prototypes.
- As a consequence, foreign items, impl items and trait items now have their attributes checked, which could cause some code to no longer compile (it was previously erroneously ignored).

4 years agoUpdate backtrace to 0.3.40
Tyler Mandry [Thu, 17 Oct 2019 22:58:48 +0000 (15:58 -0700)]
Update backtrace to 0.3.40

4 years agoforgot to add the changed stderr
Quentin Boyer [Mon, 28 Oct 2019 23:20:28 +0000 (00:20 +0100)]
forgot to add the changed stderr

4 years agoAuto merge of #65907 - Centril:rollup-9i8ev23, r=Centril
bors [Mon, 28 Oct 2019 20:59:36 +0000 (20:59 +0000)]
Auto merge of #65907 - Centril:rollup-9i8ev23, r=Centril

Rollup of 9 pull requests

Successful merges:

 - #65563 (Add long error explanation for E0587)
 - #65640 (Use heuristics to recover parsing of missing `;`)
 - #65643 (Correct handling of type flags with `ConstValue::Placeholder`)
 - #65825 (rustc: use IndexVec<DefIndex, T> instead of Vec<T>.)
 - #65858 (suggest `const_in_array_repeat_expression` flag)
 - #65877 (doc: introduce `once` in `iter::chain` document)
 - #65887 (doc: mention `get(_mut)` in Vec)
 - #65891 (self-profiling: Record something more useful for crate metadata generation event.)
 - #65893 (Output previous stable  error messaging when using stable build.)

Failed merges:

r? @ghost

4 years agoRollup merge of #65893 - jafern14:let-expr-stable-error-messaging, r=Centril
Mazdak Farrokhzad [Mon, 28 Oct 2019 20:36:08 +0000 (21:36 +0100)]
Rollup merge of #65893 - jafern14:let-expr-stable-error-messaging, r=Centril

Output previous stable  error messaging when using stable build.

Fixes #65254

As I had mentioned previously there I have the logic running right now however I'm not getting the exact same syntax highlighting as there was originally for this error.

I'm currently getting the following:
```
error: expected expression, found statement (`let`)
 --> src/main.rs:2:14
  |
2 |     let x = (let y = 6);
  |              ^^^^^^^^^
  |
  = note: variable declaration using `let` is a statement
```

I'd like to get the following instead:

```
  |     let x = (let y = 6);
  |              ^^^
```

My current understanding is that the `span` being passed into `lower_expr_let` is coming from `lowering.rs`. I still don't know how the byte range is calculated for the erroneous syntax and need to look into it a bit more. In the meantime does anybody have any hints/tips regarding this??

4 years agoRollup merge of #65891 - michaelwoerister:sp-crate-metadata, r=wesleywiser
Mazdak Farrokhzad [Mon, 28 Oct 2019 20:36:07 +0000 (21:36 +0100)]
Rollup merge of #65891 - michaelwoerister:sp-crate-metadata, r=wesleywiser

self-profiling: Record something more useful for crate metadata generation event.

Before this commit, we had an event that would only track the compression step
for proc-macros and Rust dylibs. After the commit we measure the time for
acutally generating the crate metadata bytes.

r? @wesleywiser

4 years agoRollup merge of #65887 - lzutao:doc-vec-get, r=rkruppe
Mazdak Farrokhzad [Mon, 28 Oct 2019 20:36:06 +0000 (21:36 +0100)]
Rollup merge of #65887 - lzutao:doc-vec-get, r=rkruppe

doc: mention `get(_mut)` in Vec

4 years agoRollup merge of #65877 - lzutao:iter-chain-once, r=Centril
Mazdak Farrokhzad [Mon, 28 Oct 2019 20:36:04 +0000 (21:36 +0100)]
Rollup merge of #65877 - lzutao:iter-chain-once, r=Centril

doc: introduce `once` in `iter::chain` document

I find it hard to find which one to use with `chain` when I only need to
chain one value. Also [`once`][1] talks about `chain`.

[1]: https://doc.rust-lang.org/nightly/std/iter/fn.once.html

4 years agoRollup merge of #65858 - davidtwco:rfc-2203-feature-gate-in-error, r=ecstatic-morse
Mazdak Farrokhzad [Mon, 28 Oct 2019 20:36:02 +0000 (21:36 +0100)]
Rollup merge of #65858 - davidtwco:rfc-2203-feature-gate-in-error, r=ecstatic-morse

suggest `const_in_array_repeat_expression` flag

This PR adds a suggestion to add the `#![feature(const_in_array_repeat_expression)]` attribute to the crate when a promotable expression is used in a repeat expression and the feature gate is not enabled.

Unfortunately, this ended up being a little bit more complex than I anticipated, which may not have been worth it given that this would all be removed when the feature is stabilized. However, with #65732 and #65737 being open, and the feature gate having not been being suggested to potential users, the feature might not be stabilized in a while, so maybe this is worth landing.

cc @Centril (addresses [this comment](https://github.com/rust-lang/rust/pull/61749#discussion_r307863857))
r? @ecstatic-morse (opened issues related to RFC 2203 recently)

4 years agoRollup merge of #65825 - eddyb:def-index-vec, r=varkor
Mazdak Farrokhzad [Mon, 28 Oct 2019 20:36:01 +0000 (21:36 +0100)]
Rollup merge of #65825 - eddyb:def-index-vec, r=varkor

rustc: use IndexVec<DefIndex, T> instead of Vec<T>.

Now that `DefIndex` is a proper index type, we can do that.
There was also an unnecessary `Option` I removed, I wonder if that has perf implications.

4 years agoRollup merge of #65643 - varkor:remove-free-regions-from-const-placeholder, r=eddyb
Mazdak Farrokhzad [Mon, 28 Oct 2019 20:35:59 +0000 (21:35 +0100)]
Rollup merge of #65643 - varkor:remove-free-regions-from-const-placeholder, r=eddyb

Correct handling of type flags with `ConstValue::Placeholder`

This fixes a mistake, but not https://github.com/rust-lang/rust/issues/65623.

r? @eddyb

4 years agoRollup merge of #65640 - estebank:recover-missing-semi, r=Centril
Mazdak Farrokhzad [Mon, 28 Oct 2019 20:35:58 +0000 (21:35 +0100)]
Rollup merge of #65640 - estebank:recover-missing-semi, r=Centril

Use heuristics to recover parsing of missing `;`

- Detect `,` and `:` typos where `;` was intended.
- When the next token could have been the start of a new statement,
  detect a missing semicolon.

Fix #48160, fix #44767 (after adding note about statements).

4 years agoRollup merge of #65563 - GuillaumeGomez:long-err-explanation-E0587, r=Dylan-DPC
Mazdak Farrokhzad [Mon, 28 Oct 2019 20:35:56 +0000 (21:35 +0100)]
Rollup merge of #65563 - GuillaumeGomez:long-err-explanation-E0587, r=Dylan-DPC

Add long error explanation for E0587

Part of #61137.

r? @kinnison

4 years agoUpdate mdbook to 0.3.3
Carol (Nichols || Goulding) [Mon, 28 Oct 2019 20:21:53 +0000 (16:21 -0400)]
Update mdbook to 0.3.3

4 years agoOutput previous stable error messaging when using stable build.
Agustin Fernandez [Mon, 28 Oct 2019 13:15:46 +0000 (09:15 -0400)]
Output previous stable error messaging when using stable build.

4 years agoRevert "Temporarily enable asmjs and wasm32 CI on PRs"
Thomas Lively [Mon, 28 Oct 2019 19:30:08 +0000 (12:30 -0700)]
Revert "Temporarily enable asmjs and wasm32 CI on PRs"

This reverts commit 29d6aaae32df46f0f8101be6aafd9594ece8ad64.

4 years agosuggest `const_in_array_repeat_expression` flag
David Wood [Sat, 26 Oct 2019 22:59:24 +0000 (23:59 +0100)]
suggest `const_in_array_repeat_expression` flag

This commit adds a suggestion to add the
`#![feature(const_in_array_repeat_expression)]` attribute to the crate
when a promotable expression is used in a repeat expression.

Signed-off-by: David Wood <david@davidtw.co>
4 years agoproc_macro: don't use Rust ABI fn pointers in a C ABI fn signature.
Eduard-Mihai Burtescu [Mon, 28 Oct 2019 18:34:59 +0000 (20:34 +0200)]
proc_macro: don't use Rust ABI fn pointers in a C ABI fn signature.

4 years agoproc_macro: consolidate bridge::client::run_expand{1,2} into one helper.
Eduard-Mihai Burtescu [Mon, 28 Oct 2019 18:21:12 +0000 (20:21 +0200)]
proc_macro: consolidate bridge::client::run_expand{1,2} into one helper.

4 years agoremoving trailing whitespaces
Stefan Lankes [Mon, 28 Oct 2019 18:03:53 +0000 (14:03 -0400)]
removing trailing whitespaces

4 years agoproc_macro: remove now-unnecessary ICE workarounds from bridge::client.
Eduard-Mihai Burtescu [Mon, 28 Oct 2019 17:55:25 +0000 (19:55 +0200)]
proc_macro: remove now-unnecessary ICE workarounds from bridge::client.

4 years agoreview comments
Esteban Küber [Thu, 24 Oct 2019 22:57:43 +0000 (15:57 -0700)]
review comments

4 years agoTweak unexpected token wording
Esteban Küber [Tue, 22 Oct 2019 18:46:19 +0000 (11:46 -0700)]
Tweak unexpected token wording

4 years agoUse heuristics to recover parsing of missing `;`
Esteban Küber [Sun, 20 Oct 2019 21:35:46 +0000 (14:35 -0700)]
Use heuristics to recover parsing of missing `;`

- Detect `,` and `:` typos where `;` was intended.
- When the next token could have been the start of a new statement,
  detect a missing semicolon.

4 years agoImprove pretty-printing for compound qualified paths.
Patryk Wychowaniec [Sun, 27 Oct 2019 15:43:42 +0000 (16:43 +0100)]
Improve pretty-printing for compound qualified paths.

4 years agoFix a previously forgotten pretty-printing test after a change to the pretty-printing...
Patryk Wychowaniec [Sat, 26 Oct 2019 13:48:27 +0000 (15:48 +0200)]
Fix a previously forgotten pretty-printing test after a change to the pretty-printing mechanism.

4 years agoImprove the "try using a variant of the expected type" hint.
Patryk Wychowaniec [Fri, 18 Oct 2019 16:05:54 +0000 (18:05 +0200)]
Improve the "try using a variant of the expected type" hint.

4 years agoFix rebase
Esteban Küber [Mon, 28 Oct 2019 17:43:17 +0000 (10:43 -0700)]
Fix rebase

4 years agoAuto merge of #65202 - pietroalbini:scriptify-ci-config, r=alexcrichton
bors [Mon, 28 Oct 2019 17:17:30 +0000 (17:17 +0000)]
Auto merge of #65202 - pietroalbini:scriptify-ci-config, r=alexcrichton

ci: move most of the prepare config into scripts

This PR moves most of the configuration from the CI yamls into bash scripts, driven by a small Python script (which understands and emulates the two `##vso[` commands we use).

There are two reasons why we'd want to do this:

* Being able to prepare the build environment locally by just running `src/ci/prepare.py` simplifies a lot setting up a local VM similar to CI (software pre-installed in the CI images won't be prepared, but it's a start anyway).
* When we'll switch to GitHub Actions we'll need to either duplicate code in multiple workflows or write a preprocessor. Having all the prepare steps in a single one is going to simplify the implementation of both options.

Along with the move I did a few changes to the actual scripts:

* Mirrored all the remaining external URLs we download (except chocolatey) to the `rust-lang-ci-mirrors` bucket, to increase reliability and reduce the chance of supply chain attacks. I didn't audit and mirror the CI scripts outside this PR though.
* Extracted CI-specific behavior (like issuing `##vso[` commands and detecting the host platform) into `shared.sh` and included it in most of the scripts. This way a switch to another CI provider will be less painful.

It's possible (and easier) to review this commit-by-commit.
r? @alexcrichton
cc @rust-lang/infra

4 years agoadd comment
Esteban Küber [Sun, 27 Oct 2019 17:22:22 +0000 (10:22 -0700)]
add comment

4 years agoDo not display ADT type arguments and fix rebase
Esteban Küber [Thu, 24 Oct 2019 00:06:01 +0000 (17:06 -0700)]
Do not display ADT type arguments and fix rebase

4 years agoAccount for tuples in explanation
Esteban Küber [Sun, 13 Oct 2019 18:35:21 +0000 (11:35 -0700)]
Account for tuples in explanation

4 years agoTalk about specific types and remove lifetimes from output
Esteban Küber [Sun, 13 Oct 2019 18:25:30 +0000 (11:25 -0700)]
Talk about specific types and remove lifetimes from output

4 years agoFurther tweak spans for better readability
Esteban Küber [Sat, 12 Oct 2019 21:44:16 +0000 (14:44 -0700)]
Further tweak spans for better readability

4 years agoUse more targeted spans for orphan rule errors
Esteban Küber [Sat, 12 Oct 2019 21:31:23 +0000 (14:31 -0700)]
Use more targeted spans for orphan rule errors

4 years agoCall out the types that are non local on E0117
Esteban Küber [Fri, 11 Oct 2019 19:37:48 +0000 (12:37 -0700)]
Call out the types that are non local on E0117

4 years agoIgnore issue-64153 run-make test on Windows since supporting a Windows version is...
Michael Woerister [Mon, 28 Oct 2019 16:07:18 +0000 (17:07 +0100)]
Ignore issue-64153 run-make test on Windows since supporting a Windows version is not worth the trouble.

4 years agoci: fix wrong path for wix being set
Pietro Albini [Mon, 28 Oct 2019 14:09:18 +0000 (15:09 +0100)]
ci: fix wrong path for wix being set

4 years agoadd basic HermitCore support within libtest
Stefan Lankes [Mon, 28 Oct 2019 13:54:24 +0000 (09:54 -0400)]
add basic HermitCore support within libtest

4 years agoAuto merge of #65421 - estebank:variants, r=petrochenkov
bors [Mon, 28 Oct 2019 13:41:13 +0000 (13:41 +0000)]
Auto merge of #65421 - estebank:variants, r=petrochenkov

Point at local similarly named element and tweak references to variants

Partially address #65386.

4 years agoself-profiling: Record something more useful for crate metadata generation event.
Michael Woerister [Mon, 28 Oct 2019 09:57:54 +0000 (10:57 +0100)]
self-profiling: Record something more useful for crate metadata generation event.

Before this commit, we had an event that would only track the compression step
for proc-macros and Rust dylibs. After the commit we measure the time for
acutally generating the crate metadata bytes.

4 years agofix tidy
Quentin Boyer [Mon, 28 Oct 2019 10:22:26 +0000 (11:22 +0100)]
fix tidy

4 years agorustc: use IndexVec<DefIndex, T> instead of Vec<T>.
Eduard-Mihai Burtescu [Fri, 25 Oct 2019 17:30:11 +0000 (20:30 +0300)]
rustc: use IndexVec<DefIndex, T> instead of Vec<T>.

4 years agoci: fix execution condition for install-clang
Pietro Albini [Mon, 28 Oct 2019 09:03:55 +0000 (10:03 +0100)]
ci: fix execution condition for install-clang

4 years agoAuto merge of #65188 - matthewjasper:stabilize-const-constructor, r=Centril
bors [Mon, 28 Oct 2019 07:38:49 +0000 (07:38 +0000)]
Auto merge of #65188 - matthewjasper:stabilize-const-constructor, r=Centril

Stabilize `const_constructor`

# Stabilization proposal

I propose that we stabilize `#![feature(const_constructor)]`.

Tracking issue: https://github.com/rust-lang/rust/issues/61456
Version target: 1.40 (2019-11-05 => beta, 2019-12-19 => stable).

## What is stabilized

### User guide

Tuple struct and tuple variant constructors are now considered to be constant functions. As such a call expression where the callee has a tuple struct or variant constructor "function item" type can be called:

```rust
const fn make_options() {
    // These already work because they are special cased:
    Some(0);
    (Option::Some)(1);
    // These also work now:
    let f = Option::Some;
    f(2);
    {Option::Some}(3);
    <Option<_>>::Some(5);
}
```

### Motivation

Consistency with other `const fn`. Consistency between syntactic path forms.

This should also ensure that constructors implement `const Fn` traits and can be coerced to `const fn` function pointers, if they are introduced.

## Tests

* [ui/consts/const_constructor/const-construct-call.rs](https://github.com/rust-lang/rust/blob/0d75ab2293a106eb674ac01860910cfc1580837e/src/test/ui/consts/const_constructor/const-construct-call.rs) - Tests various syntactic forms, use in both `const fn` and `const` items, and constructors in both the current and extern crates.
* [ui/consts/const_constructor/const_constructor_qpath.rs](https://github.com/rust-lang/rust/blob/1850dfcdabf8258a1f023f26c2c59e96b869dd95/src/test/ui/consts/const_constructor/const_constructor_qpath.rs) - Tests that type qualified paths to enum variants are also considered to be `const fn`.(#64247)

r? @oli-obk

Closes #61456
Closes  #64247

4 years agodoc: mention `get(_mut)` in Vec
Lzu Tao [Mon, 28 Oct 2019 05:39:37 +0000 (05:39 +0000)]
doc: mention `get(_mut)` in Vec

4 years agoAuto merge of #65885 - Centril:rollup-y6b2qbf, r=Centril
bors [Mon, 28 Oct 2019 04:21:44 +0000 (04:21 +0000)]
Auto merge of #65885 - Centril:rollup-y6b2qbf, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #64747 (Stabilize `Option::flatten`)
 - #65664 (`std::panic::Location` is a lang_item, add `core::intrinsics::caller_location` (RFC 2091 3/N))
 - #65792 (rustc, rustc_passes: reduce deps on rustc_expand)
 - #65849 (librustc_lexer: Enhance documentation)
 - #65873 (doc: explain why it is unsafe to construct Vec<u8> from Vec<u16>)
 - #65880 (Gather together usefulness tests)

Failed merges:

r? @ghost

4 years agoRollup merge of #65880 - Nadrieril:gather-usefulness-tests, r=varkor
Mazdak Farrokhzad [Mon, 28 Oct 2019 03:53:12 +0000 (04:53 +0100)]
Rollup merge of #65880 - Nadrieril:gather-usefulness-tests, r=varkor

Gather together usefulness tests

I took most tests that were testing only for match exhaustiveness, pattern refutability or match arm reachability, and put them in the same test folder. I found it helpful to have them all in the same place when working on the usefulness algorithm.

4 years agoRollup merge of #65873 - lzutao:doc-vec-from-raw-parts, r=rkruppe
Mazdak Farrokhzad [Mon, 28 Oct 2019 03:53:11 +0000 (04:53 +0100)]
Rollup merge of #65873 - lzutao:doc-vec-from-raw-parts, r=rkruppe

doc: explain why it is unsafe to construct Vec<u8> from Vec<u16>

4 years agoRollup merge of #65849 - popzxc:document-librustc_lexer, r=petrochenkov
Mazdak Farrokhzad [Mon, 28 Oct 2019 03:53:09 +0000 (04:53 +0100)]
Rollup merge of #65849 - popzxc:document-librustc_lexer, r=petrochenkov

librustc_lexer: Enhance documentation

This PR enhances documentation state of the `librustc_lexer` (as initiative caused by [rustc-guide#474](https://github.com/rust-lang/rustc-guide/issues/474)), by adding:

- Module documentation.
- Doc-comments (and a bit of usual comments) in non-obvious (as for me) places.

r? @petrochenkov

cc @Centril

4 years agoRollup merge of #65792 - Centril:split-syntax-2, r=petrochenkov
Mazdak Farrokhzad [Mon, 28 Oct 2019 03:53:07 +0000 (04:53 +0100)]
Rollup merge of #65792 - Centril:split-syntax-2, r=petrochenkov

rustc, rustc_passes: reduce deps on rustc_expand

Part of #65324.

r? @petrochenkov

4 years agoRollup merge of #65664 - anp:panic-location, r=eddyb
Mazdak Farrokhzad [Mon, 28 Oct 2019 03:53:06 +0000 (04:53 +0100)]
Rollup merge of #65664 - anp:panic-location, r=eddyb

`std::panic::Location` is a lang_item, add `core::intrinsics::caller_location` (RFC 2091 3/N)

[Tracking issue](https://github.com/rust-lang/rust/issues/47809)
[RFC text](https://github.com/rust-lang/rfcs/blob/master/text/2091-inline-semantic.md)

@eddyb suggested doing this intrinsic implementation ahead of actually implementing the `#[track_caller]` attribute so that there's an easily tested intermediate step between adding the shim and wiring up the attribute.

4 years agoRollup merge of #64747 - ethanboxx:master, r=Centril
Mazdak Farrokhzad [Mon, 28 Oct 2019 03:53:05 +0000 (04:53 +0100)]
Rollup merge of #64747 - ethanboxx:master, r=Centril

Stabilize `Option::flatten`

- PR: https://github.com/rust-lang/rust/pull/60256
- Tracking issue: https://github.com/rust-lang/rust/issues/60258

@elahn

> I was trying to `flat_map()` and found `map().flatten()` does the trick. This has been on nightly for 4 months, can we stabilise it?

@ethanboxx

> @Centril Helped me get this merged. What is the stabilization process?

@Centril

> @ethanboxx I'd just file a PR to stabilize it and we'll ask T-libs to FCP.

So here I am.

I am was unsure what number to put in `since = "-"` so I copied what someone had done in a recent PR.

4 years agodoc: introduce `once` in `iter::chain` document
Lzu Tao [Mon, 28 Oct 2019 03:22:59 +0000 (03:22 +0000)]
doc: introduce `once` in `iter::chain` document

4 years agochanging non-empty glob must import something to a lint
Quentin Boyer [Sun, 27 Oct 2019 23:57:25 +0000 (00:57 +0100)]
changing non-empty glob must import something to a lint

4 years agoStabilize `const_constructor`
Matthew Jasper [Mon, 7 Oct 2019 20:08:39 +0000 (21:08 +0100)]
Stabilize `const_constructor`

4 years agoGather together usefulness tests
Nadrieril [Sat, 28 Sep 2019 14:05:38 +0000 (16:05 +0200)]
Gather together usefulness tests

I took most tests that were testing only for match exhaustiveness,
pattern refutability or match arm reachability, and put them in
the same test folder.

4 years agoAlways use consteval to codegen caller_location.
Adam Perry [Fri, 25 Oct 2019 00:35:02 +0000 (17:35 -0700)]
Always use consteval to codegen caller_location.

4 years agoImplementation of const caller_location.
Adam Perry [Thu, 24 Oct 2019 15:03:57 +0000 (08:03 -0700)]
Implementation of const caller_location.

4 years agoPanicking infra uses &core::panic::Location.
Adam Perry [Thu, 24 Oct 2019 02:30:21 +0000 (19:30 -0700)]
Panicking infra uses &core::panic::Location.

This allows us to remove `static_panic_msg` from the SSA<->LLVM
boundary, along with its fat pointer representation for &str.

Also changes the signature of PanicInfo::internal_contructor to
avoid copying.

Closes #65856.

4 years agoImplement core::intrinsics::caller_location.
Adam Perry [Wed, 9 Oct 2019 15:25:41 +0000 (08:25 -0700)]
Implement core::intrinsics::caller_location.

Returns a `&core::panic::Location` corresponding to where it was
called, also making `Location` a lang item.

4 years agoPoint at local similarly named element and tweak references to variants
Esteban Küber [Tue, 15 Oct 2019 00:20:50 +0000 (17:20 -0700)]
Point at local similarly named element and tweak references to variants

Point at the span for the definition of ADTs internal to the current
crate.

Look at the leading char of the ident to determine whether we're
expecting a likely fn or any of a fn, a tuple struct or a tuple variant.

Turn fn `add_typo_suggestion` into a `Resolver` method.

4 years agodoc: explain why it is unsafe to construct Vec<u8> from Vec<u16>
Lzu Tao [Sun, 27 Oct 2019 17:31:01 +0000 (17:31 +0000)]
doc: explain why it is unsafe to construct Vec<u8> from Vec<u16>

Co-authored-by: Steve Klabnik <steve@steveklabnik.com>
4 years agolibrustc_lexer: Enhance documentation
Igor Aleksanov [Sat, 26 Oct 2019 16:12:58 +0000 (19:12 +0300)]
librustc_lexer: Enhance documentation

Apply review suggestions

Apply review suggestions

4 years agoAuto merge of #65869 - Centril:rollup-bzlo74f, r=Centril
bors [Sun, 27 Oct 2019 16:15:40 +0000 (16:15 +0000)]
Auto merge of #65869 - Centril:rollup-bzlo74f, r=Centril

Rollup of 6 pull requests

Successful merges:

 - #65566 (Use heuristics to suggest assignment)
 - #65738 (Coherence should allow fundamental types to impl traits when they are local)
 - #65777 (Don't ICE for completely unexpandable `impl Trait` types)
 - #65834 (Remove lint callback from driver)
 - #65839 (Clean up `check_consts` now that new promotion pass is implemented)
 - #65855 (Add long error explaination for E0666)

Failed merges:

r? @ghost

4 years agorustc, rustc_passes: don't depend on syntax_expand.
Mazdak Farrokhzad [Wed, 9 Oct 2019 14:47:38 +0000 (16:47 +0200)]
rustc, rustc_passes: don't depend on syntax_expand.

This is done by moving some data definitions to syntax::expand.

4 years agosyntax/attr: reduce reliance on parser
Mazdak Farrokhzad [Wed, 9 Oct 2019 11:19:15 +0000 (13:19 +0200)]
syntax/attr: reduce reliance on parser

4 years agoRollup merge of #65855 - ObsidianMinor:extended_error/E0666, r=varkor
Mazdak Farrokhzad [Sun, 27 Oct 2019 15:46:58 +0000 (16:46 +0100)]
Rollup merge of #65855 - ObsidianMinor:extended_error/E0666, r=varkor

Add long error explaination for E0666

In the spirit of the month of spooks, here's a long explanation for E0666 for #61137.

4 years agoRollup merge of #65839 - ecstatic-morse:promo-sanity-fixes, r=eddyb
Mazdak Farrokhzad [Sun, 27 Oct 2019 15:46:56 +0000 (16:46 +0100)]
Rollup merge of #65839 - ecstatic-morse:promo-sanity-fixes, r=eddyb

Clean up `check_consts` now that new promotion pass is implemented

`check_consts::resolver` contained a layer of abstraction (`QualifResolver`) to allow the existing, eager style of qualif propagation to work with either a dataflow results cursor or by applying the transfer function directly (if dataflow was not needed e.g. for promotion). However, #63812 uses a different, lazy paradigm for checking promotability, which makes this unnecessary. This PR cleans up `check_consts::validation` to use `FlowSensitiveResolver` directly, instead of through the now obselete `QualifResolver` API.

Also, this contains a few commits (the first four) that address some FIXMEs in #63812 regarding code duplication. They could be split out, but I think they will be relatively noncontroversial? Notably, `validation::Mode` is renamed to `ConstKind` and used in `promote_consts` to denote what kind of item we are in.

This is best reviewed commit-by-commit and is low priority.

r? @eddyb

4 years agoRollup merge of #65834 - Mark-Simulacrum:driver-clean, r=nikomatsakis
Mazdak Farrokhzad [Sun, 27 Oct 2019 15:46:55 +0000 (16:46 +0100)]
Rollup merge of #65834 - Mark-Simulacrum:driver-clean, r=nikomatsakis

Remove lint callback from driver

This is leftover from a restructuring of lint registration for drivers; it should now happen via the register_lints field on Config rather than this function.

This is not used by anyone to my knowledge (including the compiler itself); it was introduced in an abandoned refactor in #65193.

4 years agoRollup merge of #65777 - matthewjasper:allow-impl-trait-expansion, r=davidtwco
Mazdak Farrokhzad [Sun, 27 Oct 2019 15:46:54 +0000 (16:46 +0100)]
Rollup merge of #65777 - matthewjasper:allow-impl-trait-expansion, r=davidtwco

Don't ICE for completely unexpandable `impl Trait` types

Save the resolution of these types (to themselves) to the typeck tables so that they will eventually reach E0720.

closes #65561

4 years agoRollup merge of #65738 - ohadravid:re-rebalance-coherence-allow-fundamental-local...
Mazdak Farrokhzad [Sun, 27 Oct 2019 15:46:52 +0000 (16:46 +0100)]
Rollup merge of #65738 - ohadravid:re-rebalance-coherence-allow-fundamental-local, r=nikomatsakis

Coherence should allow fundamental types to impl traits when they are local

After #64414, `impl<T> Remote for Box<T> { }` is disallowed, but it is also disallowed in liballoc, where `Box` is a local type!

Enabling `#![feature(re_rebalance_coherence)]` in `liballoc` results in:
```
error[E0210]: type parameter `F` must be used as the type parameter for some local type (e.g., `MyStruct<F>`)
    --> src\liballoc\boxed.rs:1098:1
     |
1098 | impl<F: ?Sized + Future + Unpin> Future for Box<F> {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `F` must be used as the type parameter for some local type
```

This PR relaxes `uncover_fundamental_ty` to skip local fundamental types.
I didn't add a test since `liballoc` already fails to compile, but I can add one if needed.

r? @nikomatsakis

cc #63599

4 years agoRollup merge of #65566 - estebank:let-expr-as-ty, r=Centril
Mazdak Farrokhzad [Sun, 27 Oct 2019 15:46:51 +0000 (16:46 +0100)]
Rollup merge of #65566 - estebank:let-expr-as-ty, r=Centril

Use heuristics to suggest assignment

When detecting a possible `=` -> `:` typo in a `let` binding, suggest
assigning instead of setting the type.

Partially address #57828.

4 years agoAuto merge of #65541 - eddyb:spanned-inferred-outlives, r=nikomatsakis
bors [Sun, 27 Oct 2019 12:58:10 +0000 (12:58 +0000)]
Auto merge of #65541 - eddyb:spanned-inferred-outlives, r=nikomatsakis

rustc: add `Span`s to `inferred_outlives_of` predicates.

This would simplify #59789, and I suspect it has some potential in diagnostics (although we don't seem to use the predicate `Span`s much atm).