]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRc: value -> allocation
Ralf Jung [Thu, 17 Oct 2019 17:37:05 +0000 (19:37 +0200)]
Rc: value -> allocation

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 agoPlugins deprecation: don’t suggest simply removing the attribute
Simon Sapin [Thu, 17 Oct 2019 11:51:46 +0000 (13:51 +0200)]
Plugins deprecation: don’t suggest simply removing the attribute

Building Servo with a recent Nightly produces:

```rust
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
  --> components/script/lib.rs:14:1
   |
14 | #![plugin(script_plugins)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
   |
   = note: `#[warn(deprecated)]` on by default
```

First, linking to https://github.com/rust-lang/rust/issues/29597 is not ideal
since there is pretty much no discussion there of the deprecation
and what can be used instead.
This PR changes the link to the deprecation PR which does have more discussion.

Second, the “remove this attribute” suggestion is rather unhelpful.
Just because a feature is deprecated doesn’t mean that simply removing its use
without a replacement is acceptable.

In the case of custom lint, there is no replacement available.
Prefixing a message with “help:” when telling users that they’re screwed
honestly feels disrespectful.

This PR also changes the message to be more factual.

4 years agoUpdate ui tests
Guillaume Gomez [Thu, 17 Oct 2019 09:06:14 +0000 (11:06 +0200)]
Update ui tests

4 years agoAdd long error explanation for E0584
Guillaume Gomez [Thu, 17 Oct 2019 09:06:06 +0000 (11:06 +0200)]
Add long error explanation for E0584

4 years agoAvoid injecting sanitizer runtimes into staticlibs (#64629).
Christian Holler (:decoder) [Thu, 17 Oct 2019 12:09:49 +0000 (14:09 +0200)]
Avoid injecting sanitizer runtimes into staticlibs (#64629).

4 years agoproperly document panics in div_euclid and rem_euclid
Trevor Spiteri [Thu, 17 Oct 2019 11:53:57 +0000 (13:53 +0200)]
properly document panics in div_euclid and rem_euclid

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 agoUpdate emscripten functions declarations
Mateusz Mikuła [Thu, 17 Oct 2019 10:09:11 +0000 (12:09 +0200)]
Update emscripten functions declarations

4 years agoUpdate ui tests
Guillaume Gomez [Sat, 12 Oct 2019 12:48:28 +0000 (14:48 +0200)]
Update ui tests

4 years agoAdd long error explanation for E0575
Guillaume Gomez [Sat, 12 Oct 2019 12:48:20 +0000 (14:48 +0200)]
Add long error explanation for E0575

4 years agoshow up some extra info when t!() fails
Guanqun Lu [Thu, 17 Oct 2019 08:57:46 +0000 (16:57 +0800)]
show up some extra info when t!() fails

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 agoUse a sharded dep node to dep node index map
John Kåre Alsaker [Thu, 13 Jun 2019 21:14:44 +0000 (23:14 +0200)]
Use a sharded dep node to dep node index map

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 agoSuppress validation mismatch ICE in the presence of mut borrows
Dylan MacKenzie [Thu, 17 Oct 2019 01:01:26 +0000 (18:01 -0700)]
Suppress validation mismatch ICE in the presence of mut borrows

4 years agoEnable `drain_filter`
Dylan MacKenzie [Thu, 17 Oct 2019 01:01:01 +0000 (18:01 -0700)]
Enable `drain_filter`

4 years agoAdd regression test for #65394
Dylan MacKenzie [Thu, 17 Oct 2019 01:00:44 +0000 (18:00 -0700)]
Add regression test for #65394

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 agoInline and remove `iterate_until_fixed_point()`.
Nicholas Nethercote [Wed, 16 Oct 2019 22:30:25 +0000 (09:30 +1100)]
Inline and remove `iterate_until_fixed_point()`.

The commit also removes the debug statement, because they annoyed me.
This change wins another 1% on `unicode_normalization`, at least partly
because it no longer needs to increment `iteration`.

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 agoUse a `BitSet` in `LexicalResolver::iterate_until_fixed_point()`.
Nicholas Nethercote [Tue, 15 Oct 2019 04:16:51 +0000 (15:16 +1100)]
Use a `BitSet` in `LexicalResolver::iterate_until_fixed_point()`.

This wins 3% on `unicode_normalization`.

4 years agoLint only on single element overlap
Esteban Küber [Wed, 16 Oct 2019 19:22:23 +0000 (12:22 -0700)]
Lint only on single element overlap

4 years agoOnly emit overlapping patterns lint if the overlap is partial
Esteban Küber [Mon, 7 Oct 2019 04:47:01 +0000 (21:47 -0700)]
Only emit overlapping patterns lint if the overlap is partial

4 years agoContinue to emit unreachable pattern on cases caught by overlapping patterns
Esteban Küber [Fri, 30 Aug 2019 20:37:59 +0000 (13:37 -0700)]
Continue to emit unreachable pattern on cases caught by overlapping patterns

4 years agorename method
Esteban Küber [Fri, 30 Aug 2019 01:00:29 +0000 (18:00 -0700)]
rename method

4 years agoDeduplicate code for formatting `RangeEnd`
Esteban Küber [Fri, 30 Aug 2019 00:42:45 +0000 (17:42 -0700)]
Deduplicate code for formatting `RangeEnd`

4 years agoreview comments: use if let
Esteban Küber [Fri, 30 Aug 2019 00:41:41 +0000 (17:41 -0700)]
review comments: use if let

4 years agoMove lint emitter to its own method
Esteban Küber [Fri, 30 Aug 2019 00:41:25 +0000 (17:41 -0700)]
Move lint emitter to its own method

4 years agoSilence lint in `fit_signed` and `fit_unsigned`
Esteban Küber [Fri, 30 Aug 2019 00:20:20 +0000 (17:20 -0700)]
Silence lint in `fit_signed` and `fit_unsigned`

4 years agoMove overlapping patterns to its own lint
Esteban Küber [Fri, 30 Aug 2019 00:16:39 +0000 (17:16 -0700)]
Move overlapping patterns to its own lint

4 years agoAdd check for overlapping ranges to unreachable patterns lint
Esteban Küber [Thu, 29 Aug 2019 23:06:44 +0000 (16:06 -0700)]
Add check for overlapping ranges to unreachable patterns lint

4 years agoUninitialized boxes: check for zero-size allocation based on Layout::size
Simon Sapin [Wed, 16 Oct 2019 18:32:58 +0000 (20:32 +0200)]
Uninitialized boxes: check for zero-size allocation based on Layout::size

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 agoMirror crosstool-ng on rust-lang-ci-mirrors
msizanoen [Wed, 16 Oct 2019 14:34:17 +0000 (21:34 +0700)]
Mirror crosstool-ng on rust-lang-ci-mirrors

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 agoUpdate libc to 0.2.64
Mateusz Mikuła [Wed, 16 Oct 2019 10:50:59 +0000 (12:50 +0200)]
Update libc to 0.2.64

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 agoFix comparison after rebase
Esteban Küber [Tue, 15 Oct 2019 21:07:32 +0000 (14:07 -0700)]
Fix comparison after rebase

4 years agoSimplify code
Esteban Küber [Tue, 15 Oct 2019 20:29:26 +0000 (13:29 -0700)]
Simplify code

4 years agoDo not suggest restriction on spans originating in macros
Esteban Küber [Tue, 15 Oct 2019 20:29:07 +0000 (13:29 -0700)]
Do not suggest restriction on spans originating in macros

4 years agoreview comments
Esteban Küber [Tue, 15 Oct 2019 20:16:33 +0000 (13:16 -0700)]
review comments

4 years agoRemove trailing whitespace
Esteban Küber [Thu, 10 Oct 2019 20:22:05 +0000 (13:22 -0700)]
Remove trailing whitespace

4 years agoRemove useless `help`
Esteban Küber [Thu, 10 Oct 2019 20:17:51 +0000 (13:17 -0700)]
Remove useless `help`

4 years agoDeduplicate some code and apply review comments
Esteban Küber [Thu, 10 Oct 2019 16:50:45 +0000 (09:50 -0700)]
Deduplicate some code and apply review comments

4 years agoSuggest associated bound restrictions in `impl`s
Esteban Küber [Wed, 9 Oct 2019 22:54:23 +0000 (15:54 -0700)]
Suggest associated bound restrictions in `impl`s

4 years agoHandle missing projection restriction
Esteban Küber [Wed, 9 Oct 2019 22:07:22 +0000 (15:07 -0700)]
Handle missing projection restriction

4 years agoUpdate NLL tests
Esteban Küber [Tue, 8 Oct 2019 23:19:39 +0000 (16:19 -0700)]
Update NLL tests

4 years agoConsider trait aliases
Esteban Küber [Tue, 8 Oct 2019 23:13:20 +0000 (16:13 -0700)]
Consider trait aliases

4 years agoUpdate some tests involving `Self`
Esteban Küber [Tue, 8 Oct 2019 23:13:05 +0000 (16:13 -0700)]
Update some tests involving `Self`