Commit Graph

100592 Commits

Author SHA1 Message Date
Michael Woerister
412cec2e12 Add regression test for issue #64153. 2019-10-22 12:33:28 +02: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
Tyler Mandry
8d1123d808
Rollup merge of #65365 - skinny121:const-args-metadata, r=varkor
Include const generic arguments in metadata

Fixes #64707
Fixes #61624
Fixes #64730

r? @varkor
2019-10-14 17:52:39 -07:00
Tyler Mandry
6241a4a108
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.
2019-10-14 17:52:38 -07:00
Tyler Mandry
e38639fe12
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.
2019-10-14 17:52:37 -07:00
Tyler Mandry
6d28ed1ae6
Rollup merge of #65261 - nnethercote:rm-Option-from-TokenStream, r=petrochenkov
Remove `Option` from `TokenStream`

A code simplification.

r? @petrochenkov
2019-10-14 17:52:35 -07:00
Tyler Mandry
a9a4d4033d
Rollup merge of #65260 - nnethercote:optimize-LexicalResolve-expansion, r=nikomatsakis
Optimize `LexicalResolve::expansion`.

A win for `unicode_normalization`.

r? @nikomatsakis
2019-10-14 17:52:33 -07:00
Tyler Mandry
d2f87e384f
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
2019-10-14 17:52:32 -07:00
Esteban Küber
8bf6d35377 Tweak heuristics for less noise 2019-10-14 14:48:45 -07:00
Esteban Küber
6dd718ca79 Use heuristics for capitalization warning in suggestions 2019-10-14 14:32:10 -07:00
Santiago Pastorino
b9bc431bd2
Rename serial_join and serial_scope to join and scope 2019-10-14 18:05:07 -03:00
Santiago Pastorino
83560225ad
Move serial_scope and serial_join to parallel_compiler = false 2019-10-14 18:05:07 -03:00
Santiago Pastorino
068a8d163c
Minor comment tweaks 2019-10-14 18:05:07 -03:00
Vadim Petrochenkov
34bcfcabcc Remove an outdated test output file 2019-10-14 21:35:49 +03:00
ben
eb68bbb2b0 Include const generic arguments in metadata. 2019-10-15 07:24:19 +13:00
Mazdak Farrokhzad
16266a5405 pprust: p1@p2 -> p1 @ p2 2019-10-14 18:12:04 +02:00
Mazdak Farrokhzad
3a9f8deb1d recover_intersection_pat: adjust wording 2019-10-14 18:02:49 +02:00
bors
e413dc36a8 Auto merge of #64987 - oli-obk:code_reuse_prevents_bugs, r=eddyb
Compute the layout of uninhabited structs

fixes #64506

r? @eddyb
2019-10-14 15:52:51 +00:00
Mazdak Farrokhzad
72ad8f716b syntax: use PatKind::Wild as our ::Err equivalent. 2019-10-14 17:25:50 +02:00
Mazdak Farrokhzad
a77a8aaa2e syntax: add test for intersection pattern parser recovery 2019-10-14 17:08:13 +02:00
Mazdak Farrokhzad
29fb07d245 syntax: add recovery for intersection patterns p1 @ p2 2019-10-14 17:08:13 +02:00
Vadim Petrochenkov
f5baad2b5e rustc_metadata: Remove resolutions for extern crate items from CStore
Use a more traditional scheme with providing them as a resolver output
2019-10-14 18:05:45 +03:00
Vadim Petrochenkov
e843d867e6 rustc_metadata: Crate loader is immutable 2019-10-14 18:05:45 +03:00
Vadim Petrochenkov
2805553dd8 rustc_metadata: Improve documentation of CrateMetadata 2019-10-14 18:05:45 +03:00
Vadim Petrochenkov
b476f2fa4e rustc_metadata: Use CrateSource where appropriate 2019-10-14 18:05:45 +03:00
Vadim Petrochenkov
e8c28e24b9 rustc_metadata: Privatize private code and remove dead code 2019-10-14 18:05:45 +03:00
bors
446e5e57b6 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
2019-10-14 10:00:51 +00:00
Mazdak Farrokhzad
a73e0731f4
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)
2019-10-14 07:37:01 +02:00
Mazdak Farrokhzad
28d08f3986
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
2019-10-14 07:36:59 +02:00
Mazdak Farrokhzad
e29a6fcfa2
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)
2019-10-14 07:36:58 +02:00
Mazdak Farrokhzad
2800bc240e
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
2019-10-14 07:36:57 +02:00
Mazdak Farrokhzad
66e428824b
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
2019-10-14 07:36:55 +02:00
Mazdak Farrokhzad
c2ae4ded4d
Rollup merge of #65292 - JohnTitor:add-backticks, r=varkor,Centril
Print lifetimes with backticks

Fixes #65287

r? @varkor
2019-10-14 07:36:54 +02:00
Mazdak Farrokhzad
1ac00287af
Rollup merge of #65215 - JohnTitor:long-explanation-e0697, r=GuillaumeGomez
Add long error explanation for E0697

Part of #61137

r? @GuillaumeGomez
2019-10-14 07:36:52 +02:00
Esteban Küber
4bb771615e Bring attention to suggestions when the only difference is capitalization 2019-10-13 21:48:39 -07:00
Yuki Okushi
f6e01e8d40 Add test for issue-48638 2019-10-14 11:56:30 +09:00
Yuki Okushi
88a495cdcf Add test for issue-48027 2019-10-14 10:47:14 +09:00
Yuki Okushi
f653db92d6 Add test for issue-48010 2019-10-14 10:46:58 +09:00
Yuki Okushi
6323180b4a Add test for issue-47486 2019-10-14 10:45:56 +09:00
bors
d28a9c38fe Auto merge of #65240 - michaelwoerister:sp-review-3, r=Mark-Simulacrum
self-profiling: Add events for metadata loading (plus a small dep-tracking optimization)

This PR
- adds self-profiling events related to loading things from crate metadata
- makes the compiler cache the `DepNodeIndex` of upstream crates, so that they don't have to be looked up over and over.

The commits are best reviewed in isolation.

Self-profiling tracking issue: https://github.com/rust-lang/rust/issues/58967

r? @Mark-Simulacrum
cc @wesleywiser
2019-10-14 01:45:26 +00:00
Yuki Okushi
5c8fdc1954 Add test for issue-44153 2019-10-14 10:45:25 +09:00
Nicholas Nethercote
18b48bf4b9 Lazify some mac_placeholder() calls.
This avoids some unnecessary creation of empty token streams.
2019-10-14 09:19:40 +11:00
Nicholas Nethercote
1ce0347fd4 Use TokenStream::default() in more places. 2019-10-14 09:19:31 +11:00
Nicholas Nethercote
5c93492da9 Remove the Option in TokenStream.
It means an allocation is required to create an empty `TokenStream`, but
all other operations are simpler and marginally faster due to not having
to check for `None`. Overall it simplifies the code for a negligible
performance effect.

The commit also removes `TokenStream::empty` by implementing `Default`,
which is now possible.
2019-10-14 09:14:39 +11:00
bors
36d4506cc6 Auto merge of #65342 - Mark-Simulacrum:revert-rustc-dev, r=pietroalbini
Revert "Auto merge of #64823 - cuviper:min-std, r=Mark-Simulacrum"

This reverts commit 000d90b11f, reversing
changes made to 898f36c83c.

This turned out to break quite a few targets, cc https://github.com/rust-lang/rust/issues/65335
2019-10-13 21:35:39 +00:00
Mazdak Farrokhzad
07e946caf7 lowering: connect to parser via function pointer instead 2019-10-13 23:27:18 +02:00