]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoadded `try_find_description` to distinguish no desc from invalid code
Jake Vossen [Fri, 28 Feb 2020 22:32:09 +0000 (15:32 -0700)]
added `try_find_description` to distinguish no desc from invalid 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 agoClean up E0375 explanation
Guillaume Gomez [Sat, 29 Feb 2020 11:18:46 +0000 (12:18 +0100)]
Clean up E0375 explanation

4 years agoClean up E0374 explanation
Guillaume Gomez [Fri, 28 Feb 2020 15:06:30 +0000 (16:06 +0100)]
Clean up E0374 explanation

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 agosimplify boolean expressions
Matthias Krüger [Sat, 29 Feb 2020 00:56:37 +0000 (01:56 +0100)]
simplify boolean expressions

4 years agodowngrade some assertions to debug_ again
Ralf Jung [Sat, 29 Feb 2020 09:25:57 +0000 (10:25 +0100)]
downgrade some assertions to debug_ again

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 agoRemove trailing whitespace
Youngsuk Kim [Sat, 29 Feb 2020 05:55:05 +0000 (00:55 -0500)]
Remove trailing whitespace

Removed trailing whitespace which caused to fail pretty-check

4 years agoUpdate src/liballoc/vec.rs
Youngsuk Kim [Sat, 29 Feb 2020 05:52:32 +0000 (00:52 -0500)]
Update src/liballoc/vec.rs

Following suggestion from @jonas-schievink

Co-Authored-By: Jonas Schievink <jonasschievink@gmail.com>
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 agoClarify explanation of 'fn resize'
Youngsuk Kim [Sat, 29 Feb 2020 00:28:26 +0000 (19:28 -0500)]
Clarify explanation of 'fn resize'

1. Clarified on what should implement 'Clone' trait.
2. Minor grammar fix:
to be able clone => to be able to clone

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 agomiri engine: turn some debug_assert into assert
Ralf Jung [Fri, 28 Feb 2020 21:54:10 +0000 (22:54 +0100)]
miri engine: turn some debug_assert into assert

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 agomove ZST assertion up, for better errors
Ralf Jung [Fri, 28 Feb 2020 13:08:48 +0000 (14:08 +0100)]
move ZST assertion up, for better errors

4 years agoremove ScalarMaybeUndef::to_bits and make Scalar::to_bits private
Ralf Jung [Fri, 28 Feb 2020 10:04:12 +0000 (11:04 +0100)]
remove ScalarMaybeUndef::to_bits and make Scalar::to_bits private

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
```

4 years agouse is_empty() instead of len() == x to determine if structs are empty.
Matthias Krüger [Fri, 28 Feb 2020 13:20:33 +0000 (14:20 +0100)]
use is_empty() instead of len() == x  to determine if structs are empty.

4 years agoImprove MinGW detection when cross compiling
Mateusz Mikuła [Fri, 28 Feb 2020 13:15:06 +0000 (14:15 +0100)]
Improve MinGW detection when cross compiling

4 years agoremove redundant clones, references to operands, explicit boolean comparisons and...
Matthias Krüger [Fri, 28 Feb 2020 12:36:45 +0000 (13:36 +0100)]
remove redundant clones, references to operands, explicit boolean comparisons and filter(x).next() calls.

4 years agouse to_vec() instead of .iter().cloned().collect() to convert slices to vecs.
Matthias Krüger [Fri, 28 Feb 2020 12:19:30 +0000 (13:19 +0100)]
use to_vec() instead of .iter().cloned().collect() to convert slices to vecs.

4 years agoUnrevert "Remove `checked_add` in `Layout::repeat`"
Remy Rakic [Fri, 28 Feb 2020 11:22:28 +0000 (12:22 +0100)]
Unrevert "Remove `checked_add` in `Layout::repeat`"

4 years agodocs: add mention of async blocks in move keyword docs
Pulkit Goyal [Wed, 26 Feb 2020 08:30:35 +0000 (14:00 +0530)]
docs: add mention of async blocks in move keyword docs

Fixes #69298

4 years agoAuto merge of #68827 - ssomers:btree_navigation_revisited, r=Mark-Simulacrum
bors [Fri, 28 Feb 2020 09:32:34 +0000 (09:32 +0000)]
Auto merge of #68827 - ssomers:btree_navigation_revisited, r=Mark-Simulacrum

BTreeMap navigation done safer & faster

It turns out that there was a faster way to do the tree navigation code bundled in #67073, by moving from edge to KV and from KV to next edge separately. It extracts most of the code as safe functions, and contains the duplication of handles within the short wrapper functions.

This somehow hits a sweet spot in the compiler because it reports boosts all over the board:
```
>cargo benchcmp pre3.txt posz4.txt --threshold 5
 name                                           pre3.txt ns/iter  posz4.txt ns/iter  diff ns/iter   diff %  speedup
 btree::map::first_and_last_0                   40                37                           -3   -7.50%   x 1.08
 btree::map::first_and_last_100                 58                44                          -14  -24.14%   x 1.32
 btree::map::iter_1000                          8,920             3,419                    -5,501  -61.67%   x 2.61
 btree::map::iter_100000                        1,069,290         411,615                -657,675  -61.51%   x 2.60
 btree::map::iter_20                            169               58                         -111  -65.68%   x 2.91
 btree::map::iter_mut_1000                      8,701             3,303                    -5,398  -62.04%   x 2.63
 btree::map::iter_mut_100000                    1,034,560         405,975                -628,585  -60.76%   x 2.55
 btree::map::iter_mut_20                        165               58                         -107  -64.85%   x 2.84
 btree::set::clone_100                          1,831             1,562                      -269  -14.69%   x 1.17
 btree::set::clone_100_and_clear                1,831             1,565                      -266  -14.53%   x 1.17
 btree::set::clone_100_and_into_iter            1,917             1,541                      -376  -19.61%   x 1.24
 btree::set::clone_100_and_pop_all              2,609             2,441                      -168   -6.44%   x 1.07
 btree::set::clone_100_and_remove_all           4,598             3,927                      -671  -14.59%   x 1.17
 btree::set::clone_100_and_remove_half          2,765             2,551                      -214   -7.74%   x 1.08
 btree::set::clone_10k                          191,610           164,616                 -26,994  -14.09%   x 1.16
 btree::set::clone_10k_and_clear                192,003           164,616                 -27,387  -14.26%   x 1.17
 btree::set::clone_10k_and_into_iter            200,037           163,010                 -37,027  -18.51%   x 1.23
 btree::set::clone_10k_and_pop_all              267,023           250,913                 -16,110   -6.03%   x 1.06
 btree::set::clone_10k_and_remove_all           536,230           464,100                 -72,130  -13.45%   x 1.16
 btree::set::clone_10k_and_remove_half          453,350           430,545                 -22,805   -5.03%   x 1.05
 btree::set::difference_random_100_vs_100       1,787             801                        -986  -55.18%   x 2.23
 btree::set::difference_random_100_vs_10k       2,978             2,696                      -282   -9.47%   x 1.10
 btree::set::difference_random_10k_vs_100       111,075           54,734                  -56,341  -50.72%   x 2.03
 btree::set::difference_random_10k_vs_10k       246,380           175,980                 -70,400  -28.57%   x 1.40
 btree::set::difference_staggered_100_vs_100    1,789             951                        -838  -46.84%   x 1.88
 btree::set::difference_staggered_100_vs_10k    2,798             2,606                      -192   -6.86%   x 1.07
 btree::set::difference_staggered_10k_vs_10k    176,452           97,401                  -79,051  -44.80%   x 1.81
 btree::set::intersection_100_neg_vs_10k_pos    34                32                           -2   -5.88%   x 1.06
 btree::set::intersection_100_pos_vs_100_neg    30                27                           -3  -10.00%   x 1.11
 btree::set::intersection_random_100_vs_100     1,537             613                        -924  -60.12%   x 2.51
 btree::set::intersection_random_100_vs_10k     2,793             2,649                      -144   -5.16%   x 1.05
 btree::set::intersection_random_10k_vs_10k     222,127           147,166                 -74,961  -33.75%   x 1.51
 btree::set::intersection_staggered_100_vs_100  1,447             622                        -825  -57.01%   x 2.33
 btree::set::intersection_staggered_100_vs_10k  2,606             2,382                      -224   -8.60%   x 1.09
 btree::set::intersection_staggered_10k_vs_10k  143,620           58,790                  -84,830  -59.07%   x 2.44
 btree::set::is_subset_100_vs_100               1,349             488                        -861  -63.83%   x 2.76
 btree::set::is_subset_100_vs_10k               1,720             1,428                      -292  -16.98%   x 1.20
 btree::set::is_subset_10k_vs_10k               135,984           48,527                  -87,457  -64.31%   x 2.80
```
The `first_and_last` ones are noise (they don't do iteration), the others seem genuine.
As always, approved by Miri.

Also, a separate commit with some more benchmarks of mutable behaviour (which also benefit).

r? @cuviper

4 years agoremove check_raw after reducing it to one use only
Ralf Jung [Fri, 28 Feb 2020 08:15:04 +0000 (09:15 +0100)]
remove check_raw after reducing it to one use only

4 years agoget rid of to_ptr
Ralf Jung [Fri, 28 Feb 2020 08:27:21 +0000 (09:27 +0100)]
get rid of to_ptr

4 years agoadd comment to check_data
Ralf Jung [Fri, 28 Feb 2020 08:21:25 +0000 (09:21 +0100)]
add comment to check_data

4 years agolate resolve, visit_fn: bail early if there's no body.
Mazdak Farrokhzad [Fri, 28 Feb 2020 06:58:37 +0000 (07:58 +0100)]
late resolve, visit_fn: bail early if there's no body.

4 years agoAuto merge of #68505 - skinny121:canonicalize-const-eval-inputs, r=nikomatsakis
bors [Fri, 28 Feb 2020 06:14:52 +0000 (06:14 +0000)]
Auto merge of #68505 - skinny121:canonicalize-const-eval-inputs, r=nikomatsakis

Canonicalize inputs to const eval where needed

Canonicalize inputs to const eval, so that they can contain inference variables. Which enables invoking const eval queries even if the current param env has inference variable within it, which can occur during trait selection.

This is a reattempt of #67717, in a far less invasive way.

Fixes #68477

r? @nikomatsakis
cc @eddyb

4 years agoStabilize `boxed_slice_try_from`
Yuki Okushi [Fri, 28 Feb 2020 04:28:09 +0000 (13:28 +0900)]
Stabilize `boxed_slice_try_from`

4 years agoAuto merge of #69534 - Dylan-DPC:rollup-fwa2lip, r=Dylan-DPC
bors [Fri, 28 Feb 2020 02:19:31 +0000 (02:19 +0000)]
Auto merge of #69534 - Dylan-DPC:rollup-fwa2lip, r=Dylan-DPC

Rollup of 9 pull requests

Successful merges:

 - #69379 (Fail on multiple declarations of `main`.)
 - #69430 (librustc_typeck: remove loop that never actually loops)
 - #69449 (Do not ping PR reviewers in toolstate breakage)
 - #69491 (rustc_span: Add `Symbol::to_ident_string` for use in diagnostic messages)
 - #69495 (don't take redundant references to operands)
 - #69496 (use find(x) instead of filter(x).next())
 - #69501 (note that find(f) is equivalent to filter(f).next() in the docs.)
 - #69527 (Ignore untracked paths when running `rustfmt` on repository.)
 - #69529 (don't use .into() to convert types into identical types.)

Failed merges:

r? @ghost