]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agomove syntax::ext to new crate syntax_expand
Mazdak Farrokhzad [Wed, 16 Oct 2019 08:59:30 +0000 (10:59 +0200)]
move syntax::ext to new crate syntax_expand

4 years agosyntax::parse: don't depend on syntax::ext
Mazdak Farrokhzad [Tue, 8 Oct 2019 12:39:58 +0000 (14:39 +0200)]
syntax::parse: don't depend on syntax::ext

4 years agoattr: remove dep on ExtCtxt
Mazdak Farrokhzad [Tue, 8 Oct 2019 12:15:26 +0000 (14:15 +0200)]
attr: remove dep on ExtCtxt

4 years agoast: use more direct imports
Mazdak Farrokhzad [Tue, 8 Oct 2019 11:38:14 +0000 (13:38 +0200)]
ast: use more direct imports

4 years agosyntax: reduce visibilities
Mazdak Farrokhzad [Tue, 8 Oct 2019 07:35:34 +0000 (09:35 +0200)]
syntax: reduce visibilities

4 years agomove diagnostics.rs into parser/
Mazdak Farrokhzad [Tue, 8 Oct 2019 07:46:06 +0000 (09:46 +0200)]
move diagnostics.rs into parser/

4 years agosyntax: extract parse_cfg_attr
Mazdak Farrokhzad [Tue, 8 Oct 2019 07:14:07 +0000 (09:14 +0200)]
syntax: extract parse_cfg_attr

4 years agosyntax: extract parse_derive_paths
Mazdak Farrokhzad [Tue, 8 Oct 2019 07:06:07 +0000 (09:06 +0200)]
syntax: extract parse_derive_paths

4 years agomove parse::attr -> parse::parser::attr
Mazdak Farrokhzad [Tue, 8 Oct 2019 05:39:29 +0000 (07:39 +0200)]
move parse::attr -> parse::parser::attr

4 years agoAuto merge of #65450 - Manishearth:clippyup, r=Manishearth
bors [Wed, 16 Oct 2019 05:08:00 +0000 (05:08 +0000)]
Auto merge of #65450 - Manishearth:clippyup, r=Manishearth

Update clippy

Fixes #65446.
r? @ghost

4 years agoAuto merge of #65454 - tmandry:rollup-0k6jiik, r=tmandry
bors [Tue, 15 Oct 2019 23:09:33 +0000 (23:09 +0000)]
Auto merge of #65454 - tmandry:rollup-0k6jiik, r=tmandry

Rollup of 14 pull requests

Successful merges:

 - #64603 (Reducing spurious unused lifetime warnings.)
 - #64623 (Remove last uses of gensyms)
 - #65235 (don't assume we can *always* find a return type hint in async fn)
 - #65242 (Fix suggestion to constrain trait for method to be found)
 - #65265 (Cleanup librustc mir err codes)
 - #65293 (Optimize `try_expand_impl_trait_type`)
 - #65307 (Try fix incorrect "explicit lifetime name needed")
 - #65308 (Add long error explanation for E0574)
 - #65353 (save-analysis: Don't ICE when resolving qualified type paths in struct members)
 - #65389 (Return `false` from `needs_drop` for all zero-sized arrays.)
 - #65402 (Add troubleshooting section to PGO chapter in rustc book.)
 - #65425 (Optimize `BitIter`)
 - #65438 (Organize `never_type`  tests)
 - #65444 (Implement AsRef<[T]> for List<T>)

Failed merges:

 - #65390 (Add long error explanation for E0576)

r? @ghost

4 years agoRollup merge of #65444 - spastorino:as-ref-for-list, r=Mark-Simulacrum
Tyler Mandry [Tue, 15 Oct 2019 23:08:00 +0000 (16:08 -0700)]
Rollup merge of #65444 - spastorino:as-ref-for-list, r=Mark-Simulacrum

Implement AsRef<[T]> for List<T>

r? @Mark-Simulacrum

4 years agoRollup merge of #65438 - Centril:almost, r=varkor
Tyler Mandry [Tue, 15 Oct 2019 23:07:58 +0000 (16:07 -0700)]
Rollup merge of #65438 - Centril:almost, r=varkor

Organize `never_type`  tests

Extracted from https://github.com/rust-lang/rust/pull/65355.
This just moves some tests around to make things better categorized.

r? @varkor

4 years agoRollup merge of #65425 - nnethercote:optimize-BitIter, r=zackmdavis
Tyler Mandry [Tue, 15 Oct 2019 23:07:57 +0000 (16:07 -0700)]
Rollup merge of #65425 - nnethercote:optimize-BitIter, r=zackmdavis

Optimize `BitIter`

A minor speed improvement.

4 years agoRollup merge of #65402 - michaelwoerister:pgo-troubleshooting-docs, r=alexcrichton
Tyler Mandry [Tue, 15 Oct 2019 23:07:55 +0000 (16:07 -0700)]
Rollup merge of #65402 - michaelwoerister:pgo-troubleshooting-docs, r=alexcrichton

Add troubleshooting section to PGO chapter in rustc book.

- Adds a note about using `-pgo-warn-missing-function` in order to spot mistakes in PGO setup.
- Mentions cargo symbol name issue fixed in 1.39.

Nominating for backport.

r? @alexcrichton

4 years agoRollup merge of #65389 - ecstatic-morse:zero-sized-array-no-drop, r=eddyb
Tyler Mandry [Tue, 15 Oct 2019 23:07:53 +0000 (16:07 -0700)]
Rollup merge of #65389 - ecstatic-morse:zero-sized-array-no-drop, r=eddyb

Return `false` from `needs_drop` for all zero-sized arrays.

Resolves #65348.

This changes the result of the `needs_drop` query from `true` to `false` for types such as `[Box<i32>; 0]`. I believe this change to be sound because a zero-sized array can never actually hold a value. This is an elegant way of resolving #65348 and #64945, but obviously it has much broader implications.

4 years agoRollup merge of #65353 - Xanewok:sa-empty-tables, r=nikomatsakis
Tyler Mandry [Tue, 15 Oct 2019 23:07:52 +0000 (16:07 -0700)]
Rollup merge of #65353 - Xanewok:sa-empty-tables, r=nikomatsakis

save-analysis: Don't ICE when resolving qualified type paths in struct members

Previously, we failed since we use `qpath_res` via typeck tables - when using those we need to pass in a HirId that's local to the definition path the tables are rooted at (otherwise we risk frame of reference mismatch and an assertion against invalid lookup).

In this case we can't get typeck tables for struct definition because it has no body, however the struct member type node is rooted under the struct definition and so we can't really do anything about it in terms of traversal.

Instead, we try to "nest" the tables as always but change the default behaviour to use empty typeck tables rather than silently trying to use the current ones. This does work as we expect and for prior art, we use the same approach in the [privacy](https://github.com/rust-lang/rust/blob/7bc94cc3c2ccef8b4d393910bb978a6487db1202/src/librustc_privacy/lib.rs#L332-L341) [pass](https://github.com/rust-lang/rust/blob/7bc94cc3c2ccef8b4d393910bb978a6487db1202/src/librustc_privacy/lib.rs#L1007-L1028).

Fixes #64659.
Fixes #64821.

r? @nikomatsakis (since this changes the default behaviour introduced in https://github.com/rust-lang/rust/commit/d7d3f197f62d7d0a1a612b7243f4617428cae53f)

4 years agoRollup merge of #65308 - GuillaumeGomez:long-err-explanation-E0574, r=matthewjasper
Tyler Mandry [Tue, 15 Oct 2019 23:07:50 +0000 (16:07 -0700)]
Rollup merge of #65308 - GuillaumeGomez:long-err-explanation-E0574, r=matthewjasper

Add long error explanation for E0574

Part of #61137.

4 years agoRollup merge of #65307 - Phosphorus15:master, r=varkor
Tyler Mandry [Tue, 15 Oct 2019 23:07:49 +0000 (16:07 -0700)]
Rollup merge of #65307 - Phosphorus15:master, r=varkor

Try fix incorrect "explicit lifetime name needed"

This pr is trying to fixes #65285 .

4 years agoRollup merge of #65293 - tmandry:turbo-expander, r=matthewjasper
Tyler Mandry [Tue, 15 Oct 2019 23:07:47 +0000 (16:07 -0700)]
Rollup merge of #65293 - tmandry:turbo-expander, r=matthewjasper

Optimize `try_expand_impl_trait_type`

A lot of time was being spent expanding some large `impl Future` types in fuchsia. This PR takes the number of types being visited in one expansion from >3 billion to about a thousand, and eliminates the compile time regression in https://github.com/rust-lang/rust/issues/65147 (in fact, compile times are better than they were before).

Thanks to @Mark-Simulacrum for helping identify the issue and to @matthewjasper for suggesting this change.

Fixes #65147.
r? @matthewjasper,@nikomatsakis

4 years agoRollup merge of #65265 - GuillaumeGomez:cleanup-librustc_mir-err-codes, r=Mark-Simulacrum
Tyler Mandry [Tue, 15 Oct 2019 23:07:46 +0000 (16:07 -0700)]
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

4 years agoRollup merge of #65242 - estebank:contrain-trait-sugg, r=varkor
Tyler Mandry [Tue, 15 Oct 2019 23:07:44 +0000 (16:07 -0700)]
Rollup merge of #65242 - estebank:contrain-trait-sugg, r=varkor

Fix suggestion to constrain trait for method to be found

Fix #65044.

4 years agoRollup merge of #65235 - nikomatsakis:issue-65159-async-fn-return-ice, r=cramertj
Tyler Mandry [Tue, 15 Oct 2019 23:07:43 +0000 (16:07 -0700)]
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

4 years agoRollup merge of #64623 - matthewjasper:underscore-imports, r=petrochenkov
Tyler Mandry [Tue, 15 Oct 2019 23:07:41 +0000 (16:07 -0700)]
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

4 years agoRollup merge of #64603 - gilescope:unused-lifetime-warning, r=matthewjasper
Tyler Mandry [Tue, 15 Oct 2019 23:07:39 +0000 (16:07 -0700)]
Rollup merge of #64603 - gilescope:unused-lifetime-warning, r=matthewjasper

Reducing spurious unused lifetime warnings.

Fixes #61115, fixes #64493.

4 years agoUpdate clippy
Manish Goregaokar [Tue, 15 Oct 2019 20:52:34 +0000 (13:52 -0700)]
Update clippy

4 years agoRemove some mentions of gensyms
Matthew Jasper [Sat, 31 Aug 2019 15:41:13 +0000 (16:41 +0100)]
Remove some mentions of gensyms

4 years agoRemove gensyms
Matthew Jasper [Sat, 31 Aug 2019 15:40:20 +0000 (16:40 +0100)]
Remove gensyms

4 years agoDon't use `gensym_if_underscore` to resolve `_` bindings
Matthew Jasper [Mon, 9 Sep 2019 20:04:26 +0000 (21:04 +0100)]
Don't use `gensym_if_underscore` to resolve `_` bindings

Instead add a disambiguator to the keys used for distinguishing
resolutions.

4 years agoOptimize `BitSet` iteration.
Nicholas Nethercote [Mon, 14 Oct 2019 23:11:30 +0000 (10:11 +1100)]
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.

4 years agoAdd `BitIter::new()`.
Nicholas Nethercote [Mon, 14 Oct 2019 23:02:55 +0000 (10:02 +1100)]
Add `BitIter::new()`.

This factors out some duplicated code.

4 years agoImplement AsRef<[T]> for List<T>
Santiago Pastorino [Tue, 15 Oct 2019 15:55:39 +0000 (12:55 -0300)]
Implement AsRef<[T]> for List<T>

4 years agoAvoid unused lifetime warning for lifetimes introduced when desugering async.
Giles Cope [Tue, 15 Oct 2019 17:05:13 +0000 (18:05 +0100)]
Avoid unused lifetime warning for lifetimes introduced when desugering async.

4 years agoAuto merge of #65433 - Centril:rollup-rzvry15, r=Centril
bors [Tue, 15 Oct 2019 15:14:43 +0000 (15:14 +0000)]
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

4 years agoFix suggestion to constrain trait for method to be found
Esteban Küber [Wed, 9 Oct 2019 17:10:54 +0000 (10:10 -0700)]
Fix suggestion to constrain trait for method to be found

4 years agoOrganize `never_type` tests
Mazdak Farrokhzad [Tue, 15 Oct 2019 13:28:42 +0000 (15:28 +0200)]
Organize `never_type` tests

Also move {run-fail -> ui}/never_type

4 years agoSlides path lifetime to the lifetime resolver
phosphorus [Fri, 11 Oct 2019 12:16:09 +0000 (20:16 +0800)]
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

4 years agoRemove unnecessary `use crate::sess::ParseSess;`.
Mazdak Farrokhzad [Tue, 15 Oct 2019 09:57:06 +0000 (11:57 +0200)]
Remove unnecessary `use crate::sess::ParseSess;`.

4 years agoRollup merge of #65428 - phansch:rename_db_var, r=Centril
Mazdak Farrokhzad [Tue, 15 Oct 2019 11:27:30 +0000 (13:27 +0200)]
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

4 years agoRollup merge of #65426 - nnethercote:rm-custom-LocalInternedString-PartialEq-impls...
Mazdak Farrokhzad [Tue, 15 Oct 2019 11:27:29 +0000 (13:27 +0200)]
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

4 years agoRollup merge of #65376 - Centril:syntax-extractions-1, r=petrochenkov
Mazdak Farrokhzad [Tue, 15 Oct 2019 11:27:28 +0000 (13:27 +0200)]
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

4 years agoRollup merge of #64035 - petrochenkov:stabmacgen, r=eddyb
Mazdak Farrokhzad [Tue, 15 Oct 2019 11:27:27 +0000 (13:27 +0200)]
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

4 years agoAuto merge of #65412 - RalfJung:miri, r=RalfJung
bors [Tue, 15 Oct 2019 11:23:12 +0000 (11:23 +0000)]
Auto merge of #65412 - RalfJung:miri, r=RalfJung

update miri

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

4 years agosyntax::parse::sess -> syntax::sess
Mazdak Farrokhzad [Mon, 14 Oct 2019 08:08:26 +0000 (10:08 +0200)]
syntax::parse::sess -> syntax::sess

4 years agomove parse_lit to expr.rs
Mazdak Farrokhzad [Fri, 11 Oct 2019 16:40:56 +0000 (18:40 +0200)]
move parse_lit to expr.rs

4 years agosyntax: extract sess.rs for ParseSess
Mazdak Farrokhzad [Wed, 9 Oct 2019 01:23:10 +0000 (03:23 +0200)]
syntax: extract sess.rs for ParseSess

4 years agomove maybe_report_invalid_custom_discriminants to feature_gate
Mazdak Farrokhzad [Tue, 8 Oct 2019 08:27:32 +0000 (10:27 +0200)]
move maybe_report_invalid_custom_discriminants to feature_gate

4 years agoTest basic hygiene for `macro_rules` produced by transparent macros
Vadim Petrochenkov [Sun, 22 Sep 2019 13:35:28 +0000 (16:35 +0300)]
Test basic hygiene for `macro_rules` produced by transparent macros

4 years agoStabilize proc macros generating `macro_rules` items
Vadim Petrochenkov [Sat, 31 Aug 2019 12:22:53 +0000 (15:22 +0300)]
Stabilize proc macros generating `macro_rules` items

4 years agoRefactor: Rename `db` locals to `diag`
Philipp Hansch [Tue, 15 Oct 2019 06:12:55 +0000 (08:12 +0200)]
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.

4 years agoRemove custom `PartialEq` impls for `LocalInternedString`.
Nicholas Nethercote [Thu, 5 Sep 2019 05:52:47 +0000 (15:52 +1000)]
Remove custom `PartialEq` impls for `LocalInternedString`.

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

4 years agoAuto merge of #65422 - tmandry:rollup-r5u3mlc, r=tmandry
bors [Tue, 15 Oct 2019 00:54:10 +0000 (00:54 +0000)]
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

4 years agoRollup merge of #65416 - spastorino:minor-sync-changes, r=Mark-Simulacrum
Tyler Mandry [Tue, 15 Oct 2019 00:52:45 +0000 (17:52 -0700)]
Rollup merge of #65416 - spastorino:minor-sync-changes, r=Mark-Simulacrum

Minor sync changes

r? @Mark-Simulacrum

4 years agoRollup merge of #65415 - petrochenkov:rmtest, r=varkor
Tyler Mandry [Tue, 15 Oct 2019 00:52:44 +0000 (17:52 -0700)]
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.

4 years agoRollup merge of #65410 - Centril:intersection-pat-recover, r=davidtwco,varkor
Tyler Mandry [Tue, 15 Oct 2019 00:52:42 +0000 (17:52 -0700)]
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

4 years agoRollup merge of #65398 - estebank:capitalization-only, r=varkor
Tyler Mandry [Tue, 15 Oct 2019 00:52:41 +0000 (17:52 -0700)]
Rollup merge of #65398 - estebank:capitalization-only, r=varkor

Bring attention to suggestions when the only difference is capitalization

CC #65386.

4 years agoRollup merge of #65365 - skinny121:const-args-metadata, r=varkor
Tyler Mandry [Tue, 15 Oct 2019 00:52:39 +0000 (17:52 -0700)]
Rollup merge of #65365 - skinny121:const-args-metadata, r=varkor

Include const generic arguments in metadata

Fixes #64707
Fixes #61624
Fixes #64730

r? @varkor

4 years agoRollup merge of #65340 - bjorn3:cg_ssa_refactor4, r=eddyb
Tyler Mandry [Tue, 15 Oct 2019 00:52:38 +0000 (17:52 -0700)]
Rollup merge of #65340 - bjorn3:cg_ssa_refactor4, r=eddyb

Several changes to the codegen backend organization

* Split functions from values in cg_ssa `BackendTypes`.
* Remove `is_const_integral` function from `ConstMethods`.
* Actually register the invalid monomorphization of intrinsic long diagnostic and remove the `diagnostics` method from `CodegenBackends`, as it was unused.
* Add cg_ssa and cg_utils provided methods to `default_provide`, so codegen backend don't have to do it themself.

4 years agoRollup merge of #65332 - RalfJung:fmt, r=cramertj
Tyler Mandry [Tue, 15 Oct 2019 00:52:37 +0000 (17:52 -0700)]
Rollup merge of #65332 - RalfJung:fmt, r=cramertj

std::fmt: reorder docs

This moves the "Formatting Parameters" section up above right after the discussion of named and positional arguments. Then comes the "Syntax" section, summarizing the discussion of format string syntax.
And only *then* we get to "Formatting Traits" -- that section has some *huge* code examples, so it really should not interrupt the discussion of the grammar. Also users are much more likely to come here to learn about the format string grammar than to come here to learn about the `Binary` trait.

4 years agoRollup merge of #65261 - nnethercote:rm-Option-from-TokenStream, r=petrochenkov
Tyler Mandry [Tue, 15 Oct 2019 00:52:35 +0000 (17:52 -0700)]
Rollup merge of #65261 - nnethercote:rm-Option-from-TokenStream, r=petrochenkov

Remove `Option` from `TokenStream`

A code simplification.

r? @petrochenkov

4 years agoRollup merge of #65260 - nnethercote:optimize-LexicalResolve-expansion, r=nikomatsakis
Tyler Mandry [Tue, 15 Oct 2019 00:52:33 +0000 (17:52 -0700)]
Rollup merge of #65260 - nnethercote:optimize-LexicalResolve-expansion, r=nikomatsakis

Optimize `LexicalResolve::expansion`.

A win for `unicode_normalization`.

r? @nikomatsakis

4 years agoRollup merge of #65170 - petrochenkov:cload, r=eddyb
Tyler Mandry [Tue, 15 Oct 2019 00:52:32 +0000 (17:52 -0700)]
Rollup merge of #65170 - petrochenkov:cload, r=eddyb

rustc_metadata: Privatize private code and remove dead code

Also some minor cleanup and documentation improvements.

r? @eddyb

4 years agoOnly expand types that contain projections
Tyler Mandry [Thu, 10 Oct 2019 23:38:53 +0000 (16:38 -0700)]
Only expand types that contain projections

4 years agoAdd expanded type cache to OpaqueTypeExpander
Tyler Mandry [Thu, 10 Oct 2019 23:38:05 +0000 (16:38 -0700)]
Add expanded type cache to OpaqueTypeExpander

4 years agoTweak heuristics for less noise
Esteban Küber [Mon, 14 Oct 2019 21:48:45 +0000 (14:48 -0700)]
Tweak heuristics for less noise

4 years agoUse heuristics for capitalization warning in suggestions
Esteban Küber [Mon, 14 Oct 2019 21:30:59 +0000 (14:30 -0700)]
Use heuristics for capitalization warning in suggestions

4 years agoRename serial_join and serial_scope to join and scope
Santiago Pastorino [Mon, 14 Oct 2019 20:49:47 +0000 (17:49 -0300)]
Rename serial_join and serial_scope to join and scope

4 years agoMove serial_scope and serial_join to parallel_compiler = false
Santiago Pastorino [Mon, 14 Oct 2019 18:15:02 +0000 (15:15 -0300)]
Move serial_scope and serial_join to parallel_compiler = false

4 years agoMinor comment tweaks
Santiago Pastorino [Mon, 14 Oct 2019 18:12:23 +0000 (15:12 -0300)]
Minor comment tweaks

4 years agoRemove an outdated test output file
Vadim Petrochenkov [Mon, 14 Oct 2019 18:35:49 +0000 (21:35 +0300)]
Remove an outdated test output file

4 years agoInclude const generic arguments in metadata.
ben [Sun, 13 Oct 2019 04:52:09 +0000 (17:52 +1300)]
Include const generic arguments in metadata.

4 years agopprust: `p1@p2` -> `p1 @ p2`
Mazdak Farrokhzad [Mon, 14 Oct 2019 16:12:04 +0000 (18:12 +0200)]
pprust: `p1@p2` -> `p1 @ p2`

4 years agorecover_intersection_pat: adjust wording
Mazdak Farrokhzad [Mon, 14 Oct 2019 16:02:49 +0000 (18:02 +0200)]
recover_intersection_pat: adjust wording

4 years agoupdate miri
Ralf Jung [Mon, 14 Oct 2019 15:59:45 +0000 (17:59 +0200)]
update miri

4 years agoAuto merge of #64987 - oli-obk:code_reuse_prevents_bugs, r=eddyb
bors [Mon, 14 Oct 2019 15:52:51 +0000 (15:52 +0000)]
Auto merge of #64987 - oli-obk:code_reuse_prevents_bugs, r=eddyb

Compute the layout of uninhabited structs

fixes #64506

r? @eddyb

4 years agosyntax: use `PatKind::Wild` as our `::Err` equivalent.
Mazdak Farrokhzad [Mon, 14 Oct 2019 15:25:50 +0000 (17:25 +0200)]
syntax: use `PatKind::Wild` as our `::Err` equivalent.

4 years agosyntax: add test for intersection pattern parser recovery
Mazdak Farrokhzad [Mon, 14 Oct 2019 14:57:18 +0000 (16:57 +0200)]
syntax: add test for intersection pattern parser recovery

4 years agosyntax: add recovery for intersection patterns `p1 @ p2`
Mazdak Farrokhzad [Mon, 14 Oct 2019 14:47:12 +0000 (16:47 +0200)]
syntax: add recovery for intersection patterns `p1 @ p2`

4 years agorustc_metadata: Remove resolutions for extern crate items from `CStore`
Vadim Petrochenkov [Sun, 13 Oct 2019 22:08:13 +0000 (01:08 +0300)]
rustc_metadata: Remove resolutions for extern crate items from `CStore`

Use a more traditional scheme with providing them as a resolver output

4 years agorustc_metadata: Crate loader is immutable
Vadim Petrochenkov [Sun, 13 Oct 2019 20:47:26 +0000 (23:47 +0300)]
rustc_metadata: Crate loader is immutable

4 years agorustc_metadata: Improve documentation of `CrateMetadata`
Vadim Petrochenkov [Sun, 6 Oct 2019 19:25:57 +0000 (22:25 +0300)]
rustc_metadata: Improve documentation of `CrateMetadata`

4 years agorustc_metadata: Use `CrateSource` where appropriate
Vadim Petrochenkov [Sun, 6 Oct 2019 13:42:14 +0000 (16:42 +0300)]
rustc_metadata: Use `CrateSource` where appropriate

4 years agorustc_metadata: Privatize private code and remove dead code
Vadim Petrochenkov [Sun, 6 Oct 2019 11:30:46 +0000 (14:30 +0300)]
rustc_metadata: Privatize private code and remove dead code

4 years agoDelete extra file
Guillaume Gomez [Mon, 14 Oct 2019 11:01:12 +0000 (13:01 +0200)]
Delete extra file

4 years agoAuto merge of #65399 - Centril:rollup-6lzj0w5, r=Centril
bors [Mon, 14 Oct 2019 10:00:51 +0000 (10:00 +0000)]
Auto merge of #65399 - Centril:rollup-6lzj0w5, r=Centril

Rollup of 7 pull requests

Successful merges:

 - #65215 (Add long error explanation for E0697)
 - #65292 (Print lifetimes with backticks)
 - #65362 (syntax: consolidate function parsing in item.rs)
 - #65363 (Remove implicit dependencies on syntax::pprust)
 - #65379 (refactor session::config::build_session_options_and_crate_config)
 - #65392 (Move `Nonterminal::to_tokenstream` to parser & don't rely directly on parser in lowering)
 - #65395 (Add some tests for fixed ICEs)

Failed merges:

r? @ghost

4 years agoUnification and cleanup of librustc_mir error codes
Guillaume Gomez [Thu, 10 Oct 2019 08:53:08 +0000 (10:53 +0200)]
Unification and cleanup of librustc_mir error codes

4 years agoUncomment E0386 to let users have access to its old definition
Guillaume Gomez [Thu, 10 Oct 2019 08:33:46 +0000 (10:33 +0200)]
Uncomment E0386 to let users have access to its old definition

4 years agoSort long error code explanation by error code
Guillaume Gomez [Thu, 10 Oct 2019 08:29:03 +0000 (10:29 +0200)]
Sort long error code explanation by error code

4 years agoAdd troubleshooting section to PGO chapter in rustc book.
Michael Woerister [Mon, 14 Oct 2019 08:34:21 +0000 (10:34 +0200)]
Add troubleshooting section to PGO chapter in rustc book.

4 years agoRollup merge of #65395 - JohnTitor:add-tests, r=Centril
Mazdak Farrokhzad [Mon, 14 Oct 2019 05:37:01 +0000 (07:37 +0200)]
Rollup merge of #65395 - JohnTitor:add-tests, r=Centril

Add some tests for fixed ICEs

Fixes #44153 (from 1.23.0)
Fixes #47486 (from 1.36.0)
Fixes #48010 (from 1.38.0)
Fixes #48027 (from nightly)
Fixes #48638 (from nightly)

4 years agoRollup merge of #65392 - Centril:nt-to-tt, r=Mark-Simulacrum
Mazdak Farrokhzad [Mon, 14 Oct 2019 05:36:59 +0000 (07:36 +0200)]
Rollup merge of #65392 - Centril:nt-to-tt, r=Mark-Simulacrum

Move `Nonterminal::to_tokenstream` to parser & don't rely directly on parser in lowering

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

r? @petrochenkov

4 years agoRollup merge of #65379 - Centril:refactor-bso_and_cc, r=petrochenkov
Mazdak Farrokhzad [Mon, 14 Oct 2019 05:36:58 +0000 (07:36 +0200)]
Rollup merge of #65379 - Centril:refactor-bso_and_cc, r=petrochenkov

refactor session::config::build_session_options_and_crate_config

I'm not exactly sure what happened in https://github.com/rust-lang/rust/pull/65361#issuecomment-541420179 so in an effort to bisect the error I'm extracting out the first commit so it can hopefully land (I suspect the error is in the 2nd-3rd commits.)

r? @petrochenkov

(I'll r=you when the PR builder is happy)

4 years agoRollup merge of #65363 - Centril:less-pprust, r=Mark-Simulacrum
Mazdak Farrokhzad [Mon, 14 Oct 2019 05:36:57 +0000 (07:36 +0200)]
Rollup merge of #65363 - Centril:less-pprust, r=Mark-Simulacrum

Remove implicit dependencies on syntax::pprust

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

The main goal here is to facilitate the eventual move of pprust out from libsyntax and because an AST definition typically should not depend on its pretty printer.

r? @estebank

4 years agoRollup merge of #65362 - Centril:extract_fun, r=petrochenkov
Mazdak Farrokhzad [Mon, 14 Oct 2019 05:36:55 +0000 (07:36 +0200)]
Rollup merge of #65362 - Centril:extract_fun, r=petrochenkov

syntax: consolidate function parsing in item.rs

Extracted from https://github.com/rust-lang/rust/pull/65324.

r? @estebank

4 years agoRollup merge of #65292 - JohnTitor:add-backticks, r=varkor,Centril
Mazdak Farrokhzad [Mon, 14 Oct 2019 05:36:54 +0000 (07:36 +0200)]
Rollup merge of #65292 - JohnTitor:add-backticks, r=varkor,Centril

Print lifetimes with backticks

Fixes #65287

r? @varkor

4 years agoRollup merge of #65215 - JohnTitor:long-explanation-e0697, r=GuillaumeGomez
Mazdak Farrokhzad [Mon, 14 Oct 2019 05:36:52 +0000 (07:36 +0200)]
Rollup merge of #65215 - JohnTitor:long-explanation-e0697, r=GuillaumeGomez

Add long error explanation for E0697

Part of #61137

r? @GuillaumeGomez

4 years agoBring attention to suggestions when the only difference is capitalization
Esteban Küber [Mon, 14 Oct 2019 04:48:39 +0000 (21:48 -0700)]
Bring attention to suggestions when the only difference is capitalization

4 years agoAdd test for issue-48638
Yuki Okushi [Mon, 14 Oct 2019 01:47:39 +0000 (10:47 +0900)]
Add test for issue-48638

4 years agoAdd test for issue-48027
Yuki Okushi [Mon, 14 Oct 2019 01:47:14 +0000 (10:47 +0900)]
Add test for issue-48027

4 years agoAdd test for issue-48010
Yuki Okushi [Mon, 14 Oct 2019 01:46:58 +0000 (10:46 +0900)]
Add test for issue-48010