]> git.lizzy.rs Git - rust.git/log
rust.git
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 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 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 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 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

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

4 years agoAuto merge of #65240 - michaelwoerister:sp-review-3, r=Mark-Simulacrum
bors [Mon, 14 Oct 2019 01:45:26 +0000 (01:45 +0000)]
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

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

4 years agoLazify some `mac_placeholder()` calls.
Nicholas Nethercote [Thu, 10 Oct 2019 01:55:39 +0000 (12:55 +1100)]
Lazify some `mac_placeholder()` calls.

This avoids some unnecessary creation of empty token streams.

4 years agoUse `TokenStream::default()` in more places.
Nicholas Nethercote [Thu, 10 Oct 2019 01:01:12 +0000 (12:01 +1100)]
Use `TokenStream::default()` in more places.

4 years agoRemove the `Option` in `TokenStream`.
Nicholas Nethercote [Wed, 9 Oct 2019 20:29:02 +0000 (07:29 +1100)]
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.

4 years agoAuto merge of #65342 - Mark-Simulacrum:revert-rustc-dev, r=pietroalbini
bors [Sun, 13 Oct 2019 21:35:39 +0000 (21:35 +0000)]
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 000d90b11f7be70ffb7812680f7abc6deb52ec88, reversing
changes made to 898f36c83cc28d7921a1d7b3605323dc5cfcf533.

This turned out to break quite a few targets, cc https://github.com/rust-lang/rust/issues/65335

4 years agolowering: connect to parser via function pointer instead
Mazdak Farrokhzad [Sun, 13 Oct 2019 21:27:18 +0000 (23:27 +0200)]
lowering: connect to parser via function pointer instead

4 years agolowering: don't rely on parser directly.
Mazdak Farrokhzad [Sun, 13 Oct 2019 20:51:18 +0000 (22:51 +0200)]
lowering: don't rely on parser directly.

4 years agoAdd more tests for underscore imports
Matthew Jasper [Sat, 7 Sep 2019 20:22:36 +0000 (21:22 +0100)]
Add more tests for underscore imports

4 years agotoken: extract Nonterminal::to_tokenstream to parser.
Mazdak Farrokhzad [Wed, 9 Oct 2019 00:34:22 +0000 (02:34 +0200)]
token: extract Nonterminal::to_tokenstream to parser.

4 years agoAuto merge of #65388 - Centril:rollup-rhg0dvs, r=Centril
bors [Sun, 13 Oct 2019 17:18:56 +0000 (17:18 +0000)]
Auto merge of #65388 - Centril:rollup-rhg0dvs, r=Centril

Rollup of 10 pull requests

Successful merges:

 - #65214 (Split non-CAS atomic support off into target_has_atomic_load_store)
 - #65246 (vxWorks: implement get_path() and get_mode() for File fmt::Debug)
 - #65312 (improve performance of signed saturating_mul)
 - #65336 (Fix typo in task::Waker)
 - #65346 (nounwind tests and cleanup)
 - #65347 (Fix #[unwind(abort)] with Rust ABI)
 - #65366 (Implement Error::source on IntoStringError + Remove superfluous cause impls)
 - #65369 (Don't discard value names when using address or memory sanitizer)
 - #65370 (Add `dyn` to `Any` documentation)
 - #65373 (Fix typo in docs for `Rc`)

Failed merges:

r? @ghost

4 years agoRollup merge of #65373 - kalabukdima:patch-1, r=jonas-schievink
Mazdak Farrokhzad [Sun, 13 Oct 2019 17:17:17 +0000 (19:17 +0200)]
Rollup merge of #65373 - kalabukdima:patch-1, r=jonas-schievink

Fix typo in docs for `Rc`

r? @czipperz

4 years agoRollup merge of #65370 - Cerberuser:patch-1, r=jonas-schievink
Mazdak Farrokhzad [Sun, 13 Oct 2019 17:17:15 +0000 (19:17 +0200)]
Rollup merge of #65370 - Cerberuser:patch-1, r=jonas-schievink

Add `dyn` to `Any` documentation

I noticed that in documentation to `Any` trait the old trait object syntax is used, which could be confusing for newcomers, since we generally recommend using `dyn Trait` instead of just `Trait`. This PR changes the documentation comment, so that it uses `&dyn Any`, `&mut dyn Any` and `Box<dyn Any>`, correspondingly.

4 years agoRollup merge of #65369 - tmiasko:sanitizers-keep-names, r=varkor
Mazdak Farrokhzad [Sun, 13 Oct 2019 17:17:14 +0000 (19:17 +0200)]
Rollup merge of #65369 - tmiasko:sanitizers-keep-names, r=varkor

Don't discard value names when using address or memory sanitizer

The value names are used when reporting issues found by address
sanitizer or memory sanitizer. Avoid discarding names when those
sanitizers are enabled, unless explicitly requested to do otherwise.

4 years agoRollup merge of #65366 - faern:source-on-intostringerror, r=bluss
Mazdak Farrokhzad [Sun, 13 Oct 2019 17:17:12 +0000 (19:17 +0200)]
Rollup merge of #65366 - faern:source-on-intostringerror, r=bluss

Implement Error::source on IntoStringError + Remove superfluous cause impls

IntoStringError only implemented `Error::cause`, which is deprecated. This implemements `Error::source` instead.
`Error::cause` will still work as before, thanks to the default implementation.

I think this was the only/last `Error` impl in the standard library to have a cause, but not a source.

4 years agoRollup merge of #65347 - RalfJung:unwind-abort-rust, r=varkor
Mazdak Farrokhzad [Sun, 13 Oct 2019 17:17:11 +0000 (19:17 +0200)]
Rollup merge of #65347 - RalfJung:unwind-abort-rust, r=varkor

Fix #[unwind(abort)] with Rust ABI

Fixes #63883.

4 years agoRollup merge of #65346 - RalfJung:nounwind-tests, r=nagisa
Mazdak Farrokhzad [Sun, 13 Oct 2019 17:17:10 +0000 (19:17 +0200)]
Rollup merge of #65346 - RalfJung:nounwind-tests, r=nagisa

nounwind tests and cleanup

This is a follow-up to @pnkfelix' https://github.com/rust-lang/rust/pull/65020. In particular it adds some tests as @nagisa  asked. It also does a cleanup that the original PR omitted to reduce backporting risks.

I hope I finally managed to write an uncontroversial PR in this area. ;) This should not change any behavior, just test it better.

4 years agoRollup merge of #65336 - BO41:typo, r=petrochenkov
Mazdak Farrokhzad [Sun, 13 Oct 2019 17:17:08 +0000 (19:17 +0200)]
Rollup merge of #65336 - BO41:typo, r=petrochenkov

Fix typo in task::Waker

fixes  #65323

in `libstd/error.rs` there are a few mentions of `trait@Send` and `trait@Sync`. Are they wrong as well?

4 years agoRollup merge of #65312 - tspiteri:signed-sat-mul, r=dtolnay
Mazdak Farrokhzad [Sun, 13 Oct 2019 17:17:07 +0000 (19:17 +0200)]
Rollup merge of #65312 - tspiteri:signed-sat-mul, r=dtolnay

improve performance of signed saturating_mul

Reciprocal throughput is improved from 2.3 to 1.7. https://godbolt.org/z/ROMiX6

Fixes #65309.

4 years agoRollup merge of #65246 - Wind-River:real_master_2, r=kennytm
Mazdak Farrokhzad [Sun, 13 Oct 2019 17:17:06 +0000 (19:17 +0200)]
Rollup merge of #65246 - Wind-River:real_master_2, r=kennytm

vxWorks: implement get_path() and get_mode() for File fmt::Debug

4 years agoRollup merge of #65214 - Amanieu:cfg_atomic, r=alexcrichton
Mazdak Farrokhzad [Sun, 13 Oct 2019 17:17:04 +0000 (19:17 +0200)]
Rollup merge of #65214 - Amanieu:cfg_atomic, r=alexcrichton

Split non-CAS atomic support off into target_has_atomic_load_store

This PR implements my proposed changes in https://github.com/rust-lang/rust/issues/32976#issuecomment-518542029 by removing `target_has_atomic = "cas"` and splitting `target_has_atomic` into two separate `cfg`s:

* `target_has_atomic = 8/16/32/64/128`: This indicates the largest width that the target can atomically CAS (which implies support for all atomic operations).
* ` target_has_atomic_load_store = 8/16/32/64/128`: This indicates the largest width that the target can support loading or storing atomically (but may not support CAS).

cc #32976

r? @alexcrichton

4 years agorefactor session::config::build_session_options_and_crate_config
Mazdak Farrokhzad [Fri, 11 Oct 2019 21:30:58 +0000 (23:30 +0200)]
refactor session::config::build_session_options_and_crate_config

4 years agoFix typo in docs for `Rc`
kalabukdima [Sun, 13 Oct 2019 12:46:28 +0000 (15:46 +0300)]
Fix typo in docs for `Rc`

4 years agoImprove type safety
bjorn3 [Sun, 13 Oct 2019 10:19:14 +0000 (12:19 +0200)]
Improve type safety

4 years agoAdd top level provide/provide_extern to cg_ssa and cg_utils
bjorn3 [Sun, 13 Oct 2019 10:11:27 +0000 (12:11 +0200)]
Add top level provide/provide_extern to cg_ssa and cg_utils