]> git.lizzy.rs Git - rust.git/log
rust.git
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 agoadd fn any::type_name_of_val
lcnr/Bastian Kauschke [Tue, 19 Nov 2019 09:18:53 +0000 (10:18 +0100)]
add fn any::type_name_of_val

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 agoDelay an `is_local_ever_initialized` call.
Nicholas Nethercote [Tue, 19 Nov 2019 02:31:40 +0000 (13:31 +1100)]
Delay an `is_local_ever_initialized` call.

This commit moves the call after a `return` that almost always runs. It
speeds up the `unicode_normalization` benchmark by about 2%.

4 years agoAvoid ICE when `break`ing to an unreachable label
Esteban Küber [Tue, 19 Nov 2019 02:31:31 +0000 (18:31 -0800)]
Avoid ICE when `break`ing to an unreachable label

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 agofix rebase
Esteban Küber [Mon, 18 Nov 2019 19:01:02 +0000 (11:01 -0800)]
fix rebase

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 agoreview comments
Esteban Küber [Mon, 18 Nov 2019 18:33:05 +0000 (10:33 -0800)]
review comments

4 years agoSurround types with backticks in type errors
Esteban Küber [Fri, 15 Nov 2019 17:37:01 +0000 (09:37 -0800)]
Surround types with backticks in type errors

4 years agoRemove E0308 note when primary label has all info
Esteban Küber [Fri, 15 Nov 2019 07:45:30 +0000 (23:45 -0800)]
Remove E0308 note when primary label has all info

4 years agoreview comments: tweak prefix strings
Esteban Küber [Thu, 14 Nov 2019 22:08:08 +0000 (14:08 -0800)]
review comments: tweak prefix strings

4 years agoSpecific labels when referring to "expected" and "found" types
Esteban Küber [Wed, 13 Nov 2019 22:16:56 +0000 (14:16 -0800)]
Specific labels when referring to "expected" and "found" types

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 agoMove `trait_ref_to_existential` to a closure
Esteban Küber [Sun, 17 Nov 2019 22:57:06 +0000 (14:57 -0800)]
Move `trait_ref_to_existential` to a closure

review comment

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 agoFix selected crate search filter
Guillaume Gomez [Mon, 18 Nov 2019 13:11:21 +0000 (14:11 +0100)]
Fix selected crate search filter

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 agoreview comments
Esteban Küber [Thu, 14 Nov 2019 19:29:01 +0000 (11:29 -0800)]
review comments

4 years agoDo not ICE on trait aliases with missing obligations
Esteban Küber [Thu, 14 Nov 2019 00:06:28 +0000 (16:06 -0800)]
Do not ICE on trait aliases with missing obligations

4 years agoSimplify impl for SymbolStr.
Camille GILLOT [Sat, 16 Nov 2019 10:59:46 +0000 (11:59 +0100)]
Simplify impl for SymbolStr.

4 years agoRemove extern crate.
Camille GILLOT [Sat, 16 Nov 2019 10:53:44 +0000 (11:53 +0100)]
Remove extern crate.

4 years agoDerive HashStable_Generic for ABI types.
Camille GILLOT [Sat, 16 Nov 2019 10:52:00 +0000 (11:52 +0100)]
Derive HashStable_Generic for ABI types.

4 years agoImplement HashStable for RangeInclusive.
Camille GILLOT [Sat, 16 Nov 2019 10:45:57 +0000 (11:45 +0100)]
Implement HashStable for RangeInclusive.

4 years agoDerive HashStable for PanicStrategy.
Camille GILLOT [Sat, 9 Nov 2019 22:32:17 +0000 (23:32 +0100)]
Derive HashStable for PanicStrategy.

4 years agoHashStable in libsyntax.
Camille GILLOT [Sat, 9 Nov 2019 22:18:36 +0000 (23:18 +0100)]
HashStable in libsyntax.

4 years agoDerive HashStable in librustc_target.
Camille GILLOT [Sat, 9 Nov 2019 21:57:25 +0000 (22:57 +0100)]
Derive HashStable in librustc_target.

4 years agoHashStable_Generic for librustc_target.
Camille GILLOT [Sat, 9 Nov 2019 21:27:52 +0000 (22:27 +0100)]
HashStable_Generic for librustc_target.

4 years agoHashStable_Generic for libsyntax_pos.
Camille GILLOT [Sat, 9 Nov 2019 21:25:30 +0000 (22:25 +0100)]
HashStable_Generic for libsyntax_pos.

4 years agoHashStable literals in libsyntax.
Camille GILLOT [Sat, 9 Nov 2019 21:02:24 +0000 (22:02 +0100)]
HashStable literals in libsyntax.

4 years agoFurther HashStable_Generic derives.
Camille GILLOT [Sat, 9 Nov 2019 20:34:12 +0000 (21:34 +0100)]
Further HashStable_Generic derives.

4 years agoMove impl HashStable for Symbol in libsyntax_pos.
Camille GILLOT [Sat, 9 Nov 2019 20:17:21 +0000 (21:17 +0100)]
Move impl HashStable for Symbol in libsyntax_pos.

4 years agoMove impl HashStable for SymbolStr in libsyntax_pos.
Camille GILLOT [Sat, 9 Nov 2019 20:07:58 +0000 (21:07 +0100)]
Move impl HashStable for SymbolStr in libsyntax_pos.

4 years agoUse proc_macro for HashStable derive in libsyntax.
Camille GILLOT [Sat, 9 Nov 2019 19:56:19 +0000 (20:56 +0100)]
Use proc_macro for HashStable derive in libsyntax.

4 years agoCreate a generic HashStable derive.
Camille GILLOT [Sat, 9 Nov 2019 19:34:55 +0000 (20:34 +0100)]
Create a generic HashStable derive.

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 agorustc_metadata: Cleanup crate search with exact paths
Vadim Petrochenkov [Sun, 17 Nov 2019 16:21:43 +0000 (19:21 +0300)]
rustc_metadata: Cleanup crate search with exact paths