]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRollup merge of #65955 - pietroalbini:master-revert-msys2-hack, r=Mark-Simulacrum
Mazdak Farrokhzad [Thu, 31 Oct 2019 01:54:08 +0000 (02:54 +0100)]
Rollup merge of #65955 - pietroalbini:master-revert-msys2-hack, r=Mark-Simulacrum

ci: revert msys2 ca-certificates hack

The hack was added because upstream msys2 broke the ca-certificates package, but since then it has been fixed. This reverts CI to use the upstream package.

Part of #65767

4 years agoRollup merge of #65850 - mikeyhew:patch-1, r=nikomatsakis
Mazdak Farrokhzad [Thu, 31 Oct 2019 01:54:07 +0000 (02:54 +0100)]
Rollup merge of #65850 - mikeyhew:patch-1, r=nikomatsakis

Update comments re type parameter hack in object safety

To check if a method's receiver type is object safe, we create a new receiver type by substituting in a bogus type parameter (let's call it `U`) for `Self`, and checking that the unmodified receiver type implements `DispatchFromDyn<receiver type with Self = U>`. It would be better to use `dyn Trait` directly, and the only reason we don't is because it triggers another check that `Trait` is object safe, resulting in a query cycle. Once the feature `object_safe_for_dispatch` (tracking issue https://github.com/rust-lang/rust/issues/43561) is stabilized, this will no longer be the case, and we'll be able to use `dyn Trait` as the unsized `Self` type. I've updated the comments in object_safety.rs accordingly.

cc @Centril @nikomatsakis @bovinebuddha

4 years agoRollup merge of #65434 - GuillaumeGomez:long-err-explanation-E0577, r=Dylan-DPC
Mazdak Farrokhzad [Thu, 31 Oct 2019 01:54:05 +0000 (02:54 +0100)]
Rollup merge of #65434 - GuillaumeGomez:long-err-explanation-E0577, r=Dylan-DPC

Add long error explanation for E0577

Part of #61137.

r? @kinnison

4 years agoRollup merge of #65274 - pietroalbini:ci-upload-toolstate, r=alexcrichton
Mazdak Farrokhzad [Thu, 31 Oct 2019 01:54:04 +0000 (02:54 +0100)]
Rollup merge of #65274 - pietroalbini:ci-upload-toolstate, r=alexcrichton

Upload toolstates.json to rust-lang-ci2

This PR does two things:

* Following up with https://github.com/rust-lang/rust/pull/65202, it migrates deploying artifacts to CI in a script. Both uploading release artifacts and CPU stats were merged into the same script, designing it to be easily extended.
* Uploads the toolstate JSON to `rust-lang-ci2` along with the release artifacts, both for Linux and Windows. This is needed because @RalfJung wants to stop shipping MIRI when its tests are failing, and the toolstate repo doesn't have entries for each commit. Having the toolstate data (just for that specific commit) on `rust-lang-ci2` will simplify the code a lot.

r? @alexcrichton
cc @RalfJung

4 years agoci: move toolstates.json to /tmp/toolstate/ and docker mount it
Pietro Albini [Wed, 30 Oct 2019 18:41:22 +0000 (19:41 +0100)]
ci: move toolstates.json to /tmp/toolstate/ and docker mount it

Before this commit toolstates.json was stored in /tmp and it wasn't
mounted outside the build container. That caused uploading the file in
the upload-artifacts task to fail, as the file was missing on the host.

Mounting /tmp/toolstates.json alone is not the best approach: if the
file is missing when the container is started the Docker engine will
create a *directory* named /tmp/toolstates.json.

The Docker issue could be solved by pre-creating an empty file named
/tmp/toolstates.json, but doing that could cause problems if bootstrap
fails to generate the file and the toolstate scripts receive an empty
JSON.

The approach I took in this commit is to instead mount a /tmp/toolstate
directory inside Docker, and create the toolstates.json file in it. That
also required a small bootstrap change to ensure the directory is
created if it's missing.

4 years agoUpdate ui tests
Guillaume Gomez [Tue, 15 Oct 2019 11:52:57 +0000 (13:52 +0200)]
Update ui tests

4 years agoAdd long error explanation for E0577
Guillaume Gomez [Tue, 15 Oct 2019 11:52:49 +0000 (13:52 +0200)]
Add long error explanation for E0577

4 years agoAuto merge of #65941 - ehuss:update-cargo-books, r=alexcrichton
bors [Wed, 30 Oct 2019 13:34:57 +0000 (13:34 +0000)]
Auto merge of #65941 - ehuss:update-cargo-books, r=alexcrichton

Update cargo, books.

## cargo

8 commits in 3ba5f27170db10af7a92f2b682e049397197b8fa..5da4b4d47963868d9878480197581ccbbdaece74
2019-10-22 15:05:18 +0000 to 2019-10-28 21:53:41 +0000
- Add --filter-platform to `cargo metadata`. (rust-lang/cargo#7376)
- Fix `cargo fix` not showing colors. (rust-lang/cargo#7550)
- Rephrase --manifest-path section (rust-lang/cargo#7409)
- Add a note to discourage the use of -Zminimal-versions. (rust-lang/cargo#7549)
- Fix profile override warning in a workspace. (rust-lang/cargo#7536)
- Fix some tests failing on Windows nightly. (rust-lang/cargo#7534)
- Show better error message for Windows abnormal termination. (rust-lang/cargo#7535)
- Run `apt update` before `apt install` (rust-lang/cargo#7541)

## reference

8 commits in 5b9d2fcefadfc32fceafacfc0dd9441d9b57dd94..4b21b646669e0af49fae7cae301898dc4bfaa1f0
2019-10-03 22:39:10 +0200 to 2019-10-27 22:33:11 +0100
- Document `const_constructor` feature (rust-lang-nursery/reference#677)
- Add `non_exhaustive` to reference. (rust-lang-nursery/reference#609)
- Re-add rust-docs component for lintcheck (rust-lang-nursery/reference#702)
- group signed and unsigned integers in layout table (rust-lang-nursery/reference#700)
- Fix layout table rendering (rust-lang-nursery/reference#699)
- Add reference for attributes in function parameters (rust-lang-nursery/reference#657)
- Update now that proc macros can expand to macro_rules. (rust-lang-nursery/reference#694)
- Fix match in union example. (rust-lang-nursery/reference#684)

## book

8 commits in 9bb8b161963fcebc9d9ccd732ba26f42108016d5..28fa3d15b0bc67ea5e79eeff2198e4277fc61baf
2019-10-14 18:42:55 -0500 to 2019-10-29 07:16:09 -0500
- Update Ch19.1 on slice splitting (rust-lang/book#1999)
- fixed inconsistent terminology regarding enums (rust-lang/book#2022)
- Update ch15-03 code to match output. (rust-lang/book#2020)
- Fixes rust-lang/book#2039 (rust-lang/book#2040)
- Update ch15-03-drop.md (rust-lang/book#2049)
- unit type value is also a value (rust-lang/book#2061)
- Minor: remove an extraneous `.` (rust-lang/book#2059)
- Clarifications and consistent use of quotation marks (rust-lang/book#1992)

## rust-by-example

4 commits in 0b111eaae36cc4b4997684be853882a59e2c7ca7..f3197ddf2abab9abdbc029def8164f4a748b0d91
2019-10-14 18:34:25 -0300 to 2019-10-29 10:17:40 -0300
- Fix typos (rust-lang/rust-by-example#1285)
- Improve Cargo / Dependencies section (rust-lang/rust-by-example#1287)
- Improve Cargo / Build Scripts section (rust-lang/rust-by-example#1288)
- Make if_let exercise runnable (rust-lang/rust-by-example#1289)

4 years agoci: revert msys2 ca-certificates hack
Pietro Albini [Wed, 30 Oct 2019 08:13:26 +0000 (09:13 +0100)]
ci: revert msys2 ca-certificates hack

The hack was added because upstream msys2 broke the ca-certificates
package, but since then it has been fixed. This reverts CI to use the
upstream package.

4 years agoAuto merge of #65068 - estebank:trait-impl-lt-mismatch, r=nikomatsakis
bors [Wed, 30 Oct 2019 02:20:55 +0000 (02:20 +0000)]
Auto merge of #65068 - estebank:trait-impl-lt-mismatch, r=nikomatsakis

Custom lifetime error for `impl` item doesn't conform to `trait`

Partly addresses #42706, #41343, fix #40900.

4 years agoAuto merge of #65943 - tmandry:rollup-g20uvkh, r=tmandry
bors [Tue, 29 Oct 2019 19:12:01 +0000 (19:12 +0000)]
Auto merge of #65943 - tmandry:rollup-g20uvkh, r=tmandry

Rollup of 12 pull requests

Successful merges:

 - #65405 (Create new error E0742 and add long error explanation)
 - #65539 (resolve: Turn the "non-empty glob must import something" error into a lint)
 - #65724 (ci: refactor pr tools job skipping)
 - #65741 (Prevent help popup to disappear when clicking on it)
 - #65832 (Re-enable Emscripten's exception handling support)
 - #65843 (Enable dist for MIPS64 musl targets)
 - #65898 (add basic HermitCore support within libtest)
 - #65900 (proc_macro: clean up bridge::client::__run_expand{1,2} a bit.)
 - #65906 (Update mdbook to 0.3.3)
 - #65920 (Use rustc-workspace-hack for rustbook)
 - #65930 (doc: use new feature gate for c_void type)
 - #65936 (save-analysis: Account for async desugaring in async fn return types)

Failed merges:

 - #65434 (Add long error explanation for E0577)

r? @ghost

4 years agoRollup merge of #65936 - Xanewok:save-analysis-async, r=nikomatsakis
Tyler Mandry [Tue, 29 Oct 2019 19:01:49 +0000 (12:01 -0700)]
Rollup merge of #65936 - Xanewok:save-analysis-async, r=nikomatsakis

save-analysis: Account for async desugaring in async fn return types

Closes #65590

When visiting the return type of an async function we need to take into account its desugaring, since it introduces a new definition under which the return type is redefined.

r? @nikomatsakis

4 years agoRollup merge of #65930 - lzutao:new-feature-gate-c_void, r=dtolnay
Tyler Mandry [Tue, 29 Oct 2019 19:01:47 +0000 (12:01 -0700)]
Rollup merge of #65930 - lzutao:new-feature-gate-c_void, r=dtolnay

doc: use new feature gate for c_void type

Closes #63694, closes #55619

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 agoUpdate cargo, books.
Eric Huss [Tue, 29 Oct 2019 17:45:55 +0000 (10:45 -0700)]
Update cargo, books.

4 years agoSilence crate external span error in x86 platforms
Esteban Küber [Tue, 29 Oct 2019 17:19:40 +0000 (10:19 -0700)]
Silence crate external span error in x86 platforms

This causes issues in at least `dist-i586-gnu-i586-i686-musl`,
possibly others.

4 years agoFix NLL test
Esteban Küber [Tue, 15 Oct 2019 17:57:52 +0000 (10:57 -0700)]
Fix NLL test

4 years agoMake error apply only to impl/trait mismatch
Esteban Küber [Tue, 15 Oct 2019 17:47:48 +0000 (10:47 -0700)]
Make error apply only to impl/trait mismatch

4 years agoPoint at the trait item and tweak wording
Esteban Küber [Tue, 15 Oct 2019 17:36:26 +0000 (10:36 -0700)]
Point at the trait item and tweak wording

4 years agoreview comments
Esteban Küber [Fri, 4 Oct 2019 03:14:48 +0000 (20:14 -0700)]
review comments

4 years agoCustom lifetime error for `impl` item doesn't conform to `trait`
Esteban Küber [Thu, 3 Oct 2019 18:41:27 +0000 (11:41 -0700)]
Custom lifetime error for `impl` item doesn't conform to `trait`

4 years agoAuto merge of #65904 - matthiaskrgr:submodule_upd, r=Manishearth
bors [Tue, 29 Oct 2019 15:57:10 +0000 (15:57 +0000)]
Auto merge of #65904 - matthiaskrgr:submodule_upd, r=Manishearth

submodules: update clippy from 66df92ae to c8e3cfbd

Changes:
````
travis: temporarily disable rustfmt ci check until #4742 is resolved
rustup https://github.com/rust-lang/rust/pull/65792/
Fix ICE #4579
Add regression test for ICE #4579
Run update_lints for Unicode lint
Re-add false positive check
Add raw string regression test for useless_format lint
Re-factor useless_format lint
Update Unicode lint tests
[Backported] Rustup to https://github.com/rust-lang/rust/pull/59545
````

Fixes #65888

r? @oli-obk @Manishearth

4 years agosave-analysis: Account for async desugaring in async fn return types
Igor Matuszewski [Tue, 29 Oct 2019 15:19:16 +0000 (16:19 +0100)]
save-analysis: Account for async desugaring in async fn return types

4 years agodoc: use new feature gate for c_void type
Lzu Tao [Tue, 29 Oct 2019 13:01:54 +0000 (13:01 +0000)]
doc: use new feature gate for c_void type

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 agoApply suggestions from lzutao
Pietro Albini [Tue, 29 Oct 2019 09:14:42 +0000 (10:14 +0100)]
Apply suggestions from lzutao

Co-Authored-By: lzutao <taolzu@gmail.com>
4 years agoci: upload toolstates.json to rust-lang-ci2
Pietro Albini [Thu, 10 Oct 2019 15:32:50 +0000 (17:32 +0200)]
ci: upload toolstates.json to rust-lang-ci2

Uploading the toolstate data for each commit will help our release
tooling understand which components are failing, to possibly skip
shipping broken tools to users.

4 years agoci: extract uploading artifacts into a script
Pietro Albini [Thu, 10 Oct 2019 15:04:44 +0000 (17:04 +0200)]
ci: extract uploading artifacts into a script

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 agosubmodules: update clippy from 66df92ae to c8e3cfbd
Matthias Krüger [Mon, 28 Oct 2019 19:40:45 +0000 (20:40 +0100)]
submodules: update clippy from 66df92ae to c8e3cfbd

Changes:
````
travis: temporarily disable rustfmt ci check until #4742 is resolved
rustup https://github.com/rust-lang/rust/pull/65792/
Fix ICE #4579
Add regression test for ICE #4579
Run update_lints for Unicode lint
Re-add false positive check
Add raw string regression test for useless_format lint
Re-factor useless_format lint
Update Unicode lint tests
[Backported] Rustup to https://github.com/rust-lang/rust/pull/59545
````

Fixes ##65888

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