]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoMove syntax_expand::config to rustc_parse::config
Mark Rousskov [Wed, 20 Nov 2019 02:35:11 +0000 (21:35 -0500)]
Move syntax_expand::config to rustc_parse::config

4 years agoAuto merge of #66454 - cjgillot:lift, r=Zoxc
bors [Tue, 19 Nov 2019 15:24:09 +0000 (15:24 +0000)]
Auto merge of #66454 - cjgillot:lift, r=Zoxc

Derive Lift using a proc-macro

Based on #66384

r? @Zoxc

4 years agoAuto merge of #66545 - Centril:rollup-xv2rx7v, r=Centril
bors [Tue, 19 Nov 2019 12:11:09 +0000 (12:11 +0000)]
Auto merge of #66545 - Centril:rollup-xv2rx7v, r=Centril

Rollup of 11 pull requests

Successful merges:

 - #66090 (Misc CI improvements)
 - #66155 (Add long error explanation for E0594)
 - #66239 (Suggest calling async closure when needed)
 - #66430 ([doc] Fix the source code highlighting on source comments)
 - #66431 (Fix 'type annotations needed' error with opaque types)
 - #66461 (Add explanation message for E0641)
 - #66493 (Add JohnTitor to rustc-guide toolstate notification list)
 - #66511 (std::error::Chain: remove Copy)
 - #66529 (resolve: Give derive helpers highest priority during resolution)
 - #66536 (Move the definition of `QueryResult` into `plumbing.rs`.)
 - #66538 (Remove compiler_builtins_lib feature from libstd)

Failed merges:

r? @ghost

4 years agoRollup merge of #66538 - dingelish:master, r=Centril
Mazdak Farrokhzad [Tue, 19 Nov 2019 12:10:26 +0000 (13:10 +0100)]
Rollup merge of #66538 - dingelish:master, r=Centril

Remove compiler_builtins_lib feature from libstd

Test if we can close #66368 by this patch.

4 years agoRollup merge of #66536 - nnethercote:mv-QueryResult, r=Centril
Mazdak Farrokhzad [Tue, 19 Nov 2019 12:10:24 +0000 (13:10 +0100)]
Rollup merge of #66536 - nnethercote:mv-QueryResult, r=Centril

Move the definition of `QueryResult` into `plumbing.rs`.

Because it's the only file that uses it, and removes the need for importing it.

r? @Centril

4 years agoRollup merge of #66529 - petrochenkov:reshelp2, r=davidtwco
Mazdak Farrokhzad [Tue, 19 Nov 2019 12:10:23 +0000 (13:10 +0100)]
Rollup merge of #66529 - petrochenkov:reshelp2, r=davidtwco

resolve: Give derive helpers highest priority during resolution

So they just shadow everything else and don't create ambiguity errors.
This matches the old pre-#64694 behavior most closely.

---
The change doesn't apply to this "compatibility" case
```rust
#[trait_helper] // The helper attribute is used before it introduced.
                        // Sadly, compiles on stable, supported via hacks.
                        // I plan to make a compatibility warning for this.
#[derive(Trait)]
struct S;
```
, such attributes still create ambiguities, but #64694 didn't change anything for this case.

Fixes https://github.com/rust-lang/rust/issues/66508
Fixes https://github.com/rust-lang/rust/issues/66525

4 years agoRollup merge of #66511 - haraldh:error_chain_nocopy, r=dtolnay
Mazdak Farrokhzad [Tue, 19 Nov 2019 12:10:22 +0000 (13:10 +0100)]
Rollup merge of #66511 - haraldh:error_chain_nocopy, r=dtolnay

std::error::Chain: remove Copy

remove Copy from Iterator as per comment
https://github.com/rust-lang/rust/issues/58520#issuecomment-553682166

Tracker: #58520

4 years agoRollup merge of #66493 - JohnTitor:ping-me-rustc-guide, r=spastorino
Mazdak Farrokhzad [Tue, 19 Nov 2019 12:10:20 +0000 (13:10 +0100)]
Rollup merge of #66493 - JohnTitor:ping-me-rustc-guide, r=spastorino

Add JohnTitor to rustc-guide toolstate notification list

Add JohnTitor to rustc-guide toolstate notification list
Also, update org names of some books

r? @spastorino

4 years agoRollup merge of #66461 - clemencetbk:master, r=GuillaumeGomez
Mazdak Farrokhzad [Tue, 19 Nov 2019 12:10:19 +0000 (13:10 +0100)]
Rollup merge of #66461 - clemencetbk:master, r=GuillaumeGomez

Add explanation message for E0641

Part of #61137

4 years agoRollup merge of #66431 - Aaron1011:fix/opaque-type-infer, r=varkor
Mazdak Farrokhzad [Tue, 19 Nov 2019 12:10:17 +0000 (13:10 +0100)]
Rollup merge of #66431 - Aaron1011:fix/opaque-type-infer, r=varkor

Fix 'type annotations needed' error with opaque types

Related: #66426

This commit adds handling for opaque types during inference variable
fallback. Type variables generated from the instantiation of opaque
types now fallback to the opaque type itself.

Normally, the type variable for an instantiated opaque type is either
unified with the concrete type, or with the opaque type itself (e.g when
a function returns an opaque type by calling another function).

However, it's possible for the type variable to be left completely
unconstrained. This can occur in code like this:

```rust
pub type Foo = impl Copy;
fn produce() -> Option<Foo> {
    None
}
```

Here, we'll instantatiate the `Foo` in `Option<Foo>` to a fresh type
variable, but we will never unify it with anything due to the fact
that we return a `None`.

This results in the error message:
```
type annotations needed: cannot resolve `_: std::marker::Copy
```

pointing at `pub type Foo = impl Copy`.

This message is not only confusing, it's incorrect. When an opaque type
inference variable is completely unconstrained, we can always fall back
to using the opaque type itself. This effectively turns that particular
use of the opaque type into a non-defining use, even if it appears in a
defining scope.

4 years agoRollup merge of #66430 - dns2utf8:fix_code_selection_click_handler, r=GuillaumeGomez
Mazdak Farrokhzad [Tue, 19 Nov 2019 12:10:15 +0000 (13:10 +0100)]
Rollup merge of #66430 - dns2utf8:fix_code_selection_click_handler, r=GuillaumeGomez

[doc] Fix the source code highlighting on source comments

The code would always forget the previous selection.

r? @GuillaumeGomez

4 years agoRollup merge of #66239 - estebank:suggest-async-closure-call, r=Centril
Mazdak Farrokhzad [Tue, 19 Nov 2019 12:10:14 +0000 (13:10 +0100)]
Rollup merge of #66239 - estebank:suggest-async-closure-call, r=Centril

Suggest calling async closure when needed

When using an async closure as a value in a place that expects a future,
suggest calling the closure.

Fix #65923.

4 years agoRollup merge of #66155 - GuillaumeGomez:long-err-explanation-E0594, r=Dylan-DPC
Mazdak Farrokhzad [Tue, 19 Nov 2019 12:10:12 +0000 (13:10 +0100)]
Rollup merge of #66155 - GuillaumeGomez:long-err-explanation-E0594, r=Dylan-DPC

Add long error explanation for E0594

Part of #61137.

r? @Dylan-DPC

4 years agoRollup merge of #66090 - pietroalbini:ci-improvements, r=alexcrichton
Mazdak Farrokhzad [Tue, 19 Nov 2019 12:10:09 +0000 (13:10 +0100)]
Rollup merge of #66090 - pietroalbini:ci-improvements, r=alexcrichton

Misc CI improvements

This PR contains some misc improvements to our CI configuration:

* The environment variables for MinGW builders were greatly simplified, with just `CUSTOM_MINGW=1` to tell the install scripts to install the vendored copy. All the others (`MINGW_URL`, `MINGW_DIR`, `MINGW_ARCHIVE` and `MSYS_BITS`) are detected either from the builder name or the environment.
* Collecting CPU stats and running the build were moved into scripts.
* Toolstate scripts validation was previously a separate step, ran just when `IMAGE=mingw-check`. This moves the validation code inside the actual image.
* Vendored copies are now fetched from https://ci-mirrors.rust-lang.org instead of directly from the bucket.

r? @alexcrichton

4 years agoAuto merge of #66206 - PotHix:master, r=estebank
bors [Tue, 19 Nov 2019 07:49:54 +0000 (07:49 +0000)]
Auto merge of #66206 - PotHix:master, r=estebank

Suggest `#[repr(C)]` instead of `#[repr(C, packed, ...)]`

The code was previously suggesting `#[repr(C, packed, ...)]` for incorrect uses of `repr` (e.g. `#[repr = "C"]`). This change suggests the usage of `#[repr(C)]` instead.

r? @estebank

Ref: #61286.

4 years agoMove the definition of `QueryResult` into `plumbing.rs`.
Nicholas Nethercote [Fri, 1 Nov 2019 04:16:52 +0000 (15:16 +1100)]
Move the definition of `QueryResult` into `plumbing.rs`.

Because it's the only file that uses it, and removes the need for
importing it.

4 years agoAuto merge of #66074 - wesleywiser:test_run_const_prop, r=oli-obk
bors [Tue, 19 Nov 2019 04:38:47 +0000 (04:38 +0000)]
Auto merge of #66074 - wesleywiser:test_run_const_prop, r=oli-obk

[mir-opt] Turn on the `ConstProp` pass by default

perf.rlo shows that running the `ConstProp` pass results in
across-the-board wins regardless of debug or opt complilation mode. As a
result, we're turning it on to get the compile time benefits.

4 years agoRemove compiler_builtins_lib feature from libstd
Yu Ding [Tue, 19 Nov 2019 03:43:24 +0000 (19:43 -0800)]
Remove compiler_builtins_lib feature from libstd

4 years agoAuto merge of #65821 - SimonSapin:in-place, r=Amanieu
bors [Tue, 19 Nov 2019 01:16:07 +0000 (01:16 +0000)]
Auto merge of #65821 - SimonSapin:in-place, r=Amanieu

Use `drop_in_place` in `array::IntoIter::drop`

This skips the loop when the element type is known not to have drop glue, even in debug mode.

4 years agoMove E0594 to new error code system
Guillaume Gomez [Mon, 18 Nov 2019 18:03:20 +0000 (19:03 +0100)]
Move E0594 to new error code system

4 years agoAuto merge of #58281 - mark-i-m:synthesis, r=estebank
bors [Mon, 18 Nov 2019 22:08:31 +0000 (22:08 +0000)]
Auto merge of #58281 - mark-i-m:synthesis, r=estebank

Add outlives suggestions for some lifetime errors

This PR implements suggestion diagnostics for some lifetime mismatch errors. When the borrow checker finds that some lifetime 'a doesn't outlive some other lifetime 'b that it should outlive, then in addition to the current lifetime error, we also emit a suggestion for how to fix the problem by adding a bound:

- If a and b are normal named regions, suggest to add the bound `'a: 'b`
- If b is static, suggest to replace a with static
- If b also needs to outlive a, they must be the same, so suggest unifying  them

We start with a simpler implementation that avoids diagnostic regression or implementation complexity:
- We only makes suggestions for lifetimes the user can already name (eg not closure regions or elided regions)
- For now, we only emit a help note, not an actually suggestion because it is significantly easier.

Finally, there is one hack: it seems that implicit regions in async fn are given the name '_ incorrectly. To avoid suggesting '_: 'x, we simply filter out such lifetimes by name.

For more info, see this internals thread:

https://internals.rust-lang.org/t/mechanical-suggestions-for-some-borrow-checker-errors/9049/3

TL;DR Make suggestions to add a `where 'a: 'b` constraint for some lifetime errors. Details are in the paper linked from the internals thread above.

r? @estebank

TODO
- [x] Clean up code
- [x] Only make idiomatic suggestions
     - [x] don't suggest naming `&'a self`
     - [x] rather than `'a: 'static`, suggest replacing `'a` with `'static`
     - [x] rather than `'a: 'b, 'b: 'a`, suggest replacing `'a` with `'b` or vice versa
- [x] Performance (maybe need a perf run when this is closer to the finish line?)
     - perf run was clean...
     - EDIT: perf run seems to only check non-error performance... How do we check that error performance didn't regress?
- [x] Needs ui tests
- [x] Integrate the `help` message into the main lifetime `error`

4 years agoresolve: Give derive helpers highest priority during resolution
Vadim Petrochenkov [Mon, 18 Nov 2019 20:22:58 +0000 (23:22 +0300)]
resolve: Give derive helpers highest priority during resolution

4 years agoreview comments
Esteban Küber [Sun, 17 Nov 2019 19:27:48 +0000 (11:27 -0800)]
review comments

4 years agoAuto merge of #54733 - GuillaumeGomez:stabilize-rustdoc-theme, r=ollie27,Dylan-DPC
bors [Mon, 18 Nov 2019 19:03:21 +0000 (19:03 +0000)]
Auto merge of #54733 - GuillaumeGomez:stabilize-rustdoc-theme, r=ollie27,Dylan-DPC

Stabilize rustdoc theme options

Closes #54730

This PR stabilizes the `--themes` (now `--theme`) and `--theme-checker` (now `--check-theme`) options, for allowing users to add custom themes to their documentation.

Rustdoc includes two themes by default: `light` and `dark`. Using the `--theme` option, you can give rustdoc a CSS file to include as an extra theme for that render. Themes are named after the CSS file used, so using `--theme /path/to/your/custom-theme.css` will add a theme called `custom-theme` to the documentation.

Even though the CLI flag to add a theme is getting stabilized, there's no guarantee that a theme file will always have the same effect on documentation generated with future versions of rustdoc. To aid in ensuring that a theme will work, the flag `--check-theme` is also available, which compares the CSS rules defined by a custom theme against the ones used in the `light` theme. If the `light` theme defines a CSS rule that the custom theme does not, rustdoc will report an error. (Rustdoc also performs this check for themes given to `--theme`, but only reports a warning when a difference is found.)

4 years agoUpdate test output
Aaron Hill [Fri, 15 Nov 2019 21:50:57 +0000 (16:50 -0500)]
Update test output

4 years agoReplace bool with new `FallbackMode` enum
Aaron Hill [Fri, 15 Nov 2019 21:24:51 +0000 (16:24 -0500)]
Replace bool with new `FallbackMode` enum

4 years agoAdd explanation of unconstrained opaque type
Aaron Hill [Fri, 15 Nov 2019 15:47:47 +0000 (10:47 -0500)]
Add explanation of unconstrained opaque type

4 years agoFix 'type annotations needed' error with opaque types
Aaron Hill [Fri, 15 Nov 2019 01:19:34 +0000 (20:19 -0500)]
Fix 'type annotations needed' error with opaque types

Related: #66426

This commit adds handling for opaque types during inference variable
fallback. Type variables generated from the instantiatino of opaque
types now fallback to the opque type itself.

Normally, the type variable for an instantiated opaque type is either
unified with the concrete type, or with the opaque type itself (e.g when
a function returns an opaque type by calling another function).

However, it's possible for the type variable to be left completely
unconstrained. This can occur in code like this:

```rust
pub type Foo = impl Copy;
fn produce() -> Option<Foo> {
    None
}
```

Here, we'll instantatiate the `Foo` in `Option<Foo>` to a fresh type
variable, but we will never unify it with anything due to the fact
that we return a `None`.

This results in the error message:

`type annotations needed: cannot resolve `_: std::marker::Copy``

pointing at `pub type Foo = impl Copy`.

This message is not only confusing, it's incorrect. When an opaque type
inference variable is completely unconstrained, we can always fall back
to using the opaque type itself. This effectively turns that particular
use of the opaque type into a non-defining use, even if it appears in a
defining scope.

4 years agoUpdate ui tests
Guillaume Gomez [Wed, 6 Nov 2019 12:58:44 +0000 (13:58 +0100)]
Update ui tests

4 years agoAdd long error explanation for E0594
Guillaume Gomez [Wed, 6 Nov 2019 12:58:38 +0000 (13:58 +0100)]
Add long error explanation for E0594

4 years agoFix Makefile themes check
Guillaume Gomez [Mon, 18 Nov 2019 17:53:45 +0000 (18:53 +0100)]
Fix Makefile themes check

4 years agoRemove redundant html check
Guillaume Gomez [Mon, 18 Nov 2019 15:49:44 +0000 (16:49 +0100)]
Remove redundant html check

4 years agoimprove error messages and documentation
Guillaume Gomez [Thu, 17 Oct 2019 12:26:21 +0000 (14:26 +0200)]
improve error messages and documentation

4 years agoremove -Z option from rustdoc theme checker tool
Guillaume Gomez [Sat, 12 Oct 2019 09:53:02 +0000 (11:53 +0200)]
remove -Z option from rustdoc theme checker tool

4 years agoApply review comments
Guillaume Gomez [Thu, 10 Oct 2019 10:09:01 +0000 (12:09 +0200)]
Apply review comments

4 years agoRename rustdoc options --themes and --check-themes to --theme and --check-theme
Guillaume Gomez [Sun, 22 Sep 2019 20:35:25 +0000 (22:35 +0200)]
Rename rustdoc options --themes and --check-themes to --theme and --check-theme

4 years agoremove unstable docs
Guillaume Gomez [Sat, 14 Sep 2019 15:43:19 +0000 (17:43 +0200)]
remove unstable docs

4 years agorename check-theme option into check-themes
Guillaume Gomez [Sat, 14 Sep 2019 15:43:10 +0000 (17:43 +0200)]
rename check-theme option into check-themes

4 years agoImprove documentation, add checks for themes option arguments, make sure the themes...
Guillaume Gomez [Wed, 21 Aug 2019 13:48:26 +0000 (15:48 +0200)]
Improve documentation, add checks for themes option arguments, make sure the themes file names are js compatible

4 years agoFix typos
Guillaume Gomez [Fri, 26 Jul 2019 08:15:23 +0000 (10:15 +0200)]
Fix typos

Co-Authored-By: Oliver Middleton <olliemail27@gmail.com>
4 years agoRename theme-checker option to check-theme
Guillaume Gomez [Sun, 30 Jun 2019 17:24:32 +0000 (19:24 +0200)]
Rename theme-checker option to check-theme

4 years agoAdd sentence to tell other options are ignored when running check-theme
Guillaume Gomez [Sun, 30 Jun 2019 17:23:45 +0000 (19:23 +0200)]
Add sentence to tell other options are ignored when running check-theme

4 years agoPrevent invalid html characters in themes name
Guillaume Gomez [Sun, 30 Jun 2019 17:09:58 +0000 (19:09 +0200)]
Prevent invalid html characters in themes name

4 years agoadd test for rustdoc's --themes flag
QuietMisdreavus [Fri, 24 May 2019 19:04:45 +0000 (14:04 -0500)]
add test for rustdoc's --themes flag

4 years agoApply review comments
Guillaume Gomez [Fri, 24 May 2019 08:39:49 +0000 (10:39 +0200)]
Apply review comments

4 years agoWarn instead of failing for themes
Guillaume Gomez [Thu, 23 May 2019 11:45:30 +0000 (13:45 +0200)]
Warn instead of failing for themes

4 years agoAdd documentation for stabilized flags
Guillaume Gomez [Thu, 23 May 2019 11:45:08 +0000 (13:45 +0200)]
Add documentation for stabilized flags

4 years agoStabilize rustdoc theme options
Guillaume Gomez [Mon, 1 Oct 2018 20:28:12 +0000 (22:28 +0200)]
Stabilize rustdoc theme options

4 years agoUse `drop_in_place` in `array::IntoIter::drop`
Simon Sapin [Fri, 25 Oct 2019 16:11:20 +0000 (18:11 +0200)]
Use `drop_in_place` in `array::IntoIter::drop`

This skips the loop when the element type is known not to have drop glue, even in debug mode.

4 years agoAuto merge of #66459 - eddyb:update-llvm-wasm-dwarf, r=alexcrichton
bors [Mon, 18 Nov 2019 09:14:12 +0000 (09:14 +0000)]
Auto merge of #66459 - eddyb:update-llvm-wasm-dwarf, r=alexcrichton

Update src/llvm-project to include rust-lang/llvm-project#27.

See https://github.com/rust-lang/llvm-project/pull/27, which works around https://github.com/rust-lang/llvm-project/pull/20#discussion_r344425408 (where I stumbled over some UB in DWARF emission for WASM, resulting in non-deterministic output).

r? @alexcrichton cc @yurydelendik

4 years agostd::error::Chain: remove Copy
Harald Hoyer [Fri, 15 Nov 2019 13:29:35 +0000 (14:29 +0100)]
std::error::Chain: remove Copy

remove Copy from Iterator as per comment
https://github.com/rust-lang/rust/issues/58520#issuecomment-553682166

4 years agoRename generated lifetime.
Camille GILLOT [Fri, 15 Nov 2019 17:58:40 +0000 (18:58 +0100)]
Rename generated lifetime.

4 years agoRetire EnumLiftImpl.
Camille GILLOT [Fri, 15 Nov 2019 17:30:20 +0000 (18:30 +0100)]
Retire EnumLiftImpl.

4 years agoRetire BraceStructLiftImpl.
Camille GILLOT [Fri, 15 Nov 2019 17:19:52 +0000 (18:19 +0100)]
Retire BraceStructLiftImpl.

4 years agoCreate derive proc-macro for Lift trait.
Camille GILLOT [Thu, 14 Nov 2019 22:31:49 +0000 (23:31 +0100)]
Create derive proc-macro for Lift trait.

4 years agoAuto merge of #66396 - smmalis37:pythontest, r=alexcrichton
bors [Mon, 18 Nov 2019 06:09:04 +0000 (06:09 +0000)]
Auto merge of #66396 - smmalis37:pythontest, r=alexcrichton

Make a test compatible across python versions.

Progress on #65063

This PR allows this test to work on both python2 and python3, ~~and it also allows `./x.py test` to fully complete on my system without python2 installed at all.~~

4 years agoAuto merge of #66238 - ehuss:stabilize-rustdoc-edition, r=GuillaumeGomez
bors [Mon, 18 Nov 2019 03:06:42 +0000 (03:06 +0000)]
Auto merge of #66238 - ehuss:stabilize-rustdoc-edition, r=GuillaumeGomez

rustdoc: Stabilize `edition` annotation.

The rustdoc `edition` annotation is currently ignored on stable. This means that the tests will be ignored, unless there is a `rust` annotation, then it will use the global edition. I suspect this was just an oversight during the edition stabilization, but I don't know. Example:

```rust
/// ```edition2018
/// // This code block was ignored on stable.
/// ```

/// ```rust,edition2018
/// // This code block would use whatever edition is passed on the command line.
/// ```
```

AFAIK, it is not possible to write a test that verifies stable behavior, as all tests appear to set RUSTC_BOOTSTRAP which forces all tests to run as "nightly", even on a stable release.

Closes #65980

4 years agoAuto merge of #65456 - estebank:trait-bound-borrow, r=matthewjasper
bors [Mon, 18 Nov 2019 00:05:38 +0000 (00:05 +0000)]
Auto merge of #65456 - estebank:trait-bound-borrow, r=matthewjasper

Suggest borrowing when it would satisfy an unmet trait bound

When there are multiple implementors for the same trait that is present
in an unmet binding, modify the E0277 error to refer to the parent
obligation and verify whether borrowing the argument being passed in
would satisfy the unmet bound. If it would, suggest it.

Fix #56368.

4 years agoAuto merge of #66385 - ecstatic-morse:check-only-pass2, r=eddyb
bors [Sun, 17 Nov 2019 18:38:15 +0000 (18:38 +0000)]
Auto merge of #66385 - ecstatic-morse:check-only-pass2, r=eddyb

Make dataflow-based const qualification the canonical one

For over a month, dataflow-based const qualification has been running in parallel with `qualify_consts` to check the bodies of `const` and `static`s. This PR removes the old qualification pass completely in favor of the dataflow-based one.

**edit:**
This PR also stops checking `QUALIF_ERROR_BIT` during promotion. This check appears to no longer serve a purpose now that the CTFE engine is more robust.

As a side-effect, this resolves #66167.

r? @eddyb

4 years agoAdd JohnTitor to rustc-guide toolstate notification list
Yuki Okushi [Sun, 17 Nov 2019 15:47:38 +0000 (00:47 +0900)]
Add JohnTitor to rustc-guide toolstate notification list

Also update org names of some books

4 years agoAuto merge of #66384 - cjgillot:typefoldable, r=Zoxc
bors [Sun, 17 Nov 2019 15:25:10 +0000 (15:25 +0000)]
Auto merge of #66384 - cjgillot:typefoldable, r=Zoxc

Derive TypeFoldable using a proc-macro

A new proc macro is added in librustc_macros.
It is used to derive TypeFoldable inside librustc and librustc_traits.

For now, the macro uses the `'tcx` lifetime implicitly, and does not allow for a more robust selection of the adequate lifetime.

The Clone-based TypeFoldable implementations are not migrated.

Closes #65674

4 years agoAuto merge of #66488 - RalfJung:miri, r=RalfJung
bors [Sun, 17 Nov 2019 10:45:37 +0000 (10:45 +0000)]
Auto merge of #66488 - RalfJung:miri, r=RalfJung

update Miri

r? @ghost Cc @oli-obk

4 years agoupdate Miri
Ralf Jung [Sun, 17 Nov 2019 10:40:18 +0000 (11:40 +0100)]
update Miri

4 years agoAuto merge of #66336 - ehuss:update-cargo-books, r=Mark-Simulacrum
bors [Sun, 17 Nov 2019 07:45:00 +0000 (07:45 +0000)]
Auto merge of #66336 - ehuss:update-cargo-books, r=Mark-Simulacrum

Update Cargo, books

## cargo

12 commits in 5da4b4d47963868d9878480197581ccbbdaece74..8280633db680dec5bfe1de25156d1a1d53e6d190
2019-10-28 21:53:41 +0000 to 2019-11-11 23:17:05 +0000
- Don't panic when parsing `/proc/stat` (rust-lang/cargo#7580)
- Fix unused configuration key warning for a few keys under `build`. (rust-lang/cargo#7575)
- Add back support for `BROWSER` envvar in `cargo doc --open`. (rust-lang/cargo#7576)
- Only include "already existing ..." comment in gitignore on conflict (rust-lang/cargo#7570)
- Add VS Code user dir to .gitignore (rust-lang/cargo#7578)
- Added aliases to subcommand typo suggestions. (rust-lang/cargo#7486)
- Use multiple requirement syntax consistently (rust-lang/cargo#7573)
- Update verison to 0.42 (rust-lang/cargo#7568)
- Expand documentation on build scripts. (rust-lang/cargo#7565)
- Update crossbeam-utils requirement from 0.6 to 0.7 (rust-lang/cargo#7566)
- don't download std-docs on CI (rust-lang/cargo#7513)
- Change my-buddy to github-handle (rust-lang/cargo#7553)

## nomicon

2 commits in 5004ad30d69f93553ceef74439fea2159d1f769e..58e36e0e08dec5a379ac568827c058e25990d6cd
2019-10-12 19:52:40 +0200 to 2019-10-30 08:14:24 -0500
- remove references to the nursery
- Add github action to replace Travis.yml (rust-lang-nursery/nomicon#172)

## reference

7 commits in 4b21b646669e0af49fae7cae301898dc4bfaa1f0..45558c464fb458affbcdcb34323946da45c8a117
2019-10-27 22:33:11 +0100 to 2019-11-08 14:47:35 +0100
- Audit code blocks. (rust-lang-nursery/reference#715)
- Update coherence and orphan rules documentation to match RFC 2451 (rust-lang-nursery/reference#703)
- Update organization name (rust-lang-nursery/reference#713)
- State that no_implicit_prelude also applies to nested modules (rust-lang-nursery/reference#707)
- expand Copy docs (rust-lang-nursery/reference#711)
- github action doesn't use the nursery (rust-lang-nursery/reference#706)
- Migrate to GitHub Actions. (rust-lang-nursery/reference#705)

## book

1 commits in 28fa3d15b0bc67ea5e79eeff2198e4277fc61baf..e79dd62aa63396714278d484d91d48826737f47f
2019-10-29 07:16:09 -0500 to 2019-10-30 07:33:12 -0500
- No need for an iterator here to fetch values (rust-lang/book#1957)

## rust-by-example

1 commits in f3197ddf2abab9abdbc029def8164f4a748b0d91..dcee312c66267eb5a2f6f1561354003950e29105
2019-10-29 10:17:40 -0300 to 2019-10-31 11:26:53 -0300
- refactor: simplify extracting Result from Option (rust-lang/rust-by-example#1283)

## edition-guide

2 commits in e58bc4ca104e890ac56af846877c874c432a64b5..f553fb26c60c4623ea88a1cfe731eafe0643ce34
2019-07-31 20:14:12 +0200 to 2019-10-30 08:27:42 -0500
- remove old references to the nursery
- Port from Travis to GitHub Actions (rust-lang-nursery/edition-guide#192)

4 years agoAuto merge of #66485 - JohnTitor:rollup-vbwhg6r, r=JohnTitor
bors [Sun, 17 Nov 2019 04:37:53 +0000 (04:37 +0000)]
Auto merge of #66485 - JohnTitor:rollup-vbwhg6r, r=JohnTitor

Rollup of 11 pull requests

Successful merges:

 - #65739 (Improve documentation of `Vec::split_off(...)`)
 - #66271 (syntax: Keep string literals in ABIs and `asm!` more precisely)
 - #66344 (rustc_plugin: Remove `Registry::register_attribute`)
 - #66381 (find_deprecation: deprecation attr may be ill-formed meta.)
 - #66395 (Centralize panic macro documentation)
 - #66456 (Move `DIAGNOSTICS` usage to `rustc_driver`)
 - #66465 (add missing 'static lifetime in docs)
 - #66466 (miri panic_unwind: fix hack for SEH platforms)
 - #66469 (Use "field is never read" instead of "field is never used")
 - #66471 (Add test for issue 63116)
 - #66477 (Clarify transmute_copy documentation example)

Failed merges:

r? @ghost

4 years agoRollup merge of #66477 - ALSchwalm:clarify-transmute-copy, r=Centril
Yuki Okushi [Sun, 17 Nov 2019 04:36:25 +0000 (13:36 +0900)]
Rollup merge of #66477 - ALSchwalm:clarify-transmute-copy, r=Centril

Clarify transmute_copy documentation example

Currently the documentation for `transmute_copy` implies that the function accepts a slice due to the variable name chosen in the example. This is misleading as `foo_slice` is actually an array and `transmute_copy` cannot take an unsized type anyway.

This PR just clarifies things by renaming the variable used in the example.

4 years agoRollup merge of #66471 - Alexendoo:test-issue-63116, r=Centril
Yuki Okushi [Sun, 17 Nov 2019 04:36:24 +0000 (13:36 +0900)]
Rollup merge of #66471 - Alexendoo:test-issue-63116, r=Centril

Add test for issue 63116

Closes #63116

4 years agoRollup merge of #66469 - CosineP:fix/field-lint, r=petrochenkov
Yuki Okushi [Sun, 17 Nov 2019 04:36:22 +0000 (13:36 +0900)]
Rollup merge of #66469 - CosineP:fix/field-lint, r=petrochenkov

Use "field is never read" instead of "field is never used"

this is my first PR here so please let me know if i am doing it wrong
closes #64465
i will be referencing this with a book PR that updates the same language

4 years agoRollup merge of #66466 - RalfJung:seh, r=oli-obk
Yuki Okushi [Sun, 17 Nov 2019 04:36:21 +0000 (13:36 +0900)]
Rollup merge of #66466 - RalfJung:seh, r=oli-obk

miri panic_unwind: fix hack for SEH platforms

The old hack didn't work as we ended up duplicating the `eh_personality` lang item...

I have no idea if rustc cares that `eh_catch_typeinfo` has a certain shape, but better safe than sorry. I cannot test this locally.

r? @oli-obk Cc @Aaron1011

4 years agoRollup merge of #66465 - mulimoen:fix_lifetime_elision_not_shown, r=rkruppe
Yuki Okushi [Sun, 17 Nov 2019 04:36:19 +0000 (13:36 +0900)]
Rollup merge of #66465 - mulimoen:fix_lifetime_elision_not_shown, r=rkruppe

add missing 'static lifetime in docs

4 years agoRollup merge of #66456 - Centril:driver-codes, r=Mark-Simulacrum
Yuki Okushi [Sun, 17 Nov 2019 04:36:18 +0000 (13:36 +0900)]
Rollup merge of #66456 - Centril:driver-codes, r=Mark-Simulacrum

Move `DIAGNOSTICS` usage to `rustc_driver`

Remove `rustc_interface`'s dependency on `rustc_error_codes` and centralize all usages of `DIAGNOSTICS` in `rustc_driver`. Once we remove all references to `rustc_error_codes` in all other crates but `rustc_driver`, this should allow for incremental recompilation of the compiler to be smoother when tweaking error codes. This works towards https://github.com/rust-lang/rust/issues/66210#issuecomment-551862528.

(May include traces of minor drive-by cleanup.)

r? @Mark-Simulacrum

4 years agoRollup merge of #66395 - jplatte:centralize-panic-docs, r=Dylan-DPC
Yuki Okushi [Sun, 17 Nov 2019 04:36:16 +0000 (13:36 +0900)]
Rollup merge of #66395 - jplatte:centralize-panic-docs, r=Dylan-DPC

Centralize panic macro documentation

This is just the main commit from #61511 (which got closed because the author didn't reply) cherry-picked on the current master. Building `core` and `std` on this branch in stage 1 succeeded, which I thinks means the issues from the previous PR should be gone (but let's see what CI says).

4 years agoRollup merge of #66381 - Centril:66340, r=petrochenkov
Yuki Okushi [Sun, 17 Nov 2019 04:36:15 +0000 (13:36 +0900)]
Rollup merge of #66381 - Centril:66340, r=petrochenkov

find_deprecation: deprecation attr may be ill-formed meta.

Fixes #66340.

r? @petrochenkov
cc @pnkfelix

4 years agoRollup merge of #66344 - petrochenkov:noregattr, r=matthewjasper
Yuki Okushi [Sun, 17 Nov 2019 04:36:13 +0000 (13:36 +0900)]
Rollup merge of #66344 - petrochenkov:noregattr, r=matthewjasper

rustc_plugin: Remove `Registry::register_attribute`

Legacy plugins cannot register inert attributes anymore.

The preferred replacement is to use `register_tool` ([tracking issue](https://github.com/rust-lang/rust/issues/66079)).
```rust
#![register_tool(servo)]

#[servo::must_root]
struct S;
```

The more direct replacement is `register_attribute` ([tracking issue](https://github.com/rust-lang/rust/issues/66080))
```rust
#![register_attr(must_root)]

#[must_root]
struct S;
```
, but it requires registering each attribute individually rather than registering the tool once, and is more likely to be removed rather than stabilized.

4 years agoRollup merge of #66271 - petrochenkov:abism, r=Centril
Yuki Okushi [Sun, 17 Nov 2019 04:36:12 +0000 (13:36 +0900)]
Rollup merge of #66271 - petrochenkov:abism, r=Centril

syntax: Keep string literals in ABIs and `asm!` more precisely

As a result we don't lose spans when `extern` functions or blocks are passed to proc macros, and also escape all string literals consistently.
Continuation of https://github.com/rust-lang/rust/pull/60679, which did a similar thing with all literals besides those in ABIs and `asm!`.

TODO: Add tests.

Fixes https://github.com/rust-lang/rust/issues/60493
Fixes https://github.com/rust-lang/rust/issues/64561
r? @Centril

4 years agoRollup merge of #65739 - mqudsi:vec_split_off_docs, r=dtolnay
Yuki Okushi [Sun, 17 Nov 2019 04:36:10 +0000 (13:36 +0900)]
Rollup merge of #65739 - mqudsi:vec_split_off_docs, r=dtolnay

Improve documentation of `Vec::split_off(...)`

The previous ordering of the sentences kept switching between the return
value and the value of `self` after execution, making it hard to follow.

Additionally, as rendered in the browser, the period in "`Self`. `self`"
was difficult to make out as being a sentence separator and not one code
block.

4 years agoreview comments
Esteban Küber [Sun, 17 Nov 2019 01:10:13 +0000 (17:10 -0800)]
review comments

4 years agoSuggest calling async closure when needed
Esteban Küber [Sat, 9 Nov 2019 02:04:05 +0000 (18:04 -0800)]
Suggest calling async closure when needed

When using an async closure as a value in a place that expects a future,
suggest calling the closure.

Fix #65923.

4 years agoreview comments and fix rebase
Esteban Küber [Wed, 6 Nov 2019 18:39:57 +0000 (10:39 -0800)]
review comments and fix rebase

4 years agoAuto merge of #66394 - wesleywiser:fix_oom, r=oli-obk
bors [Sat, 16 Nov 2019 22:54:33 +0000 (22:54 +0000)]
Auto merge of #66394 - wesleywiser:fix_oom, r=oli-obk

Fix two OOM issues related to `ConstProp`

Fixes #66342
Fixes #66397

r? @oli-obk

4 years agoAdd test for issue 63116
Alex Macleod [Sat, 16 Nov 2019 14:54:09 +0000 (14:54 +0000)]
Add test for issue 63116

4 years agoAdd some more tests
Vadim Petrochenkov [Sat, 16 Nov 2019 22:11:35 +0000 (01:11 +0300)]
Add some more tests

4 years agoAddress review comments
Vadim Petrochenkov [Sat, 16 Nov 2019 17:11:05 +0000 (20:11 +0300)]
Address review comments

4 years agoAccount for `rustc_on_unimplemented`
Esteban Küber [Sun, 27 Oct 2019 20:42:20 +0000 (13:42 -0700)]
Account for `rustc_on_unimplemented`

4 years agoRemove unnecessary note
Esteban Küber [Wed, 16 Oct 2019 03:35:54 +0000 (20:35 -0700)]
Remove unnecessary note

4 years agoModify primary label message to be inline with error message
Esteban Küber [Wed, 16 Oct 2019 02:09:15 +0000 (19:09 -0700)]
Modify primary label message to be inline with error message

4 years agoSuggest borrowing when it would satisfy an unmet trait bound
Esteban Küber [Wed, 16 Oct 2019 01:42:27 +0000 (18:42 -0700)]
Suggest borrowing when it would satisfy an unmet trait bound

When there are multiple implementors for the same trait that is present
in an unmet binding, modify the E0277 error to refer to the parent
obligation and verify whether borrowing the argument being passed in
would satisfy the unmet bound. If it would, suggest it.

4 years agoTweak code formatting
Esteban Küber [Wed, 16 Oct 2019 01:27:42 +0000 (18:27 -0700)]
Tweak code formatting

4 years agoClarify transmute_copy documentation example
Adam Schwalm [Sat, 16 Nov 2019 20:47:33 +0000 (14:47 -0600)]
Clarify transmute_copy documentation example

4 years agoRevise the text of `vec::split_off()` per review in #65739
Mahmoud Al-Qudsi [Sat, 16 Nov 2019 20:11:08 +0000 (14:11 -0600)]
Revise the text of `vec::split_off()` per review in #65739

Remove the incorrect usage of "copy" as the trait is not called.

4 years agoImprove documentation of `Vec::split_off(...)`
Mahmoud Al-Qudsi [Wed, 23 Oct 2019 21:32:16 +0000 (16:32 -0500)]
Improve documentation of `Vec::split_off(...)`

The previous ordering of the sentences kept switching between the return
value and the value of `self` after execution, making it hard to follow.

Additionally, as rendered in the browser, the period in "`Self`. `self`"
was difficult to make out as being a sentence separator and not one code
block.

4 years agoAuto merge of #64694 - petrochenkov:reshelp, r=matthewjasper
bors [Sat, 16 Nov 2019 19:50:48 +0000 (19:50 +0000)]
Auto merge of #64694 - petrochenkov:reshelp, r=matthewjasper

Fully integrate derive helpers into name resolution

```rust
#[derive(Foo)]
#[foo_helper] // already goes through name resolution
struct S {
    #[foo_helper] // goes through name resolution after this PR
    field: u8
}
```
How name resolution normally works:
- We have an identifier we need to resolve, take its location (in some sense) and look what names are in scope in that location.

How derive helper attributes are "resolved" (before this PR):
- After resolving the derive `Foo` we visit the derive's input (`struct S { ... } `) as a piece of AST and mark attributes textually matching one of the derive's helper attributes (`foo_helper`) as "known", so they never go through name resolution.

This PR changes the rules for derive helpers, so they are not proactively marked as known (which is a big hack ignoring any ambiguities or hygiene), but go through regular name resolution instead.
This change was previously blocked by attributes not being resolved in some positions at all (fixed in https://github.com/rust-lang/rust/pull/63468).

"Where exactly are derive helpers in scope?" is an interesting question, and I need some feedback from proc macro authors to answer it, see the post below (https://github.com/rust-lang/rust/pull/64694#issuecomment-533925160).

4 years agoparse: Use string literal parsing in the `asm` macro
Vadim Petrochenkov [Sun, 10 Nov 2019 14:04:12 +0000 (17:04 +0300)]
parse: Use string literal parsing in the `asm` macro

4 years agoparse: Support parsing optional literals
Vadim Petrochenkov [Sun, 10 Nov 2019 12:32:41 +0000 (15:32 +0300)]
parse: Support parsing optional literals

Revert weird renaming of the former `LitError::report`

4 years agoast: Keep string literals in ABIs precisely
Vadim Petrochenkov [Sat, 9 Nov 2019 21:44:59 +0000 (00:44 +0300)]
ast: Keep string literals in ABIs precisely

4 years agoast: Keep `extern` qualifiers in functions more precisely
Vadim Petrochenkov [Sat, 9 Nov 2019 19:05:20 +0000 (22:05 +0300)]
ast: Keep `extern` qualifiers in functions more precisely

4 years agoOnly run tests on x86_64
Wesley Wiser [Fri, 15 Nov 2019 01:48:42 +0000 (20:48 -0500)]
Only run tests on x86_64

4 years agoUpdate ui tests
clemencetbk [Sat, 16 Nov 2019 17:05:26 +0000 (12:05 -0500)]
Update ui tests

4 years agoAdd explanation message for E0641
clemencetbk [Sat, 16 Nov 2019 17:04:17 +0000 (12:04 -0500)]
Add explanation message for E0641

4 years agorustc_plugin: Remove `Registry::register_attribute`
Vadim Petrochenkov [Tue, 12 Nov 2019 18:22:16 +0000 (21:22 +0300)]
rustc_plugin: Remove `Registry::register_attribute`