Commit Graph

99185 Commits

Author SHA1 Message Date
Esteban Küber
09f05d2c41 review comments 2019-09-19 12:10:23 -07:00
Esteban Küber
c1ed4399eb review comments 2019-09-19 12:10:23 -07:00
Esteban Küber
2fbd6927a5 When possible, suggest fn call 2019-09-19 12:10:23 -07:00
Esteban Küber
5976e0eecf Review comment: move to its own method 2019-09-19 12:10:23 -07:00
Esteban Küber
fa496c9ded Ignore obligations coming from desugared call spans 2019-09-19 12:10:23 -07:00
Esteban Küber
02e3fb89a7 When possible point at argument causing item obligation failure 2019-09-19 12:10:23 -07:00
bors
9b9d2aff8d Auto merge of #64545 - nnethercote:ObligForest-more, r=nmatsakis
More `ObligationForest` improvements

Following on from #64500, these commits alsomake the code both nicer and faster.

r? @nikomatsakis
2019-09-19 06:53:54 +00:00
bors
19d070393c Auto merge of #64598 - Centril:rollup-htmf39p, r=Centril
Rollup of 5 pull requests

Successful merges:

 - #63630 (Update installed compiler dependencies)
 - #64536 (Update Cargo)
 - #64554 (Polonius: more `ui` test suite fixes)
 - #64566 (A more generic interface for dataflow analysis)
 - #64591 (Fix a minor grammar nit, update UI tests)

Failed merges:

r? @ghost
2019-09-19 02:54:11 +00:00
Mazdak Farrokhzad
cad2d5840b
Rollup merge of #64591 - jamesmunns:grammar-fix, r=jonas-schievink
Fix a minor grammar nit, update UI tests

Minor fix, but I noticed it while debugging some code
2019-09-19 04:53:12 +02:00
Mazdak Farrokhzad
67565ae4ae
Rollup merge of #64566 - ecstatic-morse:generic-dataflow, r=oli-obk
A more generic interface for dataflow analysis

#64470 requires a transfer function that is slightly more complex than the typical `gen`/`kill` one. Namely, it must copy state bits between locals when assignments occur (see #62547 for an attempt to make this fit into the existing framework). This PR contains a dataflow interface that allows for arbitrary transfer functions. The trade-off is efficiency: we can no longer coalesce transfer functions for blocks and must visit each statement individually while iterating to fixpoint.

Another issue is that poorly behaved transfer functions can result in an analysis that fails to converge. `gen`/`kill` sets do not have this problem. I believe that, in order to guarantee convergence, flipping a bit from `false` to `true` in the entry set cannot cause an output bit to go from `true` to `false` (negate all preceding booleans when `true` is the bottom value). Perhaps someone with a more formal background can confirm and we can add a section to the docs?

This approach is not maximally generic: it still requires that the lattice used for analysis is the powerset of values of `Analysis::Idx` for the `mir::Body` of interest. This can be done at a later date. Also, this is the bare minimum to get #64470 working. I've not adapted the existing debug framework to work with the new analysis, so there are no `rustc_peek` tests either. I'm planning to do this after #64470 is merged.

Finally, my ultimate plan is to make the existing, `gen`/`kill`-based `BitDenotation` a special case of `generic::Analysis`. Currently they share a ton of code. I should be able to do this without changing any implementers of `BitDenotation`. Something like:

```rust
struct GenKillAnalysis<A: BitDenotation> {
    trans_for_block: IndexVec<BasicBlock, GenKillSet<A::Idx>>,
    analysis: A,
}

impl<A> generic::Analysis for GenKillAnalysis<A> {
    // specializations of `apply_{partial,whole}_block_effect`...
}
```

r? @pnkfelix
2019-09-19 04:53:11 +02:00
Mazdak Farrokhzad
0835100412
Rollup merge of #64554 - lqd:polonius_tests4, r=nikomatsakis
Polonius: more `ui` test suite fixes

Since #62736, new tests have been added, and the `run-pass` suite was merged into the `ui` suite.

This PR adds the missing tests expectations for Polonius, and updates the existing ones where the NLL output has changed in some manner (e.g. ordering of notes)

Those are the trivial cases, but a more-detailed explanation is available [in this write-up](https://hackmd.io/CjYB0fs4Q9CweyeTdKWyEg?both#26-async-awaitasync-borrowck-escaping-closure-errorrs-outputs-from-NLL-Polonius-diff) starting at test case 26: they are only differing in diagnostics and instances of other existing test cases differences.

Only 3 of the 9020 tests are still "failing" at the moment (1 failure, 2 OOMs).

r? @nikomatsakis
2019-09-19 04:53:09 +02:00
Mazdak Farrokhzad
11a0b968c2
Rollup merge of #64536 - Aaron1011:cargo-crate-type, r=ehuss
Update Cargo

This pulls in https://github.com/rust-lang/cargo/pull/7159, which
ensures that documenting proc macros works correctly.
2019-09-19 04:53:08 +02:00
Mazdak Farrokhzad
d2b555eef3
Rollup merge of #63630 - andjo403:bump_compiler, r=nikomatsakis
Update installed compiler dependencies

As llvm have updated the minimum toolchain
https://reviews.llvm.org/D66188
2019-09-19 04:53:07 +02:00
Aaron Hill
d440e136e7
Update Cargo
This pulls in https://github.com/rust-lang/cargo/pull/7159, which
ensures that documenting proc macros works correctly.
2019-09-18 21:53:50 -04:00
James Munns
333230fd14 Restore whitespace 2019-09-19 00:50:03 +02:00
James Munns
f233a4c18b Fix a minor grammar nit, update UI tests 2019-09-19 00:16:16 +02:00
Nicholas Nethercote
3b85597d22 Add a specialized version of shallow_resolve().
The super-hot call site of `inlined_shallow_resolve()` basically does
`r.inlined_shallow_resolve(ty) != ty`. This commit introduces a
version of that function specialized for that particular call pattern,
`shallow_resolve_changed()`. Incredibly, this reduces the instruction
count for `keccak` by 5%.

The commit also renames `inlined_shallow_resolve()` as
`shallow_resolve()` and removes the `inline(always)` annotation, as it's
no longer nearly so hot.
2019-09-19 06:36:06 +10:00
Nicholas Nethercote
82e5c6ee65 Use explicit iteration instead of all() in process_obligation().
Amazingly enough, this is a 3.5% instruction count win on `keccak`.
2019-09-19 06:35:11 +10:00
bors
eceec57f72 Auto merge of #64583 - tmandry:rollup-b793x81, r=tmandry
Rollup of 5 pull requests

Successful merges:

 - #64207 (Make rustc_mir::dataflow module pub (for clippy))
 - #64348 (PR: documentation spin loop hint)
 - #64532 (Replace `state_for_location` with `DataflowResultsCursor`)
 - #64578 (Fix issue22656 with LLDB 8)
 - #64580 (Update books)

Failed merges:

r? @ghost
2019-09-18 17:58:45 +00:00
Tyler Mandry
eeda31385d
Rollup merge of #64580 - ehuss:update-books, r=ehuss
Update books

## book

24 commits in 7ddc46460f09a5cd9bd2a620565bdc20b3315ea9..871416b85c1a73717d65d6f4a9ea29e5aef3db0e
2019-06-27 09:50:36 -0400 to 2019-09-16 09:46:20 -0400
- Ch16-2 add missing Ferris (rust-lang/book#2033)
- Update version mentioned on the front page
- Update error messages (rust-lang/book#1737)
- Update version of Rust used to 1.37
- Replace Cargo docs link with a more specific link (rust-lang/book#2066)
- Added missing await reserved keyword (rust-lang/book#2064)
- add does_not_compile for a snippet (rust-lang/book#2056)
- Added second missing dyn (rust-lang/book#2046)
- Removed unnecessary & in function call (rust-lang/book#2038)
- Printing non-Display structs is a *compile* error (rust-lang/book#2031)
- Update Readme mdBook version to match linked file (rust-lang/book#2012)
- Update loose mdbook version reference (rust-lang/book#2003)
- Added a bullet point to have list of things unsafe allows for match u… (rust-lang/book#1993)
- Rewrote a confusing sentence (rust-lang/book#1986)
- Replace deprecated `...` range syntax with `..=` (rust-lang/book#1977)
- correct wording for integration test doc (rust-lang/book#1971)
- Mark the dangle function as does_not_compile (rust-lang/book#1965)
- Add more words to the quote from the actual Go documentation (rust-lang/book#1960)
- Remove unused import in lfp (rust-lang/book#1944)
- A small typo? (rust-lang/book#1931)
- Make the code not compile to match the text (rust-lang/book#1926)
- Ferris does-not-compile added (ch9.2) (rust-lang/book#1925)
- ch07 - remove note regarding use and relative path (rust-lang/book#1820)
- tweak opening paragraph of deref coercions (rust-lang/book#1749)

## rust-by-example

9 commits in e76be6b2dc84c6a992e186157efe29d625e29b94..67cfbf31df880728dcf7cb35b15b028ec92caf31
2019-09-03 07:42:26 -0300 to 2019-09-18 09:36:40 -0300
- Fix rust-lang/rust-by-example#90: Add supertraits and Fully Qualified syntax (rust-lang/rust-by-example#1259)
- Fix some broken links. (rust-lang/rust-by-example#1258)
- Fix rust-lang/rust-by-example#1253: Document enum type aliases (rust-lang/rust-by-example#1255)
- Inline code in some new/changed chapters (rust-lang/rust-by-example#1254)
- fix rust-lang/rust-by-example#1067: explain that unit tests can return Result&lt;()&gt; (rust-lang/rust-by-example#1252)
- Fix rust-lang/rust-by-example#1060: add page on Impl Trait (rust-lang/rust-by-example#1251)
- Fix rust-lang/rust-by-example#1053: Added a page about the dyn keyword (rust-lang/rust-by-example#1249)
- Fix rust-lang/rust-by-example#1110: add examples of ? and Option (rust-lang/rust-by-example#1250)
- fix 1037: add the TryFrom chapter back in (rust-lang/rust-by-example#1247)
2019-09-18 10:58:09 -07:00
Tyler Mandry
0fd7a2db3d
Rollup merge of #64578 - max-sixty:22656-lldb-8, r=alexcrichton
Fix issue22656 with LLDB 8

Closes https://github.com/rust-lang/rust/issues/64074
2019-09-18 10:58:07 -07:00
Tyler Mandry
68096ccb3f
Rollup merge of #64532 - ecstatic-morse:dataflow-cursor-get, r=tmandry
Replace `state_for_location` with `DataflowResultsCursor`

These are two different ways of getting the same data from the result of a dataflow analysis. However, `state_for_location` goes quadratic if you try to call it for every statement in the body.
2019-09-18 10:58:06 -07:00
Tyler Mandry
05d93a7d06
Rollup merge of #64348 - arnohaase:pr_documentation_spin_loop_hint, r=alexcrichton
PR: documentation spin loop hint

The documentation for 'spin loop hint' explains that yield is better if the lock holder is running on the same CPU. I suggest that 'CPU or core' would be clearer.
2019-09-18 10:58:05 -07:00
Tyler Mandry
e8ded849ef
Rollup merge of #64207 - sinkuu:pub_dataflow, r=tmandry
Make rustc_mir::dataflow module pub (for clippy)

I'm working on fixing false-positives of a MIR-based clippy lint (https://github.com/rust-lang/rust-clippy/pull/4509), and in need of the dataflow infrastructure.
2019-09-18 10:58:03 -07:00
Dylan MacKenzie
b4e94d9a3a Fix bug where is_call_return_effect_applied was never set 2019-09-18 09:22:02 -07:00
Eric Huss
003fcda6a9 Update books 2019-09-18 08:54:06 -07:00
Dylan MacKenzie
a7f52520d5 Add summary of the current state and future plans 2019-09-18 08:41:38 -07:00
Maximilian Roos
445af68c23
fix debuginfo/issue22656 with LLDB 8 2019-09-18 10:42:55 -04:00
Dylan MacKenzie
08aff1afe5 Publish rustc_mir::dataflow and remove #[allow(unused)] 2019-09-18 07:35:44 -07:00
Dylan MacKenzie
19bf0f4c90 Fix typo 2019-09-18 07:32:57 -07:00
Dylan MacKenzie
a526e4faa6 Use an associated const for name 2019-09-18 07:32:42 -07:00
Dylan MacKenzie
cbaaf05b94 Fix Analysis example 2019-09-18 07:32:15 -07:00
bors
dece57302a Auto merge of #64575 - lzutao:fmt-primitives-doc, r=jonas-schievink
doc: Format some primitives examples

r? @jonas-schievink
2019-09-18 12:31:00 +00:00
Arno Haase
eb48b5d983 broken hyperlinks in documentation 2019-09-18 12:31:34 +02:00
Lzu Tao
bec0a76727 doc: Format some primitives examples 2019-09-18 08:24:24 +00:00
bors
64c09694a6 Auto merge of #64570 - tmandry:rollup-3pg02lj, r=tmandry
Rollup of 4 pull requests

Successful merges:

 - #64486 (Print out more information for `-Zunpretty=expanded,hygiene`)
 - #64503 (rename Allocation::retag -> with_tags_and_extra)
 - #64516 (update Nomicon and Reference)
 - #64528 (Load proc macro metadata in the correct order.)

Failed merges:

r? @ghost
2019-09-18 04:29:01 +00:00
Tyler Mandry
76d34f3435
Rollup merge of #64528 - Aaron1011:fix/proc-macro-type, r=alexcrichton
Load proc macro metadata in the correct order.

Serialized proc macro metadata is assumed to have a one-to-one
correspondence with the entries in static array generated by proc_macro_harness.
However, we were previously serializing proc macro metadata in a
different order than proc macros were laied out in the static array.
This lead to us associating the wrong data with a proc macro when
generating documentation, causing Rustdoc to generate incorrect docs for
proc macros.

This commit keeps track of the order in which we insert proc macros into
the generated static array. We use this same order when serializing proc
macro metadata, ensuring that we can later associate the metadata for a
proc macro with its entry in the static array.

Fixes #64251
2019-09-17 21:27:26 -07:00
Tyler Mandry
b2501a1269
Rollup merge of #64516 - RalfJung:nomicon, r=Centril
update Nomicon and Reference

Cc @Centril
2019-09-17 21:27:25 -07:00
Tyler Mandry
dbce655eda
Rollup merge of #64503 - RalfJung:miri-retag, r=oli-obk
rename Allocation::retag -> with_tags_and_extra

This is more consistent with `Pointer::with_tag`. Also, "retag" is a [term from Stacked Borrows](https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md#retagging) with a [corresponding Machine hook](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_mir/interpret/machine/trait.Machine.html#method.retag), and this function has nothing to do with that other use of the term.

r? @oli-obk
2019-09-17 21:27:23 -07:00
Tyler Mandry
a8aa5114bf
Rollup merge of #64486 - matthewjasper:hygiene-debugging, r=petrochenkov
Print out more information for `-Zunpretty=expanded,hygiene`

I've found this helpful when trying to understand how hygiene works.

Closes #16420
2019-09-17 21:27:22 -07:00
Dylan MacKenzie
d583fefa59 Add ignore reason to placate tidy 2019-09-17 17:53:36 -07:00
Dylan MacKenzie
288603709e Temporarily add #[allow(unused)] for CI
This can be removed once dataflow-based const validation is merged.
2019-09-17 17:52:50 -07:00
Dylan MacKenzie
5496a1fbbe Document new dataflow analysis 2019-09-17 17:52:47 -07:00
Dylan MacKenzie
ceb72e4ad1 Add generic dataflow impl 2019-09-17 16:52:13 -07:00
Aaron Hill
3daa8bd2e4
Generate proc macro harness in AST order.
This ensures that we match the order used by proc macro metadata
serialization.

Fixes #64251
2019-09-17 19:10:10 -04:00
bors
528379121c Auto merge of #64562 - tmandry:rollup-kfk0nuo, r=tmandry
Rollup of 10 pull requests

Successful merges:

 - #61626 (Get rid of special const intrinsic query in favour of `const_eval`)
 - #64283 (Updated RELEASES.md for 1.38.0)
 - #64394 (Shrink `SubregionOrigin`.)
 - #64429 (Fix failure note `to_str` implementation)
 - #64436 (improve Vec example soundness in mem::transmute docs)
 - #64502 (avoid duplicate issues for Miri build failures)
 - #64505 (Fix inconsistent link formatting)
 - #64529 (Add an example to Pin::as_mut)
 - #64541 (document Miri error categories)
 - #64544 (build-manifest: re-add some comments)

Failed merges:

r? @ghost
2019-09-17 22:21:10 +00:00
Tyler Mandry
93d610821d
Rollup merge of #64544 - RalfJung:build-manifest, r=pietroalbini
build-manifest: re-add some comments

https://github.com/rust-lang/rust/pull/64543 also reverted the comments I added. This adds them back.
Includes https://github.com/rust-lang/rust/pull/64543.

r? @pietroalbini
2019-09-17 14:10:56 -07:00
Tyler Mandry
f8b6e26cfb
Rollup merge of #64541 - RalfJung:miri-errors, r=oli-obk
document Miri error categories

r? @oli-obk
2019-09-17 14:10:55 -07:00
Tyler Mandry
d782f09ae0
Rollup merge of #64529 - taiki-e:docs-pin-as-mut, r=RalfJung
Add an example to Pin::as_mut

https://github.com/taiki-e/pin-project/issues/89#issuecomment-531701172

r? @RalfJung
2019-09-17 14:10:54 -07:00
Tyler Mandry
b544284315
Rollup merge of #64505 - pickfire:patch-1, r=Mark-Simulacrum
Fix inconsistent link formatting
2019-09-17 14:10:52 -07:00