]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoUpdate const_forget.rs
DutchGhost [Fri, 20 Mar 2020 09:36:40 +0000 (10:36 +0100)]
Update const_forget.rs

4 years agoMove the const-forget test into ui tests
DutchGhost [Wed, 18 Mar 2020 20:08:52 +0000 (21:08 +0100)]
Move the const-forget test into ui tests

4 years agorather than removing const_forget_box, stick an attribute on it and explain it cant...
DutchGhost [Mon, 16 Mar 2020 13:45:37 +0000 (14:45 +0100)]
rather than removing const_forget_box, stick an attribute on it and explain it cant be called in ctfe yet

4 years agoThe const_forget_box was unused, and doesns't add anything to test by itself.
DutchGhost [Mon, 16 Mar 2020 12:24:59 +0000 (13:24 +0100)]
The const_forget_box was unused, and doesns't add anything to test by itself.

4 years agoRemove the call that makes miri fail
DutchGhost [Mon, 16 Mar 2020 09:51:00 +0000 (10:51 +0100)]
Remove the call that makes miri fail

4 years agoremove unused mut, restructure the test
Dodo [Mon, 2 Mar 2020 22:43:50 +0000 (23:43 +0100)]
remove unused mut, restructure the test

4 years agoAn enter as last character pleases tidy it seems
Dodo [Mon, 2 Mar 2020 20:40:35 +0000 (21:40 +0100)]
An enter as last character pleases tidy it seems

4 years agoconst forget tests
Dodo [Mon, 2 Mar 2020 20:05:14 +0000 (21:05 +0100)]
const forget tests

4 years agoactually mark the function const
DutchGhost [Mon, 2 Mar 2020 10:00:20 +0000 (11:00 +0100)]
actually mark the function const

4 years agoconstify mem::forget
DutchGhost [Sun, 1 Mar 2020 19:42:35 +0000 (20:42 +0100)]
constify mem::forget

4 years agoAuto merge of #69380 - Zoxc:parent-module, r=michaelwoerister
bors [Sun, 1 Mar 2020 14:21:03 +0000 (14:21 +0000)]
Auto merge of #69380 - Zoxc:parent-module, r=michaelwoerister

Use a query to get parent modules

Split out from https://github.com/rust-lang/rust/pull/69015 / https://github.com/rust-lang/rust/pull/68944.

r? @michaelwoerister

4 years agoAuto merge of #69606 - JohnTitor:rollup-i3nrrcf, r=JohnTitor
bors [Sun, 1 Mar 2020 11:03:16 +0000 (11:03 +0000)]
Auto merge of #69606 - JohnTitor:rollup-i3nrrcf, r=JohnTitor

Rollup of 7 pull requests

Successful merges:

 - #69397 (bootstrap: Remove commit hash from LLVM version suffix to avoid rebuilds)
 - #69549 (Improve MinGW detection when cross compiling )
 - #69562 (Don't `bug` when taking discriminant of generator during dataflow)
 - #69579 (parser: Remove `Parser::prev_span`)
 - #69580 (use .copied() instead of .map(|x| *x) on iterators)
 - #69583 (Do not ICE on invalid type node after parse recovery)
 - #69605 (Use `opt_def_id()` over `def_id()`)

Failed merges:

r? @ghost

4 years agoRollup merge of #69605 - JohnTitor:opt-def-id, r=petrochenkov
Yuki Okushi [Sun, 1 Mar 2020 10:28:15 +0000 (19:28 +0900)]
Rollup merge of #69605 - JohnTitor:opt-def-id, r=petrochenkov

Use `opt_def_id()` over `def_id()`

Fixes #69588

4 years agoRollup merge of #69583 - LeSeulArtichaut:ice-69378, r=Centril
Yuki Okushi [Sun, 1 Mar 2020 10:28:13 +0000 (19:28 +0900)]
Rollup merge of #69583 - LeSeulArtichaut:ice-69378, r=Centril

Do not ICE on invalid type node after parse recovery

Closes #69378.
r? @estebank

4 years agoRollup merge of #69580 - matthiaskrgr:map_clone, r=Centril
Yuki Okushi [Sun, 1 Mar 2020 10:28:12 +0000 (19:28 +0900)]
Rollup merge of #69580 - matthiaskrgr:map_clone, r=Centril

use .copied() instead of .map(|x| *x) on iterators

4 years agoRollup merge of #69579 - petrochenkov:noprevspan, r=Centril
Yuki Okushi [Sun, 1 Mar 2020 10:28:10 +0000 (19:28 +0900)]
Rollup merge of #69579 - petrochenkov:noprevspan, r=Centril

parser: Remove `Parser::prev_span`

Follow-up to https://github.com/rust-lang/rust/pull/69384.
r? @Centril

4 years agoRollup merge of #69562 - ecstatic-morse:dataflow-generator-discriminant, r=oli-obk
Yuki Okushi [Sun, 1 Mar 2020 10:28:09 +0000 (19:28 +0900)]
Rollup merge of #69562 - ecstatic-morse:dataflow-generator-discriminant, r=oli-obk

Don't `bug` when taking discriminant of generator during dataflow

The proper fix for rust-lang/rust-clippy#5239. `Rvalue::Discriminant` is used on generators as well as `enum`s. This didn't cause a test failure in `rustc` since we don't need to do any dataflow passes until after the generator transform that adds the `Rvalue::Discriminant`.

This required a small refactoring. `diff -w` is beneficial.

r? @oli-obk
cc @JohnTitor

4 years agoRollup merge of #69549 - mati865:mingw, r=kennytm
Yuki Okushi [Sun, 1 Mar 2020 10:28:07 +0000 (19:28 +0900)]
Rollup merge of #69549 - mati865:mingw, r=kennytm

Improve MinGW detection when cross compiling

Official mingw-w64 builds, MSYS2 and LLVM MinGW provide both `gcc.exe` and `$ARCH-w64-mingw32-gcc.exe` so they should not regress but I included CI changes to verify it though `@bors try` (I don't have permission).

This change will come handy when cross compiling from Linux or Cygwin since they use `gcc` as native compiler and `$ARCH-w64-mingw32-gcc.exe` for MinGW. This means users will no longer have to override the linker.

4 years agoRollup merge of #69397 - tmiasko:llvm-version-suffix, r=nagisa
Yuki Okushi [Sun, 1 Mar 2020 10:28:05 +0000 (19:28 +0900)]
Rollup merge of #69397 - tmiasko:llvm-version-suffix, r=nagisa

bootstrap: Remove commit hash from LLVM version suffix to avoid rebuilds

The custom LLVM version suffix was introduced to avoid unintentional
library names conflicts. By default it included the LLVM submodule
commit hash. Changing the version suffix requires the complete LLVM
rebuild, and since then every change to the submodules required it as
well.

Remove the commit hash from version suffix to avoid complete rebuilds,
while leaving the `rust` string, the release number and release channel
to disambiguate the library name.

Context: version suffix was introduced by #59173 as solution to #59034.

Resolves #68715.

4 years agoAuto merge of #69295 - ecstatic-morse:unified-dataflow-generators, r=tmandry
bors [Sun, 1 Mar 2020 07:53:13 +0000 (07:53 +0000)]
Auto merge of #69295 - ecstatic-morse:unified-dataflow-generators, r=tmandry

Use new dataflow framework for generators

#65672 introduced a new dataflow framework that can handle arbitrarily complex transfer functions as well as ones expressed as a series of gen/kill operations. This PR ports the analyses used to implement generators to the new framework so that we can remove the old one. See #68241 for a prior example of this. The new framework has some superficial API changes, but this shouldn't alter the generator passes in any way.

r? @tmandry

4 years agoUse `opt_def_id()` over `def_id()`
Yuki Okushi [Sun, 1 Mar 2020 06:15:29 +0000 (15:15 +0900)]
Use `opt_def_id()` over `def_id()`

4 years agoAuto merge of #68943 - ecstatic-morse:no-useless-drop-on-enum-variants, r=matthewjasper
bors [Sun, 1 Mar 2020 04:42:21 +0000 (04:42 +0000)]
Auto merge of #68943 - ecstatic-morse:no-useless-drop-on-enum-variants, r=matthewjasper

Skip `Drop` terminators for enum variants without drop glue

Split out from #68528.

When doing drop elaboration for an `enum` that may or may not be moved out of (an open drop), we check the discriminant of the `enum` to see whether the live variant has any drop flags and then check the drop flags to see whether we need to drop each field. Sometimes, however, the live
variant has no move paths and thus no drop flags. In this case, we still emit a drop terminator
for the entire enum after checking the enum discriminant. This drop shim will check the discriminant of the enum *again* and then drop the fields of the active variant. If the active variant has no drop glue, nothing will be done.

This commit skips emitting the drop terminator during drop elaboration when the "otherwise" variants, those without move paths, have no drop glue. A common example of this scenario is when an `Option` is moved from, since `Option::None` never needs drop glue. Below is a fragment the pre-codegen CFG for `Option::unwrap_or` in which we check the drop flag (`_5`) for `self` (`_1`), before and after the change.

Before:

![image](https://user-images.githubusercontent.com/29463364/74078927-52942380-49e5-11ea-8e34-4b9d6d94ef25.png)

After:

![image](https://user-images.githubusercontent.com/29463364/74078945-78b9c380-49e5-11ea-8302-b043c4a7515a.png)

This change doesn't do much on its own, but it is a prerequisite to get the perf gains from #68528.

cc @arielb1

4 years agoAuto merge of #69592 - petrochenkov:nosyntax, r=Centril
bors [Sun, 1 Mar 2020 01:36:58 +0000 (01:36 +0000)]
Auto merge of #69592 - petrochenkov:nosyntax, r=Centril

Rename `libsyntax` to `librustc_ast`

This was the last rustc crate that wasn't following the `rustc_*` naming convention.

Follow-up to https://github.com/rust-lang/rust/pull/67763.

4 years agoAuto merge of #69590 - Dylan-DPC:rollup-i3z0sic, r=Dylan-DPC
bors [Sat, 29 Feb 2020 20:23:10 +0000 (20:23 +0000)]
Auto merge of #69590 - Dylan-DPC:rollup-i3z0sic, r=Dylan-DPC

Rollup of 7 pull requests

Successful merges:

 - #69504 (Use assert_ne in hash tests)
 - #69571 (remove unneeded .as_ref() calls.)
 - #69572 (use .iter() instead of .into_iter() on references)
 - #69581 (fix aliasing violation in align_to_mut)
 - #69582 (improve transmute and Vec::from_raw_parts docs)
 - #69584 (Correct comment to match behavior)
 - #69587 (rustc_parse: Tweak the function parameter name check)

Failed merges:

r? @ghost

4 years agoRename `syntax` to `rustc_ast` in source code
Vadim Petrochenkov [Sat, 29 Feb 2020 17:37:32 +0000 (20:37 +0300)]
Rename `syntax` to `rustc_ast` in source code

4 years agoRollup merge of #69587 - petrochenkov:reqname, r=Centril
Dylan DPC [Sat, 29 Feb 2020 17:54:07 +0000 (18:54 +0100)]
Rollup merge of #69587 - petrochenkov:reqname, r=Centril

rustc_parse: Tweak the function parameter name check

The function doesn't need a full token, only its edition.

Noticed while implementing https://github.com/rust-lang/rust/pull/69384.
I'm still not sure whether normalized or unnormalized token is a better fit for the edition check here, so  https://github.com/rust-lang/rust/pull/69384 and this PR just keep the status quo behavior.
r? @Centril

4 years agoRollup merge of #69584 - zantysor:fix-saturating-duration-since-comment, r=varkor
Dylan DPC [Sat, 29 Feb 2020 17:54:05 +0000 (18:54 +0100)]
Rollup merge of #69584 - zantysor:fix-saturating-duration-since-comment, r=varkor

Correct comment to match behavior

Corrects the header comment on `saturating_duration_since` to match the behavior of returning 0 if the other timestamp is _later_ than the invocant, not earlier,

This is purely a documentation change, so hopefully it doesn't require an issue; if it does, I'll open one and resubmit.

4 years agoRollup merge of #69582 - RalfJung:vec-parts, r=Centril
Dylan DPC [Sat, 29 Feb 2020 17:54:04 +0000 (18:54 +0100)]
Rollup merge of #69582 - RalfJung:vec-parts, r=Centril

improve transmute and Vec::from_raw_parts docs

I think this fixes https://github.com/rust-lang/rust/issues/64073. @Shnatsel please let me know if this is less confusing. :)

4 years agoRollup merge of #69581 - RalfJung:align_to_mut, r=Centril
Dylan DPC [Sat, 29 Feb 2020 17:54:02 +0000 (18:54 +0100)]
Rollup merge of #69581 - RalfJung:align_to_mut, r=Centril

fix aliasing violation in align_to_mut

Fixes https://github.com/rust-lang/rust/issues/68549

I decided to add the testcase here to make it all one PR, but if you prefer I can also add that test case in the Miri repo instead.

4 years agoRollup merge of #69572 - matthiaskrgr:try_err_and_iter_on_ref, r=Centril
Dylan DPC [Sat, 29 Feb 2020 17:54:01 +0000 (18:54 +0100)]
Rollup merge of #69572 - matthiaskrgr:try_err_and_iter_on_ref, r=Centril

use .iter() instead of .into_iter() on references

4 years agoRollup merge of #69571 - matthiaskrgr:useless_asref, r=Centril
Dylan DPC [Sat, 29 Feb 2020 17:53:59 +0000 (18:53 +0100)]
Rollup merge of #69571 - matthiaskrgr:useless_asref, r=Centril

remove unneeded .as_ref() calls.

4 years agoMake it build again
Vadim Petrochenkov [Sat, 29 Feb 2020 17:16:26 +0000 (20:16 +0300)]
Make it build again

4 years agoMove directory `libsyntax` -> `librustc_ast`
Vadim Petrochenkov [Sat, 29 Feb 2020 17:10:08 +0000 (20:10 +0300)]
Move directory `libsyntax` -> `librustc_ast`

4 years agoUpdate src/bootstrap/dist.rs
Mateusz Mikuła [Sat, 29 Feb 2020 10:54:33 +0000 (11:54 +0100)]
Update src/bootstrap/dist.rs

Co-Authored-By: kennytm <kennytm@gmail.com>
4 years agoAuto merge of #69263 - anyska:blacklist-powerpc-zst, r=nagisa
bors [Sat, 29 Feb 2020 17:14:54 +0000 (17:14 +0000)]
Auto merge of #69263 - anyska:blacklist-powerpc-zst, r=nagisa

Blacklist powerpc-unknown-linux-{gnu,musl} as having non-ignored GNU C ZSTs.

Ref #64259 (this is a simpler alternative to that). See also https://github.com/rust-lang/rust/pull/64259#issuecomment-585815831.

4 years agorustc_parse: Tweak the function parameter name check
Vadim Petrochenkov [Sat, 29 Feb 2020 15:56:05 +0000 (18:56 +0300)]
rustc_parse: Tweak the function parameter name check

4 years agoFix typo
Ralf Jung [Sat, 29 Feb 2020 15:20:17 +0000 (16:20 +0100)]
Fix typo

Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
4 years agouse .copied() instead of .map(|x| *x) on iterators
Matthias Krüger [Sat, 29 Feb 2020 12:14:52 +0000 (13:14 +0100)]
use .copied() instead of .map(|x| *x) on iterators

4 years agoAuto merge of #69260 - GuillaumeGomez:create-E0747-error-code, r=varkor,estebank
bors [Sat, 29 Feb 2020 13:59:45 +0000 (13:59 +0000)]
Auto merge of #69260 - GuillaumeGomez:create-E0747-error-code, r=varkor,estebank

Create E0747 error code for unterminated raw strings

Reopening of #66035.

r? @estebank

4 years agofix aliasing violation in align_to_mut
Ralf Jung [Sat, 29 Feb 2020 12:39:47 +0000 (13:39 +0100)]
fix aliasing violation in align_to_mut

4 years agocorrect comment to match behavior
Zan Tysor [Sat, 29 Feb 2020 13:40:09 +0000 (08:40 -0500)]
correct comment to match behavior

4 years agoAdd regression test
LeSeulArtichaut [Sat, 29 Feb 2020 13:38:39 +0000 (14:38 +0100)]
Add regression test

4 years agoDo not ICE on invalid type node
LeSeulArtichaut [Sat, 29 Feb 2020 13:19:48 +0000 (14:19 +0100)]
Do not ICE on invalid type node

4 years agoclarify alignment requirements in Vec::from_raw_parts
Ralf Jung [Sat, 29 Feb 2020 13:07:20 +0000 (14:07 +0100)]
clarify alignment requirements in Vec::from_raw_parts

4 years agotransmute: improve Vec example
Ralf Jung [Sat, 29 Feb 2020 13:03:25 +0000 (14:03 +0100)]
transmute: improve Vec example

4 years agoparser: Remove `Parser::prev_span`
Vadim Petrochenkov [Sat, 29 Feb 2020 11:59:37 +0000 (14:59 +0300)]
parser: Remove `Parser::prev_span`

4 years agoparser: `prev_span` -> `prev_token.span`
Vadim Petrochenkov [Sat, 29 Feb 2020 11:56:15 +0000 (14:56 +0300)]
parser: `prev_span` -> `prev_token.span`

4 years agoAuto merge of #69570 - Dylan-DPC:rollup-d6boczt, r=Dylan-DPC
bors [Sat, 29 Feb 2020 10:43:32 +0000 (10:43 +0000)]
Auto merge of #69570 - Dylan-DPC:rollup-d6boczt, r=Dylan-DPC

Rollup of 6 pull requests

Successful merges:

 - #69477 (docs: add mention of async blocks in move keyword docs)
 - #69504 (Use assert_ne in hash tests)
 - #69546 (use to_vec() instead of .iter().cloned().collect() to convert slices to vecs.)
 - #69551 (use is_empty() instead of len() == x  to determine if structs are empty.)
 - #69563 (Fix no_std detection for target triples)
 - #69567 (use .to_string() instead of format!() macro to create strings)

Failed merges:

r? @ghost

4 years agoAuto merge of #69227 - Marwes:buffer_stderr, r=varkor
bors [Sat, 29 Feb 2020 07:27:29 +0000 (07:27 +0000)]
Auto merge of #69227 - Marwes:buffer_stderr, r=varkor

perf: Buffer stderr when writing json errors/warnings

Since `stderr` is unbuffered, writing out json messages actually take up
about ~10%/0.1s of the runtime of the `inflate` benchmark as it generates a fair number of warnings.

cc #64413

4 years agoProcess `RequiresStorage` results in pre-order
Dylan MacKenzie [Sat, 29 Feb 2020 04:57:36 +0000 (20:57 -0800)]
Process `RequiresStorage` results in pre-order

Reverse post-order requires an allocation.

4 years agoReduce visibility of `get_module_parent_node` and remove `get_module_parent`
John Kåre Alsaker [Sat, 22 Feb 2020 18:53:10 +0000 (19:53 +0100)]
Reduce visibility of `get_module_parent_node` and remove `get_module_parent`

4 years agoAdd a `parent_module_from_def_id` query
John Kåre Alsaker [Tue, 11 Feb 2020 13:38:16 +0000 (14:38 +0100)]
Add a `parent_module_from_def_id` query

4 years agoAuto merge of #69255 - estebank:e0599-details, r=varkor
bors [Sat, 29 Feb 2020 03:52:53 +0000 (03:52 +0000)]
Auto merge of #69255 - estebank:e0599-details, r=varkor

Add more context to E0599 errors

Point at the intermediary unfulfilled trait bounds.

Fix #52523, fix #61661, cc #36513, fix #68131, fix #64417, fix #61768, cc #57457, cc #9082, fix #57994, cc #64934, cc #65149.

4 years agouse .iter() instead of .into_iter() on references.
Matthias Krüger [Sat, 29 Feb 2020 02:05:14 +0000 (03:05 +0100)]
use .iter() instead of .into_iter() on references.

4 years agodon't use question mark operator on Err(), return the Result directly instead.
Matthias Krüger [Sat, 29 Feb 2020 01:48:27 +0000 (02:48 +0100)]
don't use question mark operator on Err(), return the Result directly instead.

4 years agoRollup merge of #69567 - matthiaskrgr:useless_fmt, r=nagisa
Dylan DPC [Sat, 29 Feb 2020 01:16:24 +0000 (02:16 +0100)]
Rollup merge of #69567 - matthiaskrgr:useless_fmt, r=nagisa

use .to_string() instead of format!() macro to create strings

handles what is left after https://github.com/rust-lang/rust/pull/69541

4 years agoRollup merge of #69563 - andre-richter:fix_no_std_match, r=Mark-Simulacrum
Dylan DPC [Sat, 29 Feb 2020 01:16:23 +0000 (02:16 +0100)]
Rollup merge of #69563 - andre-richter:fix_no_std_match, r=Mark-Simulacrum

Fix no_std detection for target triples

The current check for wether a target is no_std or not is matching for the string `-none-` in a target triple. This doesn't work for triples that end in `-none`, like `aarch64-unknown-none`.

Fix this by matching for `-none` instead.

I checked for all the current target triples containing `none`, and this should not generate any false positives.

This fixes an issue encountered in https://github.com/rust-lang/rust/pull/68334

4 years agoRollup merge of #69551 - matthiaskrgr:len_zero, r=Mark-Simulacrum
Dylan DPC [Sat, 29 Feb 2020 01:16:21 +0000 (02:16 +0100)]
Rollup merge of #69551 - matthiaskrgr:len_zero, r=Mark-Simulacrum

use is_empty() instead of len() == x  to determine if structs are empty.

4 years agoRollup merge of #69546 - matthiaskrgr:slice_to_vec, r=davidtwco,nagisa
Dylan DPC [Sat, 29 Feb 2020 01:16:20 +0000 (02:16 +0100)]
Rollup merge of #69546 - matthiaskrgr:slice_to_vec, r=davidtwco,nagisa

use to_vec() instead of .iter().cloned().collect() to convert slices to vecs.

4 years agoRollup merge of #69504 - MichaelMcDonnell:hash_assert_ne, r=LukasKalbertodt
Dylan DPC [Sat, 29 Feb 2020 01:16:18 +0000 (02:16 +0100)]
Rollup merge of #69504 - MichaelMcDonnell:hash_assert_ne, r=LukasKalbertodt

Use assert_ne in hash tests

The hash tests were written before the assert_ne macro was added to the standard library. The assert_ne macro provides better output in case of a failure.

4 years agoRollup merge of #69477 - Pulkit07:issue69298, r=cramertj
Dylan DPC [Sat, 29 Feb 2020 01:16:17 +0000 (02:16 +0100)]
Rollup merge of #69477 - Pulkit07:issue69298, r=cramertj

docs: add mention of async blocks in move keyword docs

Fixes #69298

4 years agoremove unneeded .as_ref() calls.
Matthias Krüger [Sat, 29 Feb 2020 01:16:04 +0000 (02:16 +0100)]
remove unneeded .as_ref() calls.

4 years agouse .to_string() instead of format!() macro to create strings
Matthias Krüger [Fri, 28 Feb 2020 23:35:24 +0000 (00:35 +0100)]
use .to_string() instead of format!() macro to create strings

4 years agoAuto merge of #69208 - RalfJung:debug-assert, r=Mark-Simulacrum
bors [Sat, 29 Feb 2020 00:20:44 +0000 (00:20 +0000)]
Auto merge of #69208 - RalfJung:debug-assert, r=Mark-Simulacrum

debug_assert a few more raw pointer methods

Makes progress for https://github.com/rust-lang/rust/issues/53871

4 years agoFix no_std detection for target triples
Andre Richter [Fri, 28 Feb 2020 20:51:16 +0000 (21:51 +0100)]
Fix no_std detection for target triples

The current check for wether a target is no_std or not is matching for the
string "-none-" in a target triple. This doesn't work for triples that end in
"-none", like "aarch64-unknown-none".

Fix this by matching for "-none" instead.

I checked for all the current target triples containing "none", and this should
not generate any false positives.

This fixes an issue encountered in https://github.com/rust-lang/rust/pull/68334

4 years agoDon't bug when taking discriminant of generator
Dylan MacKenzie [Fri, 28 Feb 2020 20:06:06 +0000 (12:06 -0800)]
Don't bug when taking discriminant of generator

4 years agoIgnore output for some platforms with diverging test output
Esteban Küber [Fri, 28 Feb 2020 20:01:29 +0000 (12:01 -0800)]
Ignore output for some platforms with diverging test output

Get around #53081.

4 years agoDo not suggest implementing traits if present in predicates
Esteban Küber [Tue, 25 Feb 2020 20:10:48 +0000 (12:10 -0800)]
Do not suggest implementing traits if present in predicates

4 years agoReword message
Esteban Küber [Tue, 25 Feb 2020 20:08:22 +0000 (12:08 -0800)]
Reword message

4 years agoReduce verbosity when suggesting restricting type params
Esteban Küber [Tue, 25 Feb 2020 07:25:54 +0000 (23:25 -0800)]
Reduce verbosity when suggesting restricting type params

4 years agokeep predicate order and tweak output
Esteban Küber [Tue, 25 Feb 2020 02:55:51 +0000 (18:55 -0800)]
keep predicate order and tweak output

4 years agoReview comments: split requirement text to multiple lines for readability
Esteban Küber [Fri, 21 Feb 2020 21:39:47 +0000 (13:39 -0800)]
Review comments: split requirement text to multiple lines for readability

4 years agoAccount for arbitrary self types in E0599
Esteban Küber [Wed, 19 Feb 2020 23:57:21 +0000 (15:57 -0800)]
Account for arbitrary self types in E0599

4 years agoSuggest constraining type parameters
Esteban Küber [Wed, 19 Feb 2020 22:26:46 +0000 (14:26 -0800)]
Suggest constraining type parameters

4 years agoTweak wording
Esteban Küber [Wed, 19 Feb 2020 02:36:56 +0000 (18:36 -0800)]
Tweak wording

4 years agoMention the full path of the implementing trait
Esteban Küber [Wed, 19 Feb 2020 02:20:23 +0000 (18:20 -0800)]
Mention the full path of the implementing trait

4 years agoPoint at closure definitions
Esteban Küber [Wed, 19 Feb 2020 02:06:03 +0000 (18:06 -0800)]
Point at closure definitions

4 years agoShow information of chain of bound obligations
Esteban Küber [Wed, 19 Feb 2020 01:53:25 +0000 (17:53 -0800)]
Show information of chain of bound obligations

When the obligation that couldn't be fulfilled is specific to a nested
obligation, maintain both the nested and parent obligations around for
more accurate and detailed error reporting.

4 years agoTrack all predicates in errors, not just trait obligations
Esteban Küber [Wed, 19 Feb 2020 00:35:47 +0000 (16:35 -0800)]
Track all predicates in errors, not just trait obligations

Surface associated type projection bounds that could not be fulfilled in
E0599 errors. Always present the list of unfulfilled trait bounds,
regardless of whether we're pointing at the ADT or trait that didn't
satisfy it.

4 years agoDeduplicate information in E0599
Esteban Küber [Tue, 18 Feb 2020 10:13:30 +0000 (02:13 -0800)]
Deduplicate information in E0599

4 years agoOn single local candidate, use span label
Esteban Küber [Tue, 18 Feb 2020 09:35:18 +0000 (01:35 -0800)]
On single local candidate, use span label

4 years agoReduce vebosity of E0599
Esteban Küber [Tue, 18 Feb 2020 07:59:21 +0000 (23:59 -0800)]
Reduce vebosity of E0599

4 years agoAdd more context to E0599 errors
Esteban Küber [Tue, 18 Feb 2020 07:22:19 +0000 (23:22 -0800)]
Add more context to E0599 errors

Point at the intermediary unfullfilled trait bounds.

4 years agoAuto merge of #69555 - Centril:rollup-e53lxz4, r=Centril
bors [Fri, 28 Feb 2020 17:53:10 +0000 (17:53 +0000)]
Auto merge of #69555 - Centril:rollup-e53lxz4, r=Centril

Rollup of 10 pull requests

Successful merges:

 - #68989 (Update RELEASES.md for 1.42.0)
 - #69340 (instantiate_value_path: on `SelfCtor`, avoid unconstrained tyvars)
 - #69384 (parser: `token` -> `normalized_token`, `nonnormalized_token` -> `token`)
 - #69452 (typeck: use `Pattern` obligation cause more for better diagnostics)
 - #69481 (use char instead of &str for single char patterns)
 - #69522 (error_derive_forbidden_on_non_adt: be more graceful)
 - #69538 (Stabilize `boxed_slice_try_from`)
 - #69539 (late resolve, visit_fn: bail early if there's no body.)
 - #69541 (Remove unneeded calls to format!())
 - #69547 (remove redundant clones, references to operands, explicit boolean comparisons and filter(x).next() calls.)

Failed merges:

r? @ghost

4 years agosimplify condition in start_executing_work()
Matthias Krüger [Fri, 28 Feb 2020 17:09:29 +0000 (18:09 +0100)]
simplify condition in start_executing_work()

4 years agoRollup merge of #69547 - matthiaskrgr:more_misc, r=Mark-Simulacrum
Mazdak Farrokhzad [Fri, 28 Feb 2020 16:17:38 +0000 (17:17 +0100)]
Rollup merge of #69547 - matthiaskrgr:more_misc, r=Mark-Simulacrum

remove redundant clones, references to operands, explicit boolean comparisons and filter(x).next() calls.

4 years agoRollup merge of #69541 - dotdash:format, r=Mark-Simulacrum
Mazdak Farrokhzad [Fri, 28 Feb 2020 16:17:36 +0000 (17:17 +0100)]
Rollup merge of #69541 - dotdash:format, r=Mark-Simulacrum

Remove unneeded calls to format!()

4 years agoRollup merge of #69539 - Centril:fix-69401, r=petrochenkov
Mazdak Farrokhzad [Fri, 28 Feb 2020 16:17:34 +0000 (17:17 +0100)]
Rollup merge of #69539 - Centril:fix-69401, r=petrochenkov

late resolve, visit_fn: bail early if there's no body.

Fixes https://github.com/rust-lang/rust/issues/69401 which was injected by https://github.com/rust-lang/rust/commit/b2c6eeb713d4cf9b35b7dda6ff2b0274e7f24684 in https://github.com/rust-lang/rust/pull/68788.

r? @petrochenkov

4 years agoRollup merge of #69538 - JohnTitor:boxed-slice-try-from, r=Centril
Mazdak Farrokhzad [Fri, 28 Feb 2020 16:17:33 +0000 (17:17 +0100)]
Rollup merge of #69538 - JohnTitor:boxed-slice-try-from, r=Centril

Stabilize `boxed_slice_try_from`

Closes #69202

4 years agoRollup merge of #69522 - Centril:fix-69341, r=petrochenkov
Mazdak Farrokhzad [Fri, 28 Feb 2020 16:17:31 +0000 (17:17 +0100)]
Rollup merge of #69522 - Centril:fix-69341, r=petrochenkov

error_derive_forbidden_on_non_adt: be more graceful

Fixes #69341 which was injected by #67052.

r? @petrochenkov

4 years agoRollup merge of #69481 - matthiaskrgr:single_char, r=ecstatic-morse
Mazdak Farrokhzad [Fri, 28 Feb 2020 16:17:30 +0000 (17:17 +0100)]
Rollup merge of #69481 - matthiaskrgr:single_char, r=ecstatic-morse

use char instead of &str for single char patterns

4 years agoRollup merge of #69452 - Centril:typeck-pat, r=estebank
Mazdak Farrokhzad [Fri, 28 Feb 2020 16:17:28 +0000 (17:17 +0100)]
Rollup merge of #69452 - Centril:typeck-pat, r=estebank

typeck: use `Pattern` obligation cause more for better diagnostics

r? @estebank

4 years agoRollup merge of #69384 - petrochenkov:nounnorm, r=Centril
Mazdak Farrokhzad [Fri, 28 Feb 2020 16:17:26 +0000 (17:17 +0100)]
Rollup merge of #69384 - petrochenkov:nounnorm, r=Centril

parser: `token` -> `normalized_token`, `nonnormalized_token` -> `token`

So, after https://github.com/rust-lang/rust/pull/69006, its follow-ups and an attempt to remove `Parser::prev_span` I came to the conclusion that the unnormalized token and its span is what you want in most cases, so it should be default.

Normalization only makes difference in few cases where we are checking against `token::Ident` or `token::Lifetime` specifically.
This PR uses `normalized_token` for those cases.

Using normalization explicitly means that people writing code should remember about `NtIdent` and `NtLifetime` in general. (That is alleviated by the fact that `token.ident()` and `fn parse_ident_*` are already written.)
Remembering about `NtIdent`, was, however, already the case, kind of, because the implicit normalization was performed only for the current/previous token, but not for things like `look_ahead`.
As a result, most of token classification methods in `token.rs` already take `NtIdent` into account (this PR fixes a few pre-existing minor mistakes though).

The next step is removing `normalized(_prev)_token` entirely and replacing it with `token.ident()` (mostly) and `token.normalize()` (occasionally).
I want to make it a separate PR for that and run it though perf.
`normalized_token` filled on every bump has both a potential to avoid repeated normalization, and to do unnecessary work in advance (it probably doesn't matter anyway, the normalization is very cheap).

r? @Centril

4 years agoRollup merge of #69340 - Centril:self-ctor-normalize, r=nikomatsakis
Mazdak Farrokhzad [Fri, 28 Feb 2020 16:17:25 +0000 (17:17 +0100)]
Rollup merge of #69340 - Centril:self-ctor-normalize, r=nikomatsakis

instantiate_value_path: on `SelfCtor`, avoid unconstrained tyvars

Fixes https://github.com/rust-lang/rust/issues/69306.

On `Self(...)` (that is, a `Res::SelfCtor`), do not use `self.impl_self_ty(...)`. The problem with that method is that it creates unconstrained inference variables for type parameters in the `impl` (e.g. `impl<T> S0<T>`). These variables then eventually get substituted for something else when they come in contact with the expected type (e.g. `S0<u8>`) or merely the arguments passed to the tuple constructor (e.g. the `0` in `Self(0)`).

Instead of using `self.impl_self_ty(...)`, we instead merely use `let ty = self.normalize_ty(span, tcx.at(span).type_of(impl_def_id));` to get the rewritten `res`.

r? @eddyb

4 years agoRollup merge of #68989 - XAMPPRocky:relnotes-1.42.0, r=Mark-Simulacrum
Mazdak Farrokhzad [Fri, 28 Feb 2020 16:17:23 +0000 (17:17 +0100)]
Rollup merge of #68989 - XAMPPRocky:relnotes-1.42.0, r=Mark-Simulacrum

Update RELEASES.md for 1.42.0

### [Rendered](https://github.com/XAMPPRocky/rust/blob/relnotes-1.42.0/RELEASES.md)

r? @Mark-Simulacrum
cc @rust-lang/release

4 years agoWording improvement
Guillaume Gomez [Thu, 27 Feb 2020 10:12:01 +0000 (11:12 +0100)]
Wording improvement

4 years agoUpdate UI tests
Guillaume Gomez [Tue, 18 Feb 2020 13:50:48 +0000 (14:50 +0100)]
Update UI tests

4 years agoAdd explanation for E0747
Guillaume Gomez [Tue, 18 Feb 2020 13:50:40 +0000 (14:50 +0100)]
Add explanation for E0747

4 years agoAdd E0747 error code
Guillaume Gomez [Tue, 18 Feb 2020 13:50:27 +0000 (14:50 +0100)]
Add E0747 error code

4 years agoAuto merge of #69148 - estebank:cold-as-ice, r=oli-obk
bors [Fri, 28 Feb 2020 14:24:57 +0000 (14:24 +0000)]
Auto merge of #69148 - estebank:cold-as-ice, r=oli-obk

Account for bounds and asociated items when denying `_`

Fix #68801, #69204. Follow up to #67597 and #68071.

Output for the original ICE report:

```
    Checking vinoteca v5.0.0 (/Users/ekuber/workspace/vinoteca)
error[E0121]: the type placeholder `_` is not allowed within types on item signatures
  --> src/producers.rs:43:70
   |
43 | pub fn top<Table: diesel::Table + diesel::query_dsl::InternalJoinDsl<_, diesel::query_source::joins::Inner, _>>(table: Table, limit: usize, connection: DbConn) -> RestResult<Vec<TopWineType>> {
   |                                                                      ^ not allowed in type signatures       ^ not allowed in type signatures

error: aborting due to previous error
```