Commit Graph

100817 Commits

Author SHA1 Message Date
Tyler Mandry
8f09085bb0
Rollup merge of #65265 - GuillaumeGomez:cleanup-librustc_mir-err-codes, r=Mark-Simulacrum
Cleanup librustc mir err codes

Three things are done in this PR:

 * Sort error codes
 * Uncomment an error code long error explanation (they should **never** be commented)
 * Unify explanations
2019-10-15 16:07:46 -07:00
Tyler Mandry
ef9d6ee8ad
Rollup merge of #65242 - estebank:contrain-trait-sugg, r=varkor
Fix suggestion to constrain trait for method to be found

Fix #65044.
2019-10-15 16:07:44 -07:00
Tyler Mandry
bbf4eb3fc2
Rollup merge of #65235 - nikomatsakis:issue-65159-async-fn-return-ice, r=cramertj
don't assume we can *always* find a return type hint in async fn

In particular, we sometimes cannot if there is an earlier error.

Fixes #65159

r? @cramertj, who reviewed the original PR
2019-10-15 16:07:43 -07:00
Tyler Mandry
af3d9e57e7
Rollup merge of #64623 - matthewjasper:underscore-imports, r=petrochenkov
Remove last uses of gensyms

Underscore bindings now use unique `SyntaxContext`s to avoid collisions. This was the last use of gensyms in the compiler, so this PR also removes them.

closes #49300
cc #60869

r? @petrochenkov
2019-10-15 16:07:41 -07:00
Tyler Mandry
fcef4b1aef
Rollup merge of #64603 - gilescope:unused-lifetime-warning, r=matthewjasper
Reducing spurious unused lifetime warnings.

Fixes #61115, fixes #64493.
2019-10-15 16:07:39 -07:00
Manish Goregaokar
33543ed122 Update clippy 2019-10-15 13:52:34 -07:00
Matthew Jasper
4198df1f4b Remove some mentions of gensyms 2019-10-15 21:12:05 +01:00
Matthew Jasper
94967f23f7 Remove gensyms 2019-10-15 21:12:05 +01:00
Matthew Jasper
1a2597b64a Don't use gensym_if_underscore to resolve _ bindings
Instead add a disambiguator to the keys used for distinguishing
resolutions.
2019-10-15 21:12:04 +01:00
Nicholas Nethercote
60851b08e5 Optimize BitSet iteration.
This commit removes an `Option` check in `BitIter::next()`, avoids
calling `trailing_zeros()` when it's not necessary, and avoids the need
for `enumerate()`. This gives a tiny (0.2%) instruction count win on a
couple of benchmarks.

The commit also adds some comments, which is good because this iteration
code is moderately complex.
2019-10-16 06:53:08 +11:00
Nicholas Nethercote
2918a7d5a9 Add BitIter::new().
This factors out some duplicated code.
2019-10-16 06:19:41 +11:00
Santiago Pastorino
fa3a4aeae5
Implement AsRef<[T]> for List<T> 2019-10-15 14:43:24 -03:00
Giles Cope
d82c1c546d Avoid unused lifetime warning for lifetimes introduced when desugering async. 2019-10-15 18:05:13 +01:00
wangxiangqing
fe819a074c Collect occurrences of for mismatched braces diagnostic
Change-Id: I20ba0b62308370ee961141fa1aefc4b9c9f0cb3a
2019-10-15 23:59:22 +08:00
Eduard-Mihai Burtescu
d89dddc920 rustc_metadata: address some review comments. 2019-10-15 18:23:51 +03:00
Eduard-Mihai Burtescu
34066d60c3 rustc_metadata: don't use more space than needed, for each Table. 2019-10-15 18:23:51 +03:00
Eduard-Mihai Burtescu
ee747f645f rustc_metadata: replace Entry table with one table for each of its fields (AoS -> SoA). 2019-10-15 18:23:51 +03:00
Eduard-Mihai Burtescu
972b93b20e rustc_metadata: use decoder::Metadata instead of &[u8] for Lazy<Table<T>>::get. 2019-10-15 18:23:51 +03:00
Eduard-Mihai Burtescu
cef4950280 rustc_metadata: generalize Table<T> to hold T, not Lazy<T>, elements. 2019-10-15 18:23:51 +03:00
Eduard-Mihai Burtescu
677f0df63b rustc_metadata: add a helper macro for recording into PerDefTable's. 2019-10-15 18:23:51 +03:00
Eduard-Mihai Burtescu
5d52a7e0d0 rustc_metadata: split tables into an usize-keyed Table and a DefIndex-keyed PerDefTable. 2019-10-15 18:23:51 +03:00
Eduard-Mihai Burtescu
dd1264e90a rustc_metadata: replace Lazy<[Table<T>]> with Lazy<Table<T>>. 2019-10-15 18:23:51 +03:00
Eduard-Mihai Burtescu
ffd18fc22c rustc_metadata: parametrize Table by element type. 2019-10-15 18:23:51 +03:00
Eduard-Mihai Burtescu
f49274032b rustc_metadata: rename index::Index to table::Table. 2019-10-15 18:23:50 +03:00
Eduard-Mihai Burtescu
83b3c39218 rustc_metadata: use 0 in index::Index to indicate missing entries. 2019-10-15 18:23:50 +03:00
Eduard-Mihai Burtescu
ea134563e7 rustc_metadata: use NonZeroUsize for the position of a Lazy. 2019-10-15 18:23:50 +03:00
Eduard-Mihai Burtescu
e505857914 rustc_metadata: remove now-redundant length from the start of the encoding. 2019-10-15 18:23:50 +03:00
bors
237d54ff6c Auto merge of #65433 - Centril:rollup-rzvry15, r=Centril
Rollup of 4 pull requests

Successful merges:

 - #64035 (Stabilize proc macros generating `macro_rules` items)
 - #65376 (syntax: misc extractions)
 - #65426 (Remove custom `PartialEq` impls for `LocalInternedString`.)
 - #65428 (Refactor: Rename `db` locals to `diag`)

Failed merges:

r? @ghost
2019-10-15 15:14:43 +00:00
Esteban Küber
dee53d7c90 Fix suggestion to constrain trait for method to be found 2019-10-15 08:02:49 -07:00
Mazdak Farrokhzad
1fb8cfb481 Organize never_type tests
Also move {run-fail -> ui}/never_type
2019-10-15 16:58:14 +02:00
phosphorus
53187c5753 Slides path lifetime to the lifetime resolver
add test to for the fix

add descriptive text for the fix

simplified code logics

update descriptive comments

update to cope with the tidyness requirement

merged commit suggestions

Co-Authored-By: varkor <github@varkor.com>

truncated redundant comments

update to cope with tidy-check
2019-10-15 13:59:32 +00:00
Mazdak Farrokhzad
8370f14225 Remove unnecessary use crate::sess::ParseSess;. 2019-10-15 13:28:13 +02:00
Mazdak Farrokhzad
96d640971a
Rollup merge of #65428 - phansch:rename_db_var, r=Centril
Refactor: Rename `db` locals to `diag`

https://github.com/rust-lang/rust/pull/64272 replaced `DiagnosticBuilder` with `Diagnostic` in some places. This PR just renames the db variable from `db` to `diag` where it wasn't renamed.

r? @Mark-Simulacrum
2019-10-15 13:27:30 +02:00
Mazdak Farrokhzad
bc3e97a277
Rollup merge of #65426 - nnethercote:rm-custom-LocalInternedString-PartialEq-impls, r=petrochenkov
Remove custom `PartialEq` impls for `LocalInternedString`.

This is on-trend with the recent changes simplifying
`LocalInternedString` and reducing its use.

r? @petrochenkov
2019-10-15 13:27:29 +02:00
Mazdak Farrokhzad
d24c66fba3
Rollup merge of #65376 - Centril:syntax-extractions-1, r=petrochenkov
syntax: misc extractions

Part of https://github.com/rust-lang/rust/pull/65324.

r? @petrochenkov
2019-10-15 13:27:28 +02:00
Mazdak Farrokhzad
19d4e2f3e0
Rollup merge of #64035 - petrochenkov:stabmacgen, r=eddyb
Stabilize proc macros generating `macro_rules` items

Fn-like and attribute proc macros can now generate `macro_rules` items.

cc #54727
2019-10-15 13:27:27 +02:00
bors
437ca55f23 Auto merge of #65412 - RalfJung:miri, r=RalfJung
update miri

Fixes https://github.com/rust-lang/rust/issues/65356.
2019-10-15 11:23:12 +00:00
Mazdak Farrokhzad
ae156a56d4 syntax::parse::sess -> syntax::sess 2019-10-15 09:41:58 +02:00
Mazdak Farrokhzad
79d02867b8 move parse_lit to expr.rs 2019-10-15 09:27:52 +02:00
Mazdak Farrokhzad
52d0e86b9a syntax: extract sess.rs for ParseSess 2019-10-15 09:25:56 +02:00
Mazdak Farrokhzad
c29fe81ec4 move maybe_report_invalid_custom_discriminants to feature_gate 2019-10-15 09:22:13 +02:00
Vadim Petrochenkov
d80be3b4ff Test basic hygiene for macro_rules produced by transparent macros 2019-10-15 10:03:51 +03:00
Vadim Petrochenkov
b39e188dda Stabilize proc macros generating macro_rules items 2019-10-15 10:03:51 +03:00
Philipp Hansch
6c75e81561
Refactor: Rename db locals to diag
https://github.com/rust-lang/rust/pull/64272 replaced
`DiagnosticBuilder` with `Diagnostic` in some places. This commit just
renames the DB variable from `db` to `diag` where it wasn't renamed.
2019-10-15 08:19:43 +02:00
Nicholas Nethercote
57d33b155f Remove custom PartialEq impls for LocalInternedString.
This is on-trend with the recent changes simplifying
`LocalInternedString` and reducing its use.
2019-10-15 14:23:27 +11:00
bors
e369d87b01 Auto merge of #65422 - tmandry:rollup-r5u3mlc, r=tmandry
Rollup of 10 pull requests

Successful merges:

 - #65170 (rustc_metadata: Privatize private code and remove dead code)
 - #65260 (Optimize `LexicalResolve::expansion`.)
 - #65261 (Remove `Option` from `TokenStream`)
 - #65332 (std::fmt: reorder docs)
 - #65340 (Several changes to the codegen backend organization)
 - #65365 (Include const generic arguments in metadata)
 - #65398 (Bring attention to suggestions when the only difference is capitalization)
 - #65410 (syntax: add parser recovery for intersection- / and-patterns `p1 @ p2`)
 - #65415 (Remove an outdated test output file)
 - #65416 (Minor sync changes)

Failed merges:

r? @ghost
2019-10-15 00:54:10 +00:00
Tyler Mandry
9422feb433
Rollup merge of #65416 - spastorino:minor-sync-changes, r=Mark-Simulacrum
Minor sync changes

r? @Mark-Simulacrum
2019-10-14 17:52:45 -07:00
Tyler Mandry
ae5093d62d
Rollup merge of #65415 - petrochenkov:rmtest, r=varkor
Remove an outdated test output file

It was accidentally introduced during some rebase, but it's no longer necessary and `--bless` removes it, but it doesn't fail testing.
2019-10-14 17:52:44 -07:00
Tyler Mandry
1b182371e1
Rollup merge of #65410 - Centril:intersection-pat-recover, r=davidtwco,varkor
syntax: add parser recovery for intersection- / and-patterns `p1 @ p2`

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

The recovery comes in two flavors:

1. We know that `p2` is a binding so we can invert as `p2 @ p1`:

```rust
error: pattern on wrong side of `@`
  --> $DIR/intersection-patterns.rs:13:9
   |
LL |         Some(x) @ y => {}
   |         -------^^^-
   |         |         |
   |         |         binding on the right, should be to the left
   |         pattern on the left, should be to the right
   |         help: switch the order: `y @ Some(x)`
```

2. Otherwise we emit a generic diagnostic for the lack of support for intersection patterns:

```rust
error: left-hand side of `@` must be a binding
  --> $DIR/intersection-patterns.rs:23:9
   |
LL |         Some(x) @ Some(y) => {}
   |         -------^^^-------
   |         |         |
   |         |         also a pattern
   |         interpreted as a pattern, not a binding
   |
   = note: bindings are `x`, `mut x`, `ref x`, and `ref mut x`
```

For more on and-patterns, see e.g. https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/pattern-matching#and-pattern.

r? @davidtwco
cc @varkor @lzutao
2019-10-14 17:52:42 -07:00
Tyler Mandry
a14e35f382
Rollup merge of #65398 - estebank:capitalization-only, r=varkor
Bring attention to suggestions when the only difference is capitalization

CC #65386.
2019-10-14 17:52:41 -07:00