Commit Graph

79484 Commits

Author SHA1 Message Date
Gergely Nagy
f1c9247663 NLL performance boost 2018-06-06 17:31:24 +02:00
dylan_DPC
8ecbd351bb fix stderrs 2018-06-06 20:51:57 +05:30
bors
35aeecb8aa Auto merge of #51201 - estebank:dotdot, r=petrochenkov
Accept `..` in incorrect position to avoid further errors

We currently give a specific message when encountering a `..` anywhere
other than the end of a pattern. Modify the parser to accept it (while
still emitting the error) so that we don't also trigger "missing fields
in pattern" errors afterwards.

Add suggestions to either remove trailing `,` or moving the `..` to the
end.

Follow up to #49268.
2018-06-06 14:04:06 +00:00
John Kåre Alsaker
f273f285b8 Update Cargo 2018-06-06 15:25:47 +02:00
John Kåre Alsaker
131ef97c4b Reduce the amount of unsafe code and mark handle_deadlock as unsafe 2018-06-06 15:25:19 +02:00
John Kåre Alsaker
3e83248441 Add comments 2018-06-06 15:25:19 +02:00
John Kåre Alsaker
b2555bd545 Make QueryWaiter use safe code 2018-06-06 15:25:18 +02:00
John Kåre Alsaker
3571684d2c Create thread-pool 2018-06-06 15:25:18 +02:00
John Kåre Alsaker
c819ba043a Add comments and misc changes 2018-06-06 15:25:18 +02:00
John Kåre Alsaker
302aae5864 Use raw pointers 2018-06-06 15:25:18 +02:00
John Kåre Alsaker
090b8341bc Add and use OnDrop::disable 2018-06-06 15:25:17 +02:00
John Kåre Alsaker
77259af56a Use try_lock in collect_active_jobs 2018-06-06 15:25:17 +02:00
John Kåre Alsaker
d85b5eadea Update Rayon version 2018-06-06 15:25:16 +02:00
John Kåre Alsaker
f9e6fbc4f7 Make queries block and handle query cycles 2018-06-06 15:25:16 +02:00
Simon Sapin
5c7ca77b17 Make the size of Option<NonZero*> a documented guarantee.
Closes #49137, the tracking issue for `NonZero*`,
as this was the last remaining open question.

Note that `ptr::NonNull<T>` already documents a similar guarantee.
2018-06-06 13:58:09 +02:00
bors
9ac372568b Auto merge of #51316 - oli-obk:const_err, r=nikomatsakis
Refactor the const eval diagnostic API

* no longer report "const eval error" for things that have typeck errors
* errors and lints have saner spans and messages
* unified the diagnostic logic (const eval errors were slightly different depending on where they were reported, and there was also code duplication between the different reporters)
* report errors if an erroneous constant is used inside a promoted (fixes most of #50814)
2018-06-06 11:17:15 +00:00
Nicholas Nethercote
5c36e01f35 Use scope tree depths to speed up nearest_common_ancestor.
This patch adds depth markings to all entries in the `ScopeTree`'s
`parent_map`. This change increases memory usage somewhat, but permits a
much faster algorithm to be used:

- If one scope has a greater depth than the other, the deeper scope is
  moved upward until they are at equal depths.

- Then we move the two scopes upward in lockstep until they match.

This avoids the need to keep track of which scopes have already been
seen, which was the major part of the cost of the old algorithm. It also
reduces the number of child-to-parent moves (which are hash table
lookups) when the scopes start at different levels, because it never
goes past the nearest common ancestor the way the old algorithm did.

Finally, the case where one of the scopes is the root is now handled in
advance, because that is moderately common and lets us skip everything.

This change speeds up runs of several rust-perf benchmarks, the best by
6%.
2018-06-06 20:08:34 +10:00
bors
685faa2c3e Auto merge of #50844 - bjorn3:adhoc_compiller_calls, r=nrc
Add AdHocCalls and pass self to build_controller as Box<Self>

This makes it easier to write custom drivers.
2018-06-06 08:14:11 +00:00
dylan_DPC
1048ae29a1 append unused variables with _ 2018-06-06 12:22:38 +05:30
Oliver Middleton
e73941a06b rustdoc: Fix missing stability and src links for inlined external macros 2018-06-06 04:13:55 +01:00
Mark Simulacrum
b1a8088fdb Remove fmt_macros dependency 2018-06-05 15:55:07 -06:00
Oliver Schneider
14d08e5371 Rebase fallout 2018-06-05 21:08:43 +02:00
Oliver Schneider
8a74be6684 Add source information the const propagation of places 2018-06-05 20:49:47 +02:00
Oliver Schneider
5950496c92 Remove another unused error variant 2018-06-05 20:49:47 +02:00
Oliver Schneider
848080dc42 Remove unused IndexOutOfBounds variant 2018-06-05 20:49:47 +02:00
Oliver Schneider
13a55e8801 Satisfy the untiring tidy 2018-06-05 20:49:47 +02:00
Oliver Schneider
78d48867da Properly report transitive errors 2018-06-05 20:49:47 +02:00
Oliver Schneider
9cb47de813 Referring to erroneous constants in promoteds must abort the build 2018-06-05 20:49:46 +02:00
Oliver Schneider
5c0d1355f2 Refactor the const eval diagnostic API 2018-06-05 20:49:46 +02:00
dylan_DPC
e8fd74a11d remove redundant match branch 2018-06-05 23:44:42 +05:30
dylan_DPC
4cbf400366 flag changed to none 2018-06-05 23:28:32 +05:30
bjorn3
cc5c1a0abb Add comment 2018-06-05 18:05:12 +02:00
bjorn3
4e0ee758b7 Impl CompilerCalls for CompileController instead of AdHocCompilerCalls 2018-06-05 18:04:18 +02:00
bjorn3
4f45b0611c Add AdHocCalls and pass self to build_controller as Box<Self> 2018-06-05 18:03:47 +02:00
Esteban Küber
d66d35bb91 Account for comma in suggestion 2018-06-05 08:48:55 -07:00
Esteban Küber
cbc70a0d68 Improve diagnostics for incorrect .. usage
When using `..` somewhere other than the end, parse the rest of the
pattern correctly while still emitting an error.

Add suggestions to either remove trailing `,` or moving the `..` to the
end.
2018-06-05 08:48:55 -07:00
Esteban Küber
8f4a5429c2 Accept .. in incorrect position to avoid further errors
We currently give a specific message when encountering a `..` anywhere
other than the end of a pattern. Modify the parser to accept it (while
still emitting the error) so that we don't also trigger "missing fields
in pattern" errors afterwards.
2018-06-05 08:48:54 -07:00
bors
4a9c58c6bd Auto merge of #51369 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 7 pull requests

Successful merges:

 - #50852 (Add doc comment to hiding portions of code example)
 - #51183 (Update rustdoc book to suggest using Termination trait instead of hidden ‘foo’ function)
 - #51255 (Fix confusing error message for sub_instant)
 - #51256 (Fix crate-name option in rustdoc)
 - #51308 (Check array indices in constant propagation)
 - #51343 (test: Ignore some problematic tests on sparc and sparc64)
 - #51358 (Tests that #39963 is fixed on MIR borrowck)

Failed merges:
2018-06-05 15:26:26 +00:00
Mark Simulacrum
d011150696
Rollup merge of #51358 - barzamin:tests-39963, r=oli-obk
Tests that #39963 is fixed on MIR borrowck

As title.

fixes #39963
2018-06-05 08:33:51 -06:00
Mark Simulacrum
f3aeff080b
Rollup merge of #51343 - glaubitz:sparc64-tests, r=shepmaster
test: Ignore some problematic tests on sparc and sparc64

This updates the list of tests which can be safely ignored on sparc and sparc64.
2018-06-05 08:33:49 -06:00
Mark Simulacrum
54cb13d975
Rollup merge of #51308 - fanzier:const-prop-array-bounds-check, r=oli-obk
Check array indices in constant propagation

Previously, uses of constant weren't correctly propagated.
This fixes #48920.

r? @oli-obk because you suggested it
2018-06-05 08:33:48 -06:00
Mark Simulacrum
ac32f8151b
Rollup merge of #51256 - GuillaumeGomez:fix-rustdoc-crate-name, r=QuietMisdreavus
Fix crate-name option in rustdoc

Fixes #51229.

r? @QuietMisdreavus
2018-06-05 08:33:47 -06:00
Mark Simulacrum
753e8f328f
Rollup merge of #51255 - avdv:patch-1, r=kennytm
Fix confusing error message for sub_instant

When subtracting an Instant from another, the function will panick when `RHS > self`, but the error message confusingly displays a different error:

```rust
let i = Instant::now();
let other = Instant::now();
if other > i {
    println!("{:?}", i - other);
}
```
This results in a panic:
```
thread 'test_instant' panicked at 'other was less than the current instant', libstd/sys/unix/time.rs:292:17
```
But clearly, `other` was actually greater than the current instant.
2018-06-05 08:33:46 -06:00
Mark Simulacrum
1225faf1a4
Rollup merge of #51183 - teiesti:rustdoc-book-termination, r=steveklabnik
Update rustdoc book to suggest using Termination trait instead of hidden ‘foo’ function

Closes #50721.

I suggest that someone double-checks my English since I am not a native speaker.

r? @steveklabnik
2018-06-05 08:33:45 -06:00
Mark Simulacrum
bcba3b9968
Rollup merge of #50852 - mandeep:fix-rustdoc-example-testing, r=GuillaumeGomez
Add doc comment to hiding portions of code example

fixes #50816

Not sure if this is all that's needed, but I think it's a good start. One thing to note is that the code block is a text block where it could possibly be a rust block.
2018-06-05 08:33:43 -06:00
varkor
f37557764d Fix the use of closures within #[panic_implementation] 2018-06-05 14:36:36 +01:00
Oliver Schneider
9fd026a96c Use quiet tests by default 2018-06-05 15:00:44 +02:00
bors
90f34b5f83 Auto merge of #51246 - vakaras:select_polonius_algo_via_env_var, r=nikomatsakis
Select Polonius algorithm via `POLONIUS_ALGORITHM` environment variable

This pull request allows selecting the Polonius algorithm being used by providing an environment variable `POLONIUS_ALGORITHM`.

Example usage:
```
POLONIUS_ALGORITHM=compare RUST_LOG=rustc_mir::borrow_check::nll=trace  ./x.py test --stage 1 --compare-mode polonius -- src/test/ui/nll/issue-47680.rs
...
stderr:
------------------------------------------
 INFO 2018-05-31T17:35:31Z: rustc_mir::borrow_check::nll: Using Polonius algorithm: Compare
 INFO 2018-05-31T17:35:31Z: rustc_mir::borrow_check::nll: Using Polonius algorithm: Compare

------------------------------------------
...
```

r? @nikomatsakis
2018-06-05 12:49:40 +00:00
Tobias Stolzmann
089da06cc4
Improve wording 2018-06-05 12:03:54 +02:00
Tobias Stolzmann
63885f7f72
Update rustdoc book to suggest using Termination trait instead of hidden ‘foo’ function 2018-06-05 12:03:50 +02:00