Commit Graph

107502 Commits

Author SHA1 Message Date
Vadim Petrochenkov
6054a30370 Make it build again 2020-02-29 20:47:10 +03:00
Vadim Petrochenkov
e94d3b70cb Move directory libsyntax -> librustc_ast 2020-02-29 20:47:10 +03:00
bors
e9bca510fe 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
2020-02-29 13:59:45 +00:00
bors
3f9bddc7fe 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
2020-02-29 10:43:32 +00:00
bors
04e7f96dd8 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
2020-02-29 07:27:29 +00:00
bors
55aee8d496 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.
2020-02-29 03:52:53 +00:00
Dylan DPC
bbfec7ca41
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
2020-02-29 02:16:24 +01:00
Dylan DPC
1bb6760968
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
2020-02-29 02:16:23 +01:00
Dylan DPC
c8db7dcc1c
Rollup merge of #69551 - matthiaskrgr:len_zero, r=Mark-Simulacrum
use is_empty() instead of len() == x  to determine if structs are empty.
2020-02-29 02:16:21 +01:00
Dylan DPC
ba2df27525
Rollup merge of #69546 - matthiaskrgr:slice_to_vec, r=davidtwco,nagisa
use to_vec() instead of .iter().cloned().collect() to convert slices to vecs.
2020-02-29 02:16:20 +01:00
Dylan DPC
2774d48337
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.
2020-02-29 02:16:18 +01:00
Dylan DPC
222aa62008
Rollup merge of #69477 - Pulkit07:issue69298, r=cramertj
docs: add mention of async blocks in move keyword docs

Fixes #69298
2020-02-29 02:16:17 +01:00
Matthias Krüger
85e59b7664 use .to_string() instead of format!() macro to create strings 2020-02-29 01:32:42 +01:00
bors
5703b7aafb 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
2020-02-29 00:20:44 +00:00
Andre Richter
7cf2bfb657
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
2020-02-28 21:51:16 +01:00
Esteban Küber
2fb35adc48 Ignore output for some platforms with diverging test output
Get around #53081.
2020-02-28 12:01:29 -08:00
Esteban Küber
a9a99df0a2 Do not suggest implementing traits if present in predicates 2020-02-28 11:37:59 -08:00
Esteban Küber
61bc7a3462 Reword message 2020-02-28 11:37:59 -08:00
Esteban Küber
a29f6916d8 Reduce verbosity when suggesting restricting type params 2020-02-28 11:37:59 -08:00
Esteban Küber
c764a82310 keep predicate order and tweak output 2020-02-28 11:37:59 -08:00
Esteban Küber
7c29441ef2 Review comments: split requirement text to multiple lines for readability 2020-02-28 11:37:59 -08:00
Esteban Küber
01286408c1 Account for arbitrary self types in E0599 2020-02-28 11:37:59 -08:00
Esteban Küber
392d853589 Suggest constraining type parameters 2020-02-28 11:37:59 -08:00
Esteban Küber
1e7bcc733a Tweak wording 2020-02-28 11:37:59 -08:00
Esteban Küber
0387f0d19b Mention the full path of the implementing trait 2020-02-28 11:37:59 -08:00
Esteban Küber
89e96e9bc5 Point at closure definitions 2020-02-28 11:37:59 -08:00
Esteban Küber
9a64c3f5cb 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.
2020-02-28 11:37:59 -08:00
Esteban Küber
8119d0853d 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.
2020-02-28 11:37:59 -08:00
Esteban Küber
ad4777dbca Deduplicate information in E0599 2020-02-28 11:37:59 -08:00
Esteban Küber
8993b99ae2 On single local candidate, use span label 2020-02-28 11:37:58 -08:00
Esteban Küber
5e8707f39d Reduce vebosity of E0599 2020-02-28 11:37:58 -08:00
Esteban Küber
f037d5ca1b Add more context to E0599 errors
Point at the intermediary unfullfilled trait bounds.
2020-02-28 11:37:58 -08:00
bors
0eb878d2aa 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
2020-02-28 17:53:10 +00:00
Matthias Krüger
1622b6ef73 simplify condition in start_executing_work() 2020-02-28 18:09:29 +01:00
Mazdak Farrokhzad
13e4c6c51f
Rollup merge of #69547 - matthiaskrgr:more_misc, r=Mark-Simulacrum
remove redundant clones, references to operands, explicit boolean comparisons and filter(x).next() calls.
2020-02-28 17:17:38 +01:00
Mazdak Farrokhzad
61b091b440
Rollup merge of #69541 - dotdash:format, r=Mark-Simulacrum
Remove unneeded calls to format!()
2020-02-28 17:17:36 +01:00
Mazdak Farrokhzad
b95945c8d6
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 b2c6eeb713 in https://github.com/rust-lang/rust/pull/68788.

r? @petrochenkov
2020-02-28 17:17:34 +01:00
Mazdak Farrokhzad
e4cedc9df2
Rollup merge of #69538 - JohnTitor:boxed-slice-try-from, r=Centril
Stabilize `boxed_slice_try_from`

Closes #69202
2020-02-28 17:17:33 +01:00
Mazdak Farrokhzad
87cc521b02
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
2020-02-28 17:17:31 +01:00
Mazdak Farrokhzad
07d9ed2c09
Rollup merge of #69481 - matthiaskrgr:single_char, r=ecstatic-morse
use char instead of &str for single char patterns
2020-02-28 17:17:30 +01:00
Mazdak Farrokhzad
a245221497
Rollup merge of #69452 - Centril:typeck-pat, r=estebank
typeck: use `Pattern` obligation cause more for better diagnostics

r? @estebank
2020-02-28 17:17:28 +01:00
Mazdak Farrokhzad
3828fa2852
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
2020-02-28 17:17:26 +01:00
Mazdak Farrokhzad
76fe449282
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
2020-02-28 17:17:25 +01:00
Mazdak Farrokhzad
bbf6eec281
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
2020-02-28 17:17:23 +01:00
Guillaume Gomez
e2738285ea Wording improvement 2020-02-28 16:01:04 +01:00
Guillaume Gomez
8ce9460b7a Update UI tests 2020-02-28 16:01:04 +01:00
Guillaume Gomez
f439de36af Add explanation for E0747 2020-02-28 16:01:04 +01:00
Guillaume Gomez
bae5f3976b Add E0747 error code 2020-02-28 16:01:04 +01:00
bors
eaa02f599f 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
```
2020-02-28 14:24:57 +00:00
Matthias Krüger
9523c89f18 use is_empty() instead of len() == x to determine if structs are empty. 2020-02-28 15:16:27 +01:00