]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRollup merge of #65549 - t-rapp:tr-wrapping-rotate-docs, r=jonas-schievink
Tyler Mandry [Fri, 18 Oct 2019 20:48:37 +0000 (13:48 -0700)]
Rollup merge of #65549 - t-rapp:tr-wrapping-rotate-docs, r=jonas-schievink

Fix left/right shift typo in wrapping rotate docs

This makes the note similar to the one found on rotate functions for primitive types like i32/u32.

4 years agoRollup merge of #65540 - guanqun:extend-t-macro, r=nikomatsakis
Tyler Mandry [Fri, 18 Oct 2019 20:48:35 +0000 (13:48 -0700)]
Rollup merge of #65540 - guanqun:extend-t-macro, r=nikomatsakis

show up some extra info when t!() fails

4 years agoRollup merge of #65535 - eddyb:sliced-predicates, r=nikomatsakis
Tyler Mandry [Fri, 18 Oct 2019 20:48:34 +0000 (13:48 -0700)]
Rollup merge of #65535 - eddyb:sliced-predicates, r=nikomatsakis

rustc: arena-allocate the slice in `ty::GenericsPredicate`, not the whole struct.

While rebasing #59789 I noticed we can do this now. However, it doesn't help much without changing `inferred_outlives_of` to the same type, which I might try next.

4 years agoRollup merge of #65532 - tshepang:shorten-intro, r=Dylan-DPC
Tyler Mandry [Fri, 18 Oct 2019 20:48:32 +0000 (13:48 -0700)]
Rollup merge of #65532 - tshepang:shorten-intro, r=Dylan-DPC

doc: make BitSet intro more short

Also, add a link to the growable type

4 years agoRollup merge of #65513 - RalfJung:fmt, r=Mark-Simulacrum
Tyler Mandry [Fri, 18 Oct 2019 20:48:31 +0000 (13:48 -0700)]
Rollup merge of #65513 - RalfJung:fmt, r=Mark-Simulacrum

reorder fmt docs for more clarity

I adjusted these docs in https://github.com/rust-lang/rust/pull/65332 but wasn't happy with the result when seeing it in rustdoc. So this reorders the subsections in the "Formatting Parameters" section to be more logical (subsections that reference `width` come after the `width` subsection) and they also all have examples now.

4 years agoRollup merge of #65511 - Xanewok:sa-nest-in-impls, r=pnkfelix
Tyler Mandry [Fri, 18 Oct 2019 20:48:29 +0000 (13:48 -0700)]
Rollup merge of #65511 - Xanewok:sa-nest-in-impls, r=pnkfelix

save-analysis: Nest tables when processing impl block definitions

Similar to #65353 (which this PR should've been a part of), however in this case we didn't previously nest the tables when processing trait paths in impl block declarations.

Closes #65411

4 years agoRollup merge of #65508 - rust-lang:llvm-icebreakers-ping-1, r=simulacrum
Tyler Mandry [Fri, 18 Oct 2019 20:48:28 +0000 (13:48 -0700)]
Rollup merge of #65508 - rust-lang:llvm-icebreakers-ping-1, r=simulacrum

add option to ping llvm ice-breakers to triagebot

4 years agoRollup merge of #65498 - SimonSapin:plugin-help, r=Centril
Tyler Mandry [Fri, 18 Oct 2019 20:48:26 +0000 (13:48 -0700)]
Rollup merge of #65498 - SimonSapin:plugin-help, r=Centril

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 agoRollup merge of #65496 - tspiteri:euc-div-panic, r=KodrAus
Tyler Mandry [Fri, 18 Oct 2019 20:48:25 +0000 (13:48 -0700)]
Rollup merge of #65496 - tspiteri:euc-div-panic, r=KodrAus

properly document panics in div_euclid and rem_euclid

For signed numbers, document that `div_euclid` and `rem_euclid` panic not just when `rhs` is 0, but also when the division overflows.

For unsigned numbers, document that `div_euclid` and `rem_euclid` panic when `rhs` is 0.

4 years agoRollup merge of #65493 - GuillaumeGomez:long-err-explanation-E0584, r=kinnison
Tyler Mandry [Fri, 18 Oct 2019 20:48:24 +0000 (13:48 -0700)]
Rollup merge of #65493 - GuillaumeGomez:long-err-explanation-E0584, r=kinnison

Add long error explanation for E0584

Part of #61137.

r? @kinnison

4 years agoRollup merge of #65480 - nnethercote:rm-iterate_until_fixed_size, r=nikomatsakis
Tyler Mandry [Fri, 18 Oct 2019 20:48:22 +0000 (13:48 -0700)]
Rollup merge of #65480 - nnethercote:rm-iterate_until_fixed_size, r=nikomatsakis

Speed up `LexicalResolve::expansion()`

A couple of improvements that speed up `unicode_normalization` by about 4%. The first commit was enabled by the improvements to `BitSet` iteration in #65425.

r? @nikomatsakis

4 years agoRollup merge of #65472 - Zoxc:sharded-dep-graph-2, r=nikomatsakis
Tyler Mandry [Fri, 18 Oct 2019 20:48:20 +0000 (13:48 -0700)]
Rollup merge of #65472 - Zoxc:sharded-dep-graph-2, r=nikomatsakis

Use a sharded dep node to dep node index map

Split out from https://github.com/rust-lang/rust/pull/61845 and based on https://github.com/rust-lang/rust/pull/63756.

r? @nikomatsakis

4 years agoRollup merge of #65455 - nnethercote:avoid-unnecessary-TokenTree-to-TokenStream-conve...
Tyler Mandry [Fri, 18 Oct 2019 20:48:18 +0000 (13:48 -0700)]
Rollup merge of #65455 - nnethercote:avoid-unnecessary-TokenTree-to-TokenStream-conversions, r=petrochenkov

Avoid unnecessary `TokenTree` to `TokenStream` conversions

A `TokenStream` contains any number of `TokenTrees`. Therefore, a single `TokenTree` can be promoted to a `TokenStream`. But doing so costs two allocations: one for the single-element `Vec`, and one for the `Lrc`. (An `IsJoint` value also must be added; the default is `NonJoint`.)

The current code converts `TokenTree`s to `TokenStream`s unnecessarily in a few places. This PR removes some of these unnecessary conversions, both simplifying the code and speeding it up.

r? @petrochenkov

4 years agoRollup merge of #65364 - XiangQingW:master, r=estebank
Tyler Mandry [Fri, 18 Oct 2019 20:48:16 +0000 (13:48 -0700)]
Rollup merge of #65364 - XiangQingW:master, r=estebank

Collect occurrences of empty blocks for mismatched braces diagnostic

Fix #63904

4 years agoRollup merge of #65334 - GuillaumeGomez:long-err-explanation-E0575, r=kinnison
Tyler Mandry [Fri, 18 Oct 2019 20:48:14 +0000 (13:48 -0700)]
Rollup merge of #65334 - GuillaumeGomez:long-err-explanation-E0575, r=kinnison

Add long error explanation for E0575

Part of #61137.

4 years agoRollup merge of #65201 - tmiasko:no-bindings, r=rkruppe
Tyler Mandry [Fri, 18 Oct 2019 20:48:13 +0000 (13:48 -0700)]
Rollup merge of #65201 - tmiasko:no-bindings, r=rkruppe

Disable Go and OCaml bindings when building LLVM

Instead of instaling OCaml bindings in a location where installation
will not fail, don't build them in the first place.

4 years agoRollup merge of #65197 - spastorino:place-mut-visitor-adjusts2, r=oli-obk
Tyler Mandry [Fri, 18 Oct 2019 20:48:11 +0000 (13:48 -0700)]
Rollup merge of #65197 - spastorino:place-mut-visitor-adjusts2, r=oli-obk

Prepare `MutVisitor`s to handle interned projections

The following are all the files where mir's `MutVisitor` is implemented. The `-` there stands for no changes, `visit_place` wasn't making any change on `Place`s. `x` stands for this file was changed to make `visit_place` do whatever it was doing with the base but avoid modifying the projection, instead just create a new one and assign to it.

```
[-] src/librustc_mir/transform/no_landing_pads.rs
[x] src/librustc_mir/transform/promote_consts.rs
[x] src/librustc_mir/transform/generator.rs
[x] src/librustc_mir/transform/erase_regions.rs
[-] src/librustc_mir/transform/instcombine.rs
[x] src/librustc_mir/transform/inline.rs
[x] src/librustc_mir/transform/simplify.rs
[x] src/librustc_mir/util/def_use.rs
[-] src/librustc_mir/transform/const_prop.rs
[-] src/librustc_mir/transform/cleanup_post_borrowck.rs
[x] src/librustc_mir/borrow_check/nll/renumber.rs
[-] src/librustc_mir/transform/copy_prop.rs
```

There is some code repetition, just created the PR so we can start discussing it.

/cc @oli-obk @nikomatsakis

4 years agoRollup merge of #65016 - lzutao:inline-mem-constfn, r=oli-obk
Tyler Mandry [Fri, 18 Oct 2019 20:48:10 +0000 (13:48 -0700)]
Rollup merge of #65016 - lzutao:inline-mem-constfn, r=oli-obk

Always inline `mem::{size_of,align_of}` in debug builds

Those two are const fn and do not have any arguments. Inlining
helps reducing generated code size in debug builds.

See also #64996.

4 years agoUse Cow to handle modifications of projection in preparation for interning
Santiago Pastorino [Wed, 9 Oct 2019 02:46:14 +0000 (23:46 -0300)]
Use Cow to handle modifications of projection in preparation for interning

4 years agoAuto merge of #64925 - ehuss:document-json, r=Mark-Simulacrum
bors [Fri, 18 Oct 2019 10:15:26 +0000 (10:15 +0000)]
Auto merge of #64925 - ehuss:document-json, r=Mark-Simulacrum

Document JSON message output.

This documents the JSON messages in the rustc book.

4 years agoFix left/right shift typo in wrapping rotate docs
Tobias Rapp [Fri, 18 Oct 2019 06:29:18 +0000 (08:29 +0200)]
Fix left/right shift typo in wrapping rotate docs

This makes the note similar to the one found on rotate functions for
primitive types like i32/u32.

4 years agoChange `MetaItem::tokens()` to `MetaItem::token_trees_and_joints()`.
Nicholas Nethercote [Mon, 14 Oct 2019 03:06:00 +0000 (14:06 +1100)]
Change `MetaItem::tokens()` to `MetaItem::token_trees_and_joints()`.

Likewise for `NestedMetaItem::tokens()`. Also, add
`MetaItemKind::token_trees_and_joints()`, which `MetaItemKind::tokens()`
now calls.

This avoids some unnecessary `TokenTree` to `TokenStream` conversions,
and removes the need for the clumsy
`TokenStream::append_to_tree_and_joint_vec()`.

4 years agoChange `Lit::tokens()` to `Lit::token_tree()`.
Nicholas Nethercote [Mon, 14 Oct 2019 00:24:46 +0000 (11:24 +1100)]
Change `Lit::tokens()` to `Lit::token_tree()`.

Because most of the call sites have an easier time working with a
`TokenTree` instead of a `TokenStream`.

4 years agoMake `TokenStream::from_iter` less general and more efficient.
Nicholas Nethercote [Sun, 13 Oct 2019 23:37:21 +0000 (10:37 +1100)]
Make `TokenStream::from_iter` less general and more efficient.

The current code has this impl:
```
impl<T: Into<TokenStream>> iter::FromIterator<T> for TokenStream
```
If given an `IntoIterator<Item = TokenTree>`, it will convert each individual
`TokenTree` to a `TokenStream` (at the cost of two allocations: a `Vec`
and an `Lrc`). It will then merge those `TokenStream`s into a single
`TokenStream`. This is inefficient.

This commit changes the impl to this less general one:
```
impl iter::FromIterator<TokenTree> for TokenStream
```
It collects the `TokenTree`s into a single `Vec` first and then converts that
to a `TokenStream` by wrapping it in a single `Lrc`. The previous generality
was unnecessary; no other code needs changing.

This change speeds up several benchmarks by up to 4%.

4 years agoRemove two no-op `into()` calls.
Nicholas Nethercote [Tue, 15 Oct 2019 22:30:28 +0000 (09:30 +1100)]
Remove two no-op `into()` calls.

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 agoAdd process_* place hooks to improve code reutilization
Santiago Pastorino [Tue, 8 Oct 2019 18:33:19 +0000 (15:33 -0300)]
Add process_* place hooks to improve code reutilization

4 years agoSetup a different visit place set of methods for mutable and immutable visitors
Santiago Pastorino [Tue, 8 Oct 2019 15:16:26 +0000 (12:16 -0300)]
Setup a different visit place set of methods for mutable and immutable visitors

In particular, use a blank visit_place for mutable visitor to be sure,
non modified visitors are not trying to mutating place.

4 years agoRemove unneeded callback and just use the new_local value
Santiago Pastorino [Tue, 8 Oct 2019 03:33:47 +0000 (00:33 -0300)]
Remove unneeded callback and just use the new_local value

4 years agoPrepare def_use MutVisitor to have projections interned
Santiago Pastorino [Tue, 8 Oct 2019 03:24:18 +0000 (00:24 -0300)]
Prepare def_use MutVisitor to have projections interned

4 years agoPrepare erase_regions MutVisitor to have projections interned
Santiago Pastorino [Mon, 7 Oct 2019 22:35:41 +0000 (19:35 -0300)]
Prepare erase_regions MutVisitor to have projections interned

4 years agoPrepare generator MutVisitor to have projections interned
Santiago Pastorino [Mon, 7 Oct 2019 22:14:35 +0000 (19:14 -0300)]
Prepare generator MutVisitor to have projections interned

4 years agoPrepare inline MutVisitor to have projections interned
Santiago Pastorino [Mon, 7 Oct 2019 21:23:39 +0000 (18:23 -0300)]
Prepare inline MutVisitor to have projections interned

4 years agoPrepare renumber MutVisitor to have projections interned
Santiago Pastorino [Mon, 7 Oct 2019 21:15:19 +0000 (18:15 -0300)]
Prepare renumber MutVisitor to have projections interned

4 years agoPrepare simplify MutVisitor to have projections interned
Santiago Pastorino [Mon, 7 Oct 2019 20:58:28 +0000 (17:58 -0300)]
Prepare simplify MutVisitor to have projections interned

4 years agoPrepare promote_consts MutVisitor to have projections interned
Santiago Pastorino [Mon, 7 Oct 2019 19:39:20 +0000 (16:39 -0300)]
Prepare promote_consts MutVisitor to have projections interned

4 years agosuper_ty on MutVisitor is empty so avoid the call
Santiago Pastorino [Mon, 7 Oct 2019 22:36:48 +0000 (19:36 -0300)]
super_ty on MutVisitor is empty so avoid the call

4 years agorustc: arena-allocate the slice in `ty::GenericsPredicate`, not the whole struct.
Eduard-Mihai Burtescu [Fri, 18 Oct 2019 00:14:57 +0000 (03:14 +0300)]
rustc: arena-allocate the slice in `ty::GenericsPredicate`, not the whole struct.

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

4 years agodoc: make BitSet intro more short
Tshepang Lekhonkhobe [Thu, 17 Oct 2019 23:16:30 +0000 (01:16 +0200)]
doc: make BitSet intro more short

Also, add a link to the growable type

4 years agoexample for padding any format
Ralf Jung [Thu, 17 Oct 2019 21:00:46 +0000 (23:00 +0200)]
example for padding any format

4 years agoUpdate triagebot.toml
Niko Matsakis [Thu, 17 Oct 2019 20:53:47 +0000 (16:53 -0400)]
Update triagebot.toml

Co-Authored-By: Mark Rousskov <mark.simulacrum@gmail.com>
4 years agoreorder fmt docs for more clarity
Ralf Jung [Thu, 17 Oct 2019 19:22:46 +0000 (21:22 +0200)]
reorder fmt docs for more clarity

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 agosave-analysis: Add a relevant test case
Igor Matuszewski [Thu, 17 Oct 2019 18:49:06 +0000 (20:49 +0200)]
save-analysis: Add a relevant test case

4 years agosave-analysis: Nest tables when processing impl items
Igor Matuszewski [Thu, 17 Oct 2019 18:48:00 +0000 (20:48 +0200)]
save-analysis: Nest tables when processing impl items

4 years agoadd option to ping llvm ice-breakers to triagebot
Niko Matsakis [Thu, 17 Oct 2019 18:15:59 +0000 (14:15 -0400)]
add option to ping llvm ice-breakers to triagebot

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 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 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 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 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 -&gt; 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.