Commit Graph

79029 Commits

Author SHA1 Message Date
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
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
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
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
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
bors
4122885e0f Auto merge of #51140 - GuillaumeGomez:doc-keyword, r=QuietMisdreavus
rustdoc: introduce the #[doc(keyword="")] attribute for documenting keywords

Part of #34601.

r? @QuietMisdreavus
2018-06-05 10:00:08 +00:00
Fabian Zaiser
96004899be Fix tests 2018-06-05 10:35:44 +02:00
Fabian Zaiser
29c43fea37 Fix tidy 2018-06-05 10:35:44 +02:00
Fabian Zaiser
589f9a87a8 Propagate uses of constants correctly so that array index checks work 2018-06-05 10:35:44 +02:00
bors
f33db06e1d Auto merge of #51324 - oli-obk:debug_overflow, r=estebank
Also prevent overflow in debug builds

r? @estebank
2018-06-05 07:14:52 +00:00
bors
f9157f5b86 Auto merge of #51242 - ytausky:mut-ref, r=estebank
Suggest not mutably borrowing a mutable reference

This PR would (hopefully) solve #45392. I deviated a bit from @estebank's instructions since the error span only included the borrowed expression (e.g. the `b` in `&mut b`). I also didn't check the mutability of the local binding, since this whole case is concerned with an immutable local.

I can see two outstanding questions:
1. `note_immutability_blame` is called in two places, but I only have one test case. I think it covers the call in `report_bckerror`, but I'm not sure how to trigger the call from `report_aliasability_violation`.
2. There is one failing test, where the local binding is `self: &mut Self`. I'm not entirely sure what the correct output should be, but I think the new message should also apply. Unfortunately, since this parameter is parsed differently, its `let_span` covers both the pattern and the type, leading to a wrong suggestion text. I'm not sure how to correctly identify this case.
2018-06-05 01:47:13 +00:00
Erin Moon
c2825e134d tests that #39963 is fixed on MIR borrowck 2018-06-04 18:15:48 -05:00
bors
c610be92e2 Auto merge of #51307 - oli-obk:miri_fixes, r=eddyb
ScalarPairs are offset==0 field + other non-zst field

r? @eddyb

fixes #51300
2018-06-04 23:10:15 +00:00
John Paul Adrian Glaubitz
690240994f test: Ignore some problematic tests on sparc and sparc64 2018-06-04 23:59:40 +02:00
Guillaume Gomez
3cbcc5a22d Fix crate-name option in rustdoc 2018-06-04 23:05:14 +02:00
Guillaume Gomez
2f7fa24aee Update rustdoc-js 2018-06-04 21:22:51 +02:00
bors
41affd03eb Auto merge of #51340 - Amanieu:hashmap_layout2, r=SimonSapin
Optimize layout calculations in HashMap

This now produces the same assembly code as the previous implementation.

cc #51163 @nnethercote @gnzlbg @andjo403
2018-06-04 18:36:50 +00:00
Amanieu d'Antras
b69724f37c Optimize layout calculations in HashMap
This now produces the same assembly code as the previous implementation.
2018-06-04 16:00:08 +01:00
Oliver Schneider
f7eedfab8e Simplify value field access 2018-06-04 14:50:29 +02:00
bors
cdc193db99 Auto merge of #51328 - oli-obk:no_union_promotion, r=eddyb
Do not promote union field accesses

r? @eddyb

technically a breaking change, but the code errored on the previous stable and produces UB + a warning on the current stable. I don't think we need a crater run in that case.
2018-06-04 11:29:38 +00:00
Guillaume Gomez
fb54a4afbc Add missing ui tests 2018-06-04 09:52:31 +02:00
Guillaume Gomez
402aa0ff15 Add even more tests 2018-06-04 09:52:31 +02:00
Guillaume Gomez
ded5c5a9ee Put doc keyword behind feature flag 2018-06-04 09:52:31 +02:00
Guillaume Gomez
f784d5ead2 Remove useless function call for keyword generation in rustdoc 2018-06-04 09:51:41 +02:00
Guillaume Gomez
904f4921f8 Few improvements 2018-06-04 09:51:41 +02:00
Guillaume Gomez
ebee483e24 Add doc keyword support 2018-06-04 09:51:41 +02:00
Guillaume Gomez
d024d6a51e slightly improve rustdoc xml path error 2018-06-04 09:51:41 +02:00
bors
6eafab06cf Auto merge of #51151 - sdroege:exact-chunks-docs-order, r=dtolnay
Move slice::exact_chunks directly above exact_chunks_mut for more con…

…sistent docs order

See https://github.com/rust-lang/rust/issues/47115#issuecomment-392532855
2018-06-04 07:16:36 +00:00
Claudio Bley
33c4b37d00 Clarify error phrase in sub_instant function
Uses the same wording as [`src/libstd/sys/windows/time.rs`][1].

1: 95e2bf253d/src/libstd/sys/windows/time.rs (L65)
2018-06-04 08:59:09 +02:00
Sebastian Dröge
eb3a73484b Move slice::exact_chunks directly above exact_chunks_mut for more consistent docs order
See https://github.com/rust-lang/rust/issues/47115#issuecomment-392532855
2018-06-04 09:03:21 +03:00