]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRollup merge of #66532 - cuviper:dwarf-aranges, r=michaelwoerister
Mazdak Farrokhzad [Wed, 20 Nov 2019 11:58:32 +0000 (12:58 +0100)]
Rollup merge of #66532 - cuviper:dwarf-aranges, r=michaelwoerister

Generate DWARF address ranges for faster lookups

This adds a new option `-Zgenerate-arange-section`, enabled by default,
corresponding to LLVM's `-generate-arange-section`. This creates a
`.debug_aranges` section with DWARF address ranges, which some tools
depend on to optimize address lookups (elfutils [22288], [25173]).

This only has effect when debuginfo is enabled, and the additional data
is small compared to the other debug sections. For example, libstd.so
with full debuginfo is about 11MB, with just 61kB in aranges.

[22288]: https://sourceware.org/bugzilla/show_bug.cgi?id=22288
[25173]: https://sourceware.org/bugzilla/show_bug.cgi?id=25173

Closes #45246.
r? @michaelwoerister

4 years agoRollup merge of #66526 - estebank:async-fn-trait-information, r=Centril
Mazdak Farrokhzad [Wed, 20 Nov 2019 11:58:30 +0000 (12:58 +0100)]
Rollup merge of #66526 - estebank:async-fn-trait-information, r=Centril

Add more context to `async fn` trait error

Follow up to #65937. Fix #65899.

4 years agoRollup merge of #66497 - Nadrieril:fix-53820, r=varkor
Mazdak Farrokhzad [Wed, 20 Nov 2019 11:58:29 +0000 (12:58 +0100)]
Rollup merge of #66497 - Nadrieril:fix-53820, r=varkor

Fix #53820

This fixes ICE #53820 by being more clever when matching large arrays with slice patterns.
In particular, it avoids treating large arrays like large tuples, and instead reuses the `VarLenSlice` constructor behaviour to only consider as little values as needed.
As a side-effect, such matches also get improved diagnostics, by reporting `[true, ..]` missing instead of `[true, _, _, _, _, _, _, _]`.

4 years agoRollup merge of #66478 - petrochenkov:rmplugin, r=davidtwco
Mazdak Farrokhzad [Wed, 20 Nov 2019 11:58:27 +0000 (12:58 +0100)]
Rollup merge of #66478 - petrochenkov:rmplugin, r=davidtwco

rustc_plugin: Remove the compatibility shim

The compatibility crate was introduced in https://github.com/rust-lang/rust/pull/62727 to migrate Cargo and some other tools, but now it's no longer necessary.

4 years agoRollup merge of #65665 - tspiteri:italic-and-update-SourceCodePro, r=GuillaumeGomez
Mazdak Farrokhzad [Wed, 20 Nov 2019 11:58:26 +0000 (12:58 +0100)]
Rollup merge of #65665 - tspiteri:italic-and-update-SourceCodePro, r=GuillaumeGomez

Update Source Code Pro and include italics

Fixes #65502.

A few notes:
  * As stated in #65502, this does increase the download size.
  * Since this PR changes the font set, I think docs.rs would have to be updated if this PR is merged.
  * The fonts have a double extension (.ttf.woff); this is to keep the names consistent with the upstream font release which does that to distinguish these from the .otf.woff files ([Source Code Pro otf renders poorly on older Windows system apps](https://github.com/adobe-fonts/source-code-pro/issues/25#issuecomment-9019600)).

4 years agoAuto merge of #66104 - yodaldevoid:generic-arg-disambiguation, r=petrochenkov
bors [Wed, 20 Nov 2019 03:07:39 +0000 (03:07 +0000)]
Auto merge of #66104 - yodaldevoid:generic-arg-disambiguation, r=petrochenkov

Generic arg disambiguation

Using the tactic suggested by @petrochenkov in https://github.com/rust-lang/rust/issues/60804#issuecomment-516769465 and on [zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/generic.20argument.20disambiguation), this change checks type arguments to see if they are really incorrectly-parsed const arguments.

it should be noted that `segments.len() == 1 && segments[0].arg.is_none()` was reduced to `segments.len() == 1` as suggested by @petrochenkov in [zulip](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/generic.20argument.20disambiguation/near/177848002). This change allowed a few more existing tests to have their braces removed.

There are a couple of "problems" with these changes that I should note. First, there was a regression in the error messages found in "src/test/ui/privacy-ns1.rs" and "src/test/ui/privacy-ns1.rs". Second, some braces were unable to be removed from "src/test/ui/const-generics/fn-const-param-infer.rs". Those on line 24 caused the statement to stop equating when removed, and those on line 20 cause a statement that should not equate to produce no error when removed.

I have not looked further into any of these issues yet, though I would be willing to look into them before landing this. I simply wanted to get some other eyes on this before going further.

Fixes #60804

cc @varkor @jplatte

4 years agoRemove desugared `async-trait` example
Esteban Kuber [Tue, 19 Nov 2019 19:29:20 +0000 (11:29 -0800)]
Remove desugared `async-trait` example

4 years agoMark -Zgenerate-arange-section as TRACKED
Josh Stone [Tue, 19 Nov 2019 17:13:10 +0000 (09:13 -0800)]
Mark -Zgenerate-arange-section as TRACKED

4 years agoUpdate E0706.md
Dylan DPC [Tue, 19 Nov 2019 16:09:39 +0000 (17:09 +0100)]
Update E0706.md

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 agoAdd error code documentation
Esteban Küber [Mon, 18 Nov 2019 20:34:22 +0000 (12:34 -0800)]
Add error code documentation

4 years agoGenerate DWARF address ranges for faster lookups
Josh Stone [Mon, 18 Nov 2019 23:05:01 +0000 (15:05 -0800)]
Generate DWARF address ranges for faster lookups

This adds a new option `-Zgenerate-arange-section`, enabled by default,
corresponding to LLVM's `-generate-arange-section`. This creates a
`.debug_aranges` section with DWARF address ranges, which some tools
depend on to optimize address lookups (elfutils [22288], [25173]).

This only has effect when debuginfo is enabled, and the additional data
is small compared to the other debug sections. For example, libstd.so
with full debuginfo is about 11MB, with just 61kB in aranges.

[22288]: https://sourceware.org/bugzilla/show_bug.cgi?id=22288
[25173]: https://sourceware.org/bugzilla/show_bug.cgi?id=25173

Closes #45246.

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 agotest: Update tests with fallout of changes
Gabriel Smith [Mon, 18 Nov 2019 19:57:46 +0000 (14:57 -0500)]
test: Update tests with fallout of changes

The error messages of the two tests effected degraded in quality. The
errors no longer suggest types in other modules as they now assume that
the arguments are const args, not type args.

4 years agotest: const-generics: Update tests removing unrequired braces
Gabriel Smith [Mon, 18 Nov 2019 19:57:23 +0000 (14:57 -0500)]
test: const-generics: Update tests removing unrequired braces

Braces were left in cases where generic args were in the generic const
paths.

4 years agorustc: lowering: Lower type args as const args when resolved in value
Gabriel Smith [Mon, 18 Nov 2019 19:30:01 +0000 (14:30 -0500)]
rustc: lowering: Lower type args as const args when resolved in value
namespace

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: late: Check if type arg is really a const arg
Gabriel Smith [Mon, 18 Nov 2019 19:24:13 +0000 (14:24 -0500)]
resolve: late: Check if type arg is really a const arg

A path type argument could be a generic const argument due to
limitations as to what we can determine at parsing. We double check just
to be sure by trying to resolve in the type namespace first, and if that
fails we try again in the value namespace. If resolution in the value
namespace succeeds, we have a generic const argument on our hands.

4 years agorustc: hir: Add method to check validity of a Res/Def in a namespace
Gabriel Smith [Mon, 18 Nov 2019 19:22:49 +0000 (14:22 -0500)]
rustc: hir: Add method to check validity of a Res/Def in a namespace

4 years agoresolve: Allow idents to resolve to primitives in the type namespace
Gabriel Smith [Mon, 18 Nov 2019 19:22:00 +0000 (14:22 -0500)]
resolve: Allow idents to resolve to primitives in the type namespace

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 agoReword help and add test
Esteban Küber [Mon, 18 Nov 2019 20:08:03 +0000 (12:08 -0800)]
Reword help and add test

4 years agoAdd more context to `async fn` trait error. Suggest `async-trait`.
Agustin Fernandez [Tue, 29 Oct 2019 15:48:14 +0000 (11:48 -0400)]
Add more context to `async fn` trait error. Suggest `async-trait`.

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 agoTweak diagnostics code
Nadrieril [Mon, 18 Nov 2019 15:47:51 +0000 (15:47 +0000)]
Tweak diagnostics code

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 agoUpdate src/test/ui/pattern/issue-53820-slice-pattern-large-array.rs
Nadrieril Feneanar [Mon, 18 Nov 2019 15:40:49 +0000 (15:40 +0000)]
Update src/test/ui/pattern/issue-53820-slice-pattern-large-array.rs

Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
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 ago`ConstantValue` is the only other ctor allowed when subtracting from slice ctors
Nadrieril [Sun, 17 Nov 2019 19:24:48 +0000 (19:24 +0000)]
`ConstantValue` is the only other ctor allowed when subtracting from slice ctors

4 years agoStore SliceKinds directly when subtracting
Nadrieril [Sun, 17 Nov 2019 19:08:01 +0000 (19:08 +0000)]
Store SliceKinds directly when subtracting

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 agoSmall improvement to exhaustiveness diagnostics
Nadrieril [Sun, 17 Nov 2019 17:48:45 +0000 (17:48 +0000)]
Small improvement to exhaustiveness diagnostics

4 years agoFactor out slice constructor struct and simplify
Nadrieril [Sun, 17 Nov 2019 17:33:39 +0000 (17:33 +0000)]
Factor out slice constructor struct and simplify

4 years agoUnify the various slice constructors
Nadrieril [Sun, 17 Nov 2019 15:54:44 +0000 (15:54 +0000)]
Unify the various slice constructors

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 agoRename directory `rustc_plugin` -> `rustc_plugin_impl`
Vadim Petrochenkov [Sat, 16 Nov 2019 21:54:24 +0000 (00:54 +0300)]
Rename directory `rustc_plugin` -> `rustc_plugin_impl`

4 years agorustc_plugin: Remove the compatibility shim
Vadim Petrochenkov [Sat, 16 Nov 2019 20:35:27 +0000 (23:35 +0300)]
rustc_plugin: Remove the compatibility shim

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