Commit Graph

78630 Commits

Author SHA1 Message Date
bors
1962a70e71 Auto merge of #50866 - michaelwoerister:relocations-in-vec, r=oli-obk
Use different datastructure for MIRI relocations

This PR makes relocations in MIRI used a sorted vector instead of a `BTreeMap` which should make a few common operations more efficient. Let's see if that's true.

r? @oli-obk
2018-05-23 12:24:48 +00:00
Niko Matsakis
688324e176 pacify the mercilous tidy 2018-05-23 08:17:04 -04:00
Niko Matsakis
42d0b363c1 handle fully qualified paths properly when linting
fixes #50970
2018-05-23 05:51:03 -04:00
bors
c3733a770e Auto merge of #50528 - whitfin:issue-50508, r=michaelwoerister
Remove attribute_cache from CrateMetadata

This PR will fix #50508 by removing the `attribute_cache` from the `CrateMetadata` struct. Seeing as performance was referenced in the original issue, I also cleaned up a `self.entry(node_id);` call which might have occasionally happened redundantly.

r? @michaelwoerister
2018-05-23 09:50:54 +00:00
bors
531e4ab7bc Auto merge of #50798 - bobtwinkles:nll_facts_invalidate, r=nikomatsakis
Generate "invalidates" facts when -Znll-facts is passed

Most of the new code is copied directly from the heart of the MIR borrowchecker. I was expecting more fundamental structural changes, hence the copying. This appears to work as it stands, but I'd like to submit a follow-up PR to reduce code duplication. I figured that could wait though, since this is blocking a large amount of work in the borrow check repository and I'm out of time for tonight =).

r? @nikomatsakis
2018-05-23 07:15:34 +00:00
bors
9a4e5df126 Auto merge of #50682 - F001:issue-50589, r=petrochenkov
Add lint for multiple associated types

Fix https://github.com/rust-lang/rust/issues/50589. cc @abonander
2018-05-23 05:09:13 +00:00
Esteban Küber
b2562fbcba Tweak main type arguments and where clause spans
Tweak the spans for error when finding type arguments or where clauses
in main and start functions.
2018-05-22 21:09:57 -07:00
bors
5ec4ab9b68 Auto merge of #50982 - alexcrichton:less-warnings, r=nikomatsakis
rustc: Fix another double-lint issue with `crate::`

This commit fixes another issue in the `absolute_path_not_starting_with_crate`
lint where it warns twice about an import which may contain `self`. It turns out
there were a few more locations that needed updating to use `root_id` and
`root_span` introduced in #50970 and after that it looks to work like a charm!

Closes #50978
2018-05-23 02:44:08 +00:00
F001
88f810f52e inverting speculative flag 2018-05-23 08:59:08 +08:00
Taylor Cramer
15d2f965d8 Add Option::as_pin_mut 2018-05-22 17:24:49 -07:00
Taylor Cramer
b7ccb24848 Add PinMut::set 2018-05-22 17:24:49 -07:00
Taylor Cramer
640f6f0749 Add Pinned type for opting out of Unpin on stable 2018-05-22 17:24:49 -07:00
Taylor Cramer
a44abfdc29 Make Unpin safe to implement 2018-05-22 17:24:49 -07:00
Niko Matsakis
be2bb8084c thread info about CrateLint through more deeply 2018-05-22 19:05:42 -04:00
Niko Matsakis
e9e8514ca0 add Span information into Qself 2018-05-22 19:05:42 -04:00
Alex Crichton
e39c959294 rustc: Fix another double-lint issue with crate::
This commit fixes another issue in the `absolute_path_not_starting_with_crate`
lint where it warns twice about an import which may contain `self`. It turns out
there were a few more locations that needed updating to use `root_id` and
`root_span` introduced in #50970 and after that it looks to work like a charm!

Closes #50978
2018-05-22 15:59:51 -07:00
Nicholas Nethercote
8d0fad5d38 Shrink LiveNode.
`Liveness::users` is a vector that is occasionally enormous. For
example, doing a "clean incremental" check build of `inflate`, there is
one instance that represents 5,499 live nodes and 1087 vars, which
requires 5,977,413 entries. At 24 bytes per entry, that is 143MB.

This patch changes LiveNode from a usize to a u32. On 64-bit machines
that halves the size of these entries, significantly reducing peak
memory usage and memory traffic, and speeding up "clean incremental"
builds of `inflate` by about 10%.
2018-05-23 08:55:35 +10:00
bors
71e87be381 Auto merge of #50713 - killercup:update-rustfix, r=alexcrichton
Update rustfix

- Update compiletest to use rustfix 0.3.1

r? @Manishearth
2018-05-22 21:33:03 +00:00
Manish Goregaokar
d7086cac3d Fix span for type-only arguments 2018-05-22 13:29:28 -07:00
Pascal Hertleif
7a738564d7
Update compiltest to use rustfix 0.3.1 2018-05-22 22:04:45 +02:00
Alex Crichton
a137d00ce5 rustc: Correctly pretty-print macro delimiters
This commit updates the `Mac_` AST structure to keep track of the delimiters
that it originally had for its invocation. This allows us to faithfully
pretty-print macro invocations not using parentheses (e.g. `vec![...]`). This in
turn helps procedural macros due to #43081.

Closes #50840
2018-05-22 11:56:41 -07:00
bors
d034ae53c4 Auto merge of #50969 - nikomatsakis:issue-50673-broken-migration-lint, r=alexcrichton
fix suggestions with nested paths

Fixes #50673

cc @Manishearth @petrochenkov
r? @alexcrichton
2018-05-22 18:55:54 +00:00
Nikita Popov
54f0668a10 Add -Z no-parallel-llvm flag
Codegen issues commonly only manifest under specific circumstances,
e.g. if multiple codegen units are used and ThinLTO is enabled.
However, these configuration are threaded, making the use of LLVM
debugging facilities hard, as output is interleaved.

This patch adds a -Z no-parallel-llvm flag, which allows disabling
parallelization of codegen and linking, while otherwise preserving
behavior with regard to codegen units and LTO.
2018-05-22 19:23:40 +02:00
Simon Sapin
b825477154 Remove the unstable Float trait
Following up to #49896 and #50629. Fixes #32110.

E0689 is weird.
2018-05-22 19:19:09 +02:00
bors
e0635188ed Auto merge of #50968 - kennytm:rollup, r=kennytm
Rollup of 15 pull requests

Successful merges:

 - #50846 (Add E0665)
 - #50849 (CheckLoopVisitor: also visit closure arguments)
 - #50863 (Make `[T]::len` and `str::len` const fn)
 - #50875 (rustdoc: use "short form" doc(cfg) printing even when combined with other conditionals)
 - #50913 (Fix typo in cell.rs)
 - #50914 (Issue #50636: Improve error diagnostic with missing commas after struct fields.)
 - #50931 (Inline `try_get`.)
 - #50932 (Optimize seen Predicate filtering.)
 - #50945 (Stabilize feature from_ref)
 - #50946 (rustc: Fix procedural macros generating lifetime tokens)
 - #50947 (rustdoc: set tab width in rust source blocks)
 - #50952 (Add the 2018 edition of the book to doc.rust-lang.org)
 - #50958 (Micro-optimization on PR#50697)
 - #50961 (Fix FileCheck finding with MSVC)
 - #50963 (Right-size the `VecDeque` in `coerce_unsized`.)

Failed merges:
2018-05-22 16:38:12 +00:00
Niko Matsakis
dfd2a138eb add new test and add an existing scenario I didn't see covered 2018-05-22 12:31:12 -04:00
kennytm
0c4d337c3c
Rollup merge of #50963 - nnethercote:coercion-VecDeque1, r=petrochenkov
Right-size the `VecDeque` in `coerce_unsized`.

The default capacity of a VecDeque is 8, which is excessive here. In a
"base incremental" check build of rustc-perf's tuple-stress benchmark,
this decreases total heap allocation by 26%. I couldn't see a clear
speedup, but it can't hurt.
2018-05-23 00:26:23 +08:00
kennytm
28e43582a3
Rollup merge of #50961 - Zoxc:fix-filecheck, r=alexcrichton
Fix FileCheck finding with MSVC
2018-05-23 00:26:22 +08:00
kennytm
e6495d12b6
Rollup merge of #50958 - KiChjang:nit-50697, r=pnkfelix
Micro-optimization on PR#50697

We should stop iterating through the indices in the `init_path_map` once we've already found a match for the local.

r? @nikomatsakis or @pnkfelix
2018-05-23 00:26:21 +08:00
kennytm
25a907dfb1
Rollup merge of #50952 - steveklabnik:2018-book, r=alexcrichton
Add the 2018 edition of the book to doc.rust-lang.org

The second edition of the book is on its way to the printers, and as such, is frozen. We've forked off the 2018 edition to add new stuff to; this PR now builds it so that people can read it on doc.rust-lang.org.
2018-05-23 00:26:20 +08:00
kennytm
c717a70a36
Rollup merge of #50947 - QuietMisdreavus:nice-tabs, r=GuillaumeGomez
rustdoc: set tab width in rust source blocks

cc https://github.com/rust-lang/rust/issues/49155 (fixes it?)

This sets the tab width ([in supported browsers](https://developer.mozilla.org/en-US/docs/Web/CSS/tab-size)) in Rust source blocks to 4 spaces wide (instead of the default 8), to correspond with the style guidelines.
2018-05-23 00:26:19 +08:00
kennytm
aa63dce256
Rollup merge of #50946 - alexcrichton:fix-parse-lifetime, r=petrochenkov
rustc: Fix procedural macros generating lifetime tokens

This commit fixes an accidental regression from #50473 where lifetime tokens
produced by procedural macros ended up getting lost in translation in the
compiler and not actually producing parseable code. The issue lies in the fact
that a lifetime's `Ident` is prefixed with `'`. The `glue` implementation for
gluing joint tokens together forgot to take this into account so the lifetime
inside of `Ident` was missing the leading tick!

The `glue` implementation here is updated to create a new `Symbol` in these
situations to manufacture a new `Ident` with a leading tick to ensure it parses
correctly.

Closes #50942
2018-05-23 00:26:18 +08:00
kennytm
98e801ac0b
Rollup merge of #50945 - stjepang:stabilize-from-ref, r=SimonSapin
Stabilize feature from_ref

Function `from_ref_mut` is now renamed to `from_mut`, as discussed in #45703.

Closes #45703.

r? @SimonSapin
2018-05-23 00:26:17 +08:00
kennytm
5b67b13d1e
Rollup merge of #50932 - nnethercote:seen-Predicates, r=eddyb
Optimize seen Predicate filtering.

This speeds up a few rustc-perf benchmark runs, most notably ones
involving 'coercions', the best by 2%.
2018-05-23 00:26:15 +08:00
kennytm
bc76e8b029
Rollup merge of #50931 - nnethercote:inline-try_get, r=michaelwoerister
Inline `try_get`.

This speeds up lots of rustc-perf benchmark runs. The maximum
improvement is 1%, but there are a lot in the 0.5--1.0% range.
2018-05-23 00:26:14 +08:00
kennytm
696b84c883
Rollup merge of #50914 - simartin:issue_50636, r=oli-obk
Issue #50636: Improve error diagnostic with missing commas after struct fields.

Fixes #50636
2018-05-23 00:26:13 +08:00
kennytm
e51b35e26f
Rollup merge of #50913 - d-e-s-o:fix-typo, r=joshtriplett
Fix typo in cell.rs
2018-05-23 00:26:12 +08:00
kennytm
42b4c49b45
Rollup merge of #50875 - QuietMisdreavus:short-features, r=GuillaumeGomez
rustdoc: use "short form" doc(cfg) printing even when combined with other conditionals

Fixes https://github.com/rust-lang/rust/issues/49334

The original "short form" printing was introduced when `target_feature` was added to the `doc(cfg)` handling. However, it didn't properly propagate the "short form" indicator if the cfg was a combination of multiple conditionals, so the linked issue happened. This changes the handling to use a bool in the original `Html` wrapper, rather than a separate wrapper struct that defers to the original one.
2018-05-23 00:26:11 +08:00
kennytm
e7e3261121
Rollup merge of #50863 - oli-obk:const_len, r=SimonSapin,Gankro
Make `[T]::len` and `str::len` const fn

r? @Gankro
2018-05-23 00:26:10 +08:00
kennytm
eb92280287
Rollup merge of #50849 - est31:visit_closure_args, r=michaelwoerister
CheckLoopVisitor: also visit closure arguments

This turns the ICE #50581 in this code:

```rust
fn main() {
    |_: [u8; break]| ();
}
```

from
```
    'assertion failed: self.tcx.sess.err_count() > 0', librustc_typeck/check/mod.rs
```
to
```
    librustc_mir/hair/cx/expr.rs:543: invalid loop id for break: not inside loop scope
```

which is an ICE as well but at a later stage during compilation and most importantly
fixes of bug #50576 will fix this as well.

As this "only" moves an ICE to a later stage, I didn't add any tests.

Now I have manually verified the default impls of the visitor trait to check whether we have missed any other opportunity to visit more stuff and coudln't find anything (except the missing `break` visit I've fixed in #50829 but that one was already r+'d so I didn't want to push more commits).
2018-05-23 00:26:08 +08:00
kennytm
20298a93ab
Rollup merge of #50846 - GuillaumeGomez:add-e0665, r=frewsxcv
Add E0665
2018-05-23 00:26:06 +08:00
Niko Matsakis
9f117144f6 pacify the mercilous tidy 2018-05-22 11:45:36 -04:00
Niko Matsakis
60c4eb4566 create a rust-2018 directory for tests related to edition transition 2018-05-22 11:45:29 -04:00
steveklabnik
292be70f9d build the 2018 edition 2018-05-22 11:30:15 -04:00
Niko Matsakis
068c4364c7 pass down information about the root tree and use that to guide lint 2018-05-22 11:10:17 -04:00
Michael Woerister
95fac99a20 Add some doc comments to SortedMap. 2018-05-22 16:54:08 +02:00
Michael Woerister
4bedc31459 Cleanup SortedMap by wrapping element lookup in a method. 2018-05-22 16:54:08 +02:00
Michael Woerister
e850d78bcc Remove SortedMap::iter_mut() since that allows to break the element sorting order which lookup relies on. 2018-05-22 16:54:08 +02:00
Michael Woerister
eaa796c8b8 Remove benchmarks from SortedMap. 2018-05-22 16:54:07 +02:00
Michael Woerister
3ed23a4bd0 Use SortedMap instead of BTreeMap for relocations in MIRI. 2018-05-22 16:54:07 +02:00