Commit Graph

101665 Commits

Author SHA1 Message Date
Tyler Mandry
d7f99dadd4 Update backtrace to 0.3.40 2019-10-28 16:27:07 -07:00
Quentin Boyer
ed8585ffb5 forgot to add the changed stderr 2019-10-29 00:20:28 +01:00
bors
cac6821810 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
2019-10-28 20:59:36 +00:00
Mazdak Farrokhzad
30431a33ea
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??
2019-10-28 21:36:08 +01:00
Mazdak Farrokhzad
545166435c
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
2019-10-28 21:36:07 +01:00
Mazdak Farrokhzad
cceefd3d98
Rollup merge of #65887 - lzutao:doc-vec-get, r=rkruppe
doc: mention `get(_mut)` in Vec
2019-10-28 21:36:06 +01:00
Mazdak Farrokhzad
23dbdb46ee
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
2019-10-28 21:36:04 +01:00
Mazdak Farrokhzad
d887232035
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)
2019-10-28 21:36:02 +01:00
Mazdak Farrokhzad
531240c626
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.
2019-10-28 21:36:01 +01:00
Mazdak Farrokhzad
216e50d904
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
2019-10-28 21:35:59 +01:00
Mazdak Farrokhzad
2fe6f22dea
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).
2019-10-28 21:35:58 +01:00
Mazdak Farrokhzad
eec3a9c4af
Rollup merge of #65563 - GuillaumeGomez:long-err-explanation-E0587, r=Dylan-DPC
Add long error explanation for E0587

Part of #61137.

r? @kinnison
2019-10-28 21:35:56 +01:00
Carol (Nichols || Goulding)
3bd16c291e
Update mdbook to 0.3.3 2019-10-28 16:21:53 -04:00
Agustin Fernandez
f1aa8b2c01 Output previous stable error messaging when using stable build. 2019-10-28 15:49:22 -04:00
Matthias Krüger
f9ac609a42 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
2019-10-28 20:42:06 +01:00
Thomas Lively
92c049be58 Revert "Temporarily enable asmjs and wasm32 CI on PRs"
This reverts commit 29d6aaae32.
2019-10-28 12:30:08 -07:00
David Wood
92b151287f
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>
2019-10-28 18:37:49 +00:00
Eduard-Mihai Burtescu
b58634454f proc_macro: don't use Rust ABI fn pointers in a C ABI fn signature. 2019-10-28 20:34:59 +02:00
Eduard-Mihai Burtescu
da5965f3a6 proc_macro: consolidate bridge::client::run_expand{1,2} into one helper. 2019-10-28 20:21:12 +02:00
Stefan Lankes
cf65200e5c removing trailing whitespaces 2019-10-28 14:03:53 -04:00
Eduard-Mihai Burtescu
b3f64946f9 proc_macro: remove now-unnecessary ICE workarounds from bridge::client. 2019-10-28 19:55:25 +02:00
Esteban Küber
e8016c2b13 review comments 2019-10-28 10:53:13 -07:00
Esteban Küber
1b0836df6f Tweak unexpected token wording 2019-10-28 10:53:13 -07:00
Esteban Küber
d673d0ac84 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.
2019-10-28 10:53:13 -07:00
Patryk Wychowaniec
5c023d68d8
Improve pretty-printing for compound qualified paths. 2019-10-28 18:44:08 +01:00
Patryk Wychowaniec
e188e2db84
Fix a previously forgotten pretty-printing test after a change to the pretty-printing mechanism. 2019-10-28 18:43:59 +01:00
Patryk Wychowaniec
273ee611f0
Improve the "try using a variant of the expected type" hint. 2019-10-28 18:43:51 +01:00
Esteban Küber
627691f138 Fix rebase 2019-10-28 10:43:17 -07:00
bors
b497e18995 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
2019-10-28 17:17:30 +00:00
Esteban Küber
2cd28c15ee add comment 2019-10-28 09:57:36 -07:00
Esteban Küber
95364df6bc Do not display ADT type arguments and fix rebase 2019-10-28 09:57:36 -07:00
Esteban Küber
db1bfbdbc0 Account for tuples in explanation 2019-10-28 09:57:36 -07:00
Esteban Küber
daeafd895d Talk about specific types and remove lifetimes from output 2019-10-28 09:57:36 -07:00
Esteban Küber
56aa89cdbe Further tweak spans for better readability 2019-10-28 09:57:36 -07:00
Esteban Küber
9b4f811b7f Use more targeted spans for orphan rule errors 2019-10-28 09:57:36 -07:00
Esteban Küber
adfe9a45d6 Call out the types that are non local on E0117 2019-10-28 09:56:53 -07:00
Michael Woerister
a63dfb3b82 Ignore issue-64153 run-make test on Windows since supporting a Windows version is not worth the trouble. 2019-10-28 17:07:25 +01:00
Pietro Albini
7e051236b0
ci: fix wrong path for wix being set 2019-10-28 15:09:18 +01:00
Stefan Lankes
7cecfab386 add basic HermitCore support within libtest 2019-10-28 09:54:24 -04:00
bors
8d78bf6b27 Auto merge of #65421 - estebank:variants, r=petrochenkov
Point at local similarly named element and tweak references to variants

Partially address #65386.
2019-10-28 13:41:13 +00:00
Michael Woerister
46a39a2d42 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.
2019-10-28 13:55:13 +01:00
Quentin Boyer
652b1bd45d fix tidy 2019-10-28 11:22:26 +01:00
Eduard-Mihai Burtescu
cc575a6ad5 rustc: use IndexVec<DefIndex, T> instead of Vec<T>. 2019-10-28 11:38:36 +02:00
Pietro Albini
c854c4482b
ci: fix execution condition for install-clang 2019-10-28 10:04:26 +01:00
bors
03a50ae9b8 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](0d75ab2293/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](1850dfcdab/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
2019-10-28 07:38:49 +00:00
Lzu Tao
e2c450b8da doc: mention get(_mut) in Vec 2019-10-28 05:39:37 +00:00
bors
9285d401a6 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
2019-10-28 04:21:44 +00:00
Mazdak Farrokhzad
606743e8c7
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.
2019-10-28 04:53:12 +01:00
Mazdak Farrokhzad
75a127c48b
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>
2019-10-28 04:53:11 +01:00
Mazdak Farrokhzad
575058f3d7
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
2019-10-28 04:53:09 +01:00