]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoCleanup const_prop() some
Wesley Wiser [Sun, 15 Sep 2019 16:08:09 +0000 (12:08 -0400)]
Cleanup const_prop() some

4 years ago[const-prop] Handle MIR Rvalue::Box
Wesley Wiser [Sun, 15 Sep 2019 16:03:52 +0000 (12:03 -0400)]
[const-prop] Handle MIR Rvalue::Box

4 years ago[const-prop] Handle MIR Rvalue::Discriminant
Wesley Wiser [Sun, 15 Sep 2019 04:05:19 +0000 (00:05 -0400)]
[const-prop] Handle MIR Rvalue::Discriminant

4 years ago[const-prop] Handle MIR Rvalue::Aggregates
Wesley Wiser [Sat, 14 Sep 2019 18:11:31 +0000 (14:11 -0400)]
[const-prop] Handle MIR Rvalue::Aggregates

4 years ago[const-prop] Handle MIR Rvalue::Repeat
Wesley Wiser [Sat, 14 Sep 2019 13:22:07 +0000 (09:22 -0400)]
[const-prop] Handle MIR Rvalue::Repeat

4 years agoAuto merge of #65533 - Manishearth:clippyup, r=Manishearth
bors [Fri, 18 Oct 2019 02:15:07 +0000 (02:15 +0000)]
Auto merge of #65533 - Manishearth:clippyup, r=Manishearth

Update clippy

None

4 years agoUpdate clippy
Manish Goregaokar [Thu, 17 Oct 2019 23:59:10 +0000 (16:59 -0700)]
Update clippy

4 years agoAuto merge of #65495 - Centril:rollup-tguwjt5, r=Centril
bors [Thu, 17 Oct 2019 18:53:10 +0000 (18:53 +0000)]
Auto merge of #65495 - Centril:rollup-tguwjt5, r=Centril

Rollup of 8 pull requests

Successful merges:

 - #65237 (Move debug_map assertions after check for err)
 - #65316 (make File::try_clone produce non-inheritable handles on Windows)
 - #65319 (InterpCx: make memory field public)
 - #65461 (Don't recommend ONCE_INIT in std::sync::Once)
 - #65465 (Move syntax::ext to a syntax_expand and refactor some attribute logic)
 - #65475 (add example for type_name)
 - #65478 (fmt::Write is about string slices, not byte slices)
 - #65486 (doc: fix typo in OsStrExt and OsStringExt)

Failed merges:

r? @ghost

4 years agoAuto merge of #64595 - Mark-Simulacrum:trivial-query, r=pnkfelix
bors [Thu, 17 Oct 2019 14:42:24 +0000 (14:42 +0000)]
Auto merge of #64595 - Mark-Simulacrum:trivial-query, r=pnkfelix

Optimize dropck

This does two things: caches the `trivial_dropck` check by making it a query, and shifts around the implementation of the primary dropck itself to avoid allocating many small vectors.

4 years agoRollup merge of #65486 - mathstuf:osstr-doc-typo, r=TimNN
Mazdak Farrokhzad [Thu, 17 Oct 2019 11:46:15 +0000 (13:46 +0200)]
Rollup merge of #65486 - mathstuf:osstr-doc-typo, r=TimNN

doc: fix typo in OsStrExt and OsStringExt

4 years agoRollup merge of #65478 - RalfJung:write, r=jonas-schievink
Mazdak Farrokhzad [Thu, 17 Oct 2019 11:46:13 +0000 (13:46 +0200)]
Rollup merge of #65478 - RalfJung:write, r=jonas-schievink

fmt::Write is about string slices, not byte slices

No idea why the docs talk about bytes, maybe a copy-paste error?

4 years agoRollup merge of #65475 - lzutao:eg_type_name, r=Centril
Mazdak Farrokhzad [Thu, 17 Oct 2019 11:46:12 +0000 (13:46 +0200)]
Rollup merge of #65475 - lzutao:eg_type_name, r=Centril

add example for type_name

So users of this function could at least expect what its output for current compiler version.

4 years agoRollup merge of #65465 - Centril:split-syntax-1, r=petrochenkov
Mazdak Farrokhzad [Thu, 17 Oct 2019 11:46:11 +0000 (13:46 +0200)]
Rollup merge of #65465 - Centril:split-syntax-1, r=petrochenkov

Move syntax::ext to a syntax_expand and refactor some attribute logic

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

r? @petrochenkov

4 years agoRollup merge of #65461 - Kampfkarren:patch-1, r=Centril
Mazdak Farrokhzad [Thu, 17 Oct 2019 11:46:09 +0000 (13:46 +0200)]
Rollup merge of #65461 - Kampfkarren:patch-1, r=Centril

Don't recommend ONCE_INIT in std::sync::Once

ONCE_INIT is deprecated, and so suggesting it as not only being on par with, but before `Once::new` is a bad idea.

4 years agoRollup merge of #65319 - RalfJung:memory, r=Centril
Mazdak Farrokhzad [Thu, 17 Oct 2019 11:46:06 +0000 (13:46 +0200)]
Rollup merge of #65319 - RalfJung:memory, r=Centril

InterpCx: make memory field public

I made this field private forever ago because I thought sealing things might be nice. But with the `memory_mut` getter it doesn't actually seal anything, and it's not like we need to invalidate caches on writes to memory or so. And moreover, having to use the getters leads to some annoying borrow checking interactions.

So, let's just make it public (again).

r? @oli-obk

4 years agoRollup merge of #65316 - oconnor663:noninheritable, r=alexcrichton
Mazdak Farrokhzad [Thu, 17 Oct 2019 11:46:04 +0000 (13:46 +0200)]
Rollup merge of #65316 - oconnor663:noninheritable, r=alexcrichton

make File::try_clone produce non-inheritable handles on Windows

~**NOT READY FOR REVIEW.** This PR is currently mainly to trigger CI so that I can see what happens. (Is there a better way to trigger CI?) I don't know whether this change makes sense yet.~ (Edit: @Mark-Simulacrum clarified that CI doesn't currently run on Windows.)

---

File handles shouldn't be inheritable in general.
`std::process::Command` takes care of making them inheritable when child
processes are spawned, and the `CREATE_PROCESS_LOCK` protects against
races in that section on Windows. But `File::try_clone` has been
creating inheritable file descriptors outside of that lock, which could
be leaking into other child processes unintentionally.

See also https://github.com/rust-lang/rust/pull/31069#discussion_r334117665.

4 years agoRollup merge of #65237 - KodrAus:fix/map-entry-err, r=sfackler
Mazdak Farrokhzad [Thu, 17 Oct 2019 11:46:03 +0000 (13:46 +0200)]
Rollup merge of #65237 - KodrAus:fix/map-entry-err, r=sfackler

Move debug_map assertions after check for err

Fixes #65231

We have some assertions in `DebugMap` to catch broken implementations of `Debug` that produce malformed entries. These checks don't make sense if formatting fails partway through. This PR moves those assertions to within the `and_then` closures along with the other formatting logic, so they're only checked if the map hasn't failed to format an entry already.

4 years agoAuto merge of #59953 - eddyb:soa-metadata, r=michaelwoerister
bors [Thu, 17 Oct 2019 10:45:09 +0000 (10:45 +0000)]
Auto merge of #59953 - eddyb:soa-metadata, r=michaelwoerister

 rustc_metadata: replace Entry table with one table for each of its fields (AoS -> SoA).

In https://github.com/rust-lang/rust/pull/59789#issuecomment-481958212 I noticed that for many cross-crate queries (e.g. `predicates_of(def_id)`), we were deserializing the `rustc_metadata::schema::Entry` for `def_id` *only* to read one field (i.e. `predicates`).

But there are several such queries, and `Entry` is not particularly small (in terms of number of fields, the encoding itself is quite compact), so there is a large (and unnecessary) constant factor.

This PR replaces the (random-access) array¹ of `Entry` structures ("AoS"), with many separate arrays¹, one for each field that used to be in `Entry` ("SoA"), resulting in the ability to read individual fields separately, with negligible time overhead (in thoery), and some size overhead (as these arrays are not sparse).

In a way, the new approach is closer to incremental on-disk caches, which store each query's cached results separately, but it would take significantly more work to unify the two.

For stage1 `libcore`'s metadata blob, the size overhead is `8.44%`, and I have another commit (~~not initially included because I want to do perf runs with both~~ **EDIT**: added it now) that brings it down to `5.88%`.

¹(in the source, these arrays are called "tables", but perhaps they could use a better name)

4 years agoAuto merge of #65251 - tlively:emscripten-upstream-upgrade, r=tlively
bors [Thu, 17 Oct 2019 06:47:18 +0000 (06:47 +0000)]
Auto merge of #65251 - tlively:emscripten-upstream-upgrade, r=tlively

Upgrade Emscripten targets to use upstream LLVM backend

 - Compatible with Emscripten 1.38.46-upstream or later upstream.
 - Refactors the Emscripten target spec to share code with other wasm
   targets.
 - Replaces the old incorrect wasm32 C call ABI with the correct one,
   preserving the old one as wasm32_bindgen_compat for wasm-bindgen
   compatibility.
 - Updates the varargs ABI used by Emscripten and deletes the old one.
 - Removes the obsolete wasm32-experimental-emscripten target.
 - Uses EMCC_CFLAGS on CI to avoid the timeout problems with #63649.

r? @alexcrichton

4 years agoRemove PR runs, enable wasm32 CI, and move asmjs to disabled
Thomas Lively [Thu, 17 Oct 2019 04:18:34 +0000 (21:18 -0700)]
Remove PR runs, enable wasm32 CI, and move asmjs to disabled

4 years agodoc: fix typo in OsStrExt and OsStringExt
Ben Boeckel [Thu, 17 Oct 2019 02:22:19 +0000 (22:22 -0400)]
doc: fix typo in OsStrExt and OsStringExt

4 years agoAuto merge of #65234 - GuillaumeGomez:long-err-explanation-E0573, r=kinnison
bors [Thu, 17 Oct 2019 02:04:49 +0000 (02:04 +0000)]
Auto merge of #65234 - GuillaumeGomez:long-err-explanation-E0573, r=kinnison

Add long error explanation for E0573

Part of #61137.

4 years agoUser should not change between emcc install and use
Thomas Lively [Thu, 17 Oct 2019 00:06:34 +0000 (17:06 -0700)]
User should not change between emcc install and use

4 years agoUpdate test expectations
Thomas Lively [Mon, 14 Oct 2019 21:19:53 +0000 (14:19 -0700)]
Update test expectations

4 years agoUpdate test and add -O1 to wasm32 Dockerfile
Thomas Lively [Sat, 12 Oct 2019 00:14:48 +0000 (17:14 -0700)]
Update test and add -O1 to wasm32 Dockerfile

4 years agoTemporarily enable asmjs and wasm32 on PR CI
Thomas Lively [Wed, 9 Oct 2019 21:17:48 +0000 (14:17 -0700)]
Temporarily enable asmjs and wasm32 on PR CI

4 years agoUpgrade Emscripten targets to use upstream LLVM backend
Thomas Lively [Sat, 17 Aug 2019 05:08:01 +0000 (22:08 -0700)]
Upgrade Emscripten targets to use upstream LLVM backend

 - Compatible with Emscripten 1.38.46-upstream or later upstream.
 - Refactors the Emscripten target spec to share code with other wasm
   targets.
 - Replaces the old incorrect wasm32 C call ABI with the correct one,
   preserving the old one as wasm32_bindgen_compat for wasm-bindgen
   compatibility.
 - Updates the varargs ABI used by Emscripten and deletes the old one.
 - Removes the obsolete wasm32-experimental-emscripten target.
 - Uses EMCC_CFLAGS on CI to avoid the timeout problems with #63649.

4 years agofmt::Write is about string slices, not byte slices
Ralf Jung [Wed, 16 Oct 2019 21:24:38 +0000 (23:24 +0200)]
fmt::Write is about string slices, not byte slices

4 years agopanictry!(..) -> .unwrap()
Mazdak Farrokhzad [Wed, 16 Oct 2019 17:22:56 +0000 (19:22 +0200)]
panictry!(..) -> .unwrap()

4 years agoAuto merge of #63756 - Zoxc:sharded-dep-graph-1, r=nikomatsakis
bors [Wed, 16 Oct 2019 20:49:27 +0000 (20:49 +0000)]
Auto merge of #63756 - Zoxc:sharded-dep-graph-1, r=nikomatsakis

Use more fine grained locks for the dep graph

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

r? @michaelwoerister cc @aturon

4 years agoadd example for type_name
Lzu Tao [Wed, 16 Oct 2019 16:50:07 +0000 (16:50 +0000)]
add example for type_name

4 years agoAuto merge of #65445 - ehuss:update-cargo-books, r=alexcrichton
bors [Wed, 16 Oct 2019 16:48:44 +0000 (16:48 +0000)]
Auto merge of #65445 - ehuss:update-cargo-books, r=alexcrichton

Update cargo, books

## nomicon

3 commits in 4374786f0b4bf0606b35d5c30a9681f342e5707b..5004ad30d69f93553ceef74439fea2159d1f769e
2019-09-17 18:33:21 +0200 to 2019-10-12 19:52:40 +0200
- further clarify C11 and C/C++11 terminology (rust-lang-nursery/nomicon#169)
- atomics: C11 -> C++20 (rust-lang-nursery/nomicon#168)
- use sound/unsound terminology

## cargo

12 commits in a429e8cc4614a46a86322a0777a477e2baa83f1c..3a9abe3f065554a7fbc59f440df2baba4a6e47ee
2019-10-04 17:36:12 +0000 to 2019-10-15 15:55:35 +0000
- Fix typo in git index initialization error path (rust-lang/cargo#7512)
- Reject feature flags in a virtual workspace. (rust-lang/cargo#7507)
- Rename `overrides` to `package` in profiles. (rust-lang/cargo#7504)
- Allow publishing with dev-dependencies without a version. (rust-lang/cargo#7333)
- Stabilize cache-messages (rust-lang/cargo#7450)
- don't lock the package cache when cleaning target dir. (rust-lang/cargo#7502)
- Document rustc wrapper (rust-lang/cargo#7499)
- Migrate towards exclusively using serde for `Config` (rust-lang/cargo#7456)
- Re-enable some MSVC tests. (rust-lang/cargo#7492)
- when -Z unstable-options not specified, don't validate --profile (rust-lang/cargo#7489)
- Improve error message for cyclic dependencies (rust-lang/cargo#7470)
- Some minor clippy fixes. (rust-lang/cargo#7484)

## book

7 commits in 04806c80be0f54b1290287e3f85e84bdfc0b6ec7..9bb8b161963fcebc9d9ccd732ba26f42108016d5
2019-10-01 20:20:22 -0400 to 2019-10-14 18:42:55 -0500
- Make a portion of text less ambiguous (rust-lang/book#2092)
- fix heading level (rust-lang/book#2117)
- Add missing "of" before `"duck typing"`. (rust-lang/book#1951)
- ch18-03: no need to debug print destructured int (rust-lang/book#1991)
- Subtle fix to introduce ? on Option in Chapter 9.2 (rust-lang/book#2047)
- make wording clearer (rust-lang/book#1976)
- Update the version of rand we use

## rust-by-example

5 commits in a6288e7407a6c4c19ea29de6d43f40c803883f21..0b111eaae36cc4b4997684be853882a59e2c7ca7
2019-10-01 10:09:14 -0300 to 2019-10-14 18:34:25 -0300
- Some fix to three files (rust-lang/rust-by-example#1280)
- Add reference to Generics (rust-lang/rust-by-example#1281)
- Confusing and long sentence (rust-lang/rust-by-example#1282)
- Explicit mention of slice range meaning (rust-lang/rust-by-example#1277)
- Updated aliasing for nll (rust-lang/rust-by-example#1276)

4 years agoui-fulldeps: make them pass again?
Mazdak Farrokhzad [Wed, 16 Oct 2019 11:23:46 +0000 (13:23 +0200)]
ui-fulldeps: make them pass again?

4 years agoUpdate cargo, books
Eric Huss [Tue, 15 Oct 2019 17:46:03 +0000 (10:46 -0700)]
Update cargo, books

4 years agoAuto merge of #65172 - tanriol:explain_borrow-use-context-dominators, r=nagisa
bors [Wed, 16 Oct 2019 12:49:49 +0000 (12:49 +0000)]
Auto merge of #65172 - tanriol:explain_borrow-use-context-dominators, r=nagisa

use precalculated dominators in explain_borrow

This looks like the only place calculating dominators from the MIR body every time instead of using the ones stored on the `MirBorrowckCtxt`. For example, in rust-lang/rust#65131 a big generated function with a number of borrowck errors takes a few hours(!) recalculating the dominators while explaining the errors.

I don't know enough about this part of rustc codebase to know for sure that this change is correct, but no tests seem to fail as a result of this change in local testing.

4 years agoupdate ui tests
Guillaume Gomez [Wed, 9 Oct 2019 12:19:48 +0000 (14:19 +0200)]
update ui tests

4 years agoAdd long error explanation for E0573
Guillaume Gomez [Wed, 9 Oct 2019 12:19:39 +0000 (14:19 +0200)]
Add long error explanation for E0573

4 years agomake tidy happy
Mazdak Farrokhzad [Sat, 12 Oct 2019 04:12:00 +0000 (06:12 +0200)]
make tidy happy

4 years agombe: leave a FIXME
Mazdak Farrokhzad [Tue, 8 Oct 2019 23:52:19 +0000 (01:52 +0200)]
mbe: leave a FIXME

4 years agoparser: leave a FIXME for later
Mazdak Farrokhzad [Tue, 8 Oct 2019 19:43:43 +0000 (21:43 +0200)]
parser: leave a FIXME for later

4 years agomove SeqSep to parser.rs
Mazdak Farrokhzad [Tue, 8 Oct 2019 10:59:59 +0000 (12:59 +0200)]
move SeqSep to parser.rs

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 agoDon't recommend ONCE_INIT in std::sync::Once
boyned//Kampfkarren [Wed, 16 Oct 2019 07:06:01 +0000 (00:06 -0700)]
Don't recommend ONCE_INIT in std::sync::Once

ONCE_INIT is deprecated, and so suggesting it as not only being on par with, but before `Once::new` is a bad idea.

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 agorustc_metadata: address some review comments.
Eduard-Mihai Burtescu [Mon, 14 Oct 2019 15:42:08 +0000 (18:42 +0300)]
rustc_metadata: address some review comments.

4 years agorustc_metadata: don't use more space than needed, for each Table.
Eduard-Mihai Burtescu [Sun, 14 Apr 2019 02:21:39 +0000 (05:21 +0300)]
rustc_metadata: don't use more space than needed, for each Table.

4 years agorustc_metadata: replace Entry table with one table for each of its fields (AoS -...
Eduard-Mihai Burtescu [Sun, 14 Apr 2019 01:19:28 +0000 (04:19 +0300)]
rustc_metadata: replace Entry table with one table for each of its fields (AoS -> SoA).

4 years agorustc_metadata: use decoder::Metadata instead of &[u8] for Lazy<Table<T>>::get.
Eduard-Mihai Burtescu [Sat, 13 Apr 2019 22:36:08 +0000 (01:36 +0300)]
rustc_metadata: use decoder::Metadata instead of &[u8] for Lazy<Table<T>>::get.

4 years agorustc_metadata: generalize Table<T> to hold T, not Lazy<T>, elements.
Eduard-Mihai Burtescu [Sat, 13 Apr 2019 20:30:53 +0000 (23:30 +0300)]
rustc_metadata: generalize Table<T> to hold T, not Lazy<T>, elements.

4 years agorustc_metadata: add a helper macro for recording into PerDefTable's.
Eduard-Mihai Burtescu [Sat, 13 Apr 2019 18:52:18 +0000 (21:52 +0300)]
rustc_metadata: add a helper macro for recording into PerDefTable's.

4 years agorustc_metadata: split tables into an usize-keyed Table and a DefIndex-keyed PerDefTable.
Eduard-Mihai Burtescu [Sat, 13 Apr 2019 16:18:12 +0000 (19:18 +0300)]
rustc_metadata: split tables into an usize-keyed Table and a DefIndex-keyed PerDefTable.

4 years agorustc_metadata: replace Lazy<[Table<T>]> with Lazy<Table<T>>.
Eduard-Mihai Burtescu [Thu, 11 Apr 2019 20:36:00 +0000 (23:36 +0300)]
rustc_metadata: replace Lazy<[Table<T>]> with Lazy<Table<T>>.

4 years agorustc_metadata: parametrize Table by element type.
Eduard-Mihai Burtescu [Thu, 11 Apr 2019 19:52:12 +0000 (22:52 +0300)]
rustc_metadata: parametrize Table by element type.

4 years agorustc_metadata: rename index::Index to table::Table.
Eduard-Mihai Burtescu [Thu, 23 May 2019 17:29:01 +0000 (20:29 +0300)]
rustc_metadata: rename index::Index to table::Table.

4 years agorustc_metadata: use 0 in index::Index to indicate missing entries.
Eduard-Mihai Burtescu [Thu, 11 Apr 2019 16:56:59 +0000 (19:56 +0300)]
rustc_metadata: use 0 in index::Index to indicate missing entries.

4 years agorustc_metadata: use NonZeroUsize for the position of a Lazy.
Eduard-Mihai Burtescu [Thu, 11 Apr 2019 15:24:38 +0000 (18:24 +0300)]
rustc_metadata: use NonZeroUsize for the position of a Lazy.

4 years agorustc_metadata: remove now-redundant length from the start of the encoding.
Eduard-Mihai Burtescu [Wed, 22 May 2019 10:46:14 +0000 (13:46 +0300)]
rustc_metadata: remove now-redundant length from the start of the encoding.

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