Commit Graph

100181 Commits

Author SHA1 Message Date
Esteban Küber
a180294f8b review comment 2019-10-02 14:34:29 -07:00
Matthew Jasper
2180c24321 Make lifetimes in constants live at the point of use 2019-10-02 20:39:01 +01:00
Matthew Jasper
08a60ac6ed Calculate liveness for the same locals with and without -Zpolonius
This fixes some test differences and also avoids overflow in
issue-38591.rs.
2019-10-02 20:39:01 +01:00
Aaron Hill
a336536a01
Set RUST_BACKTRACE=0 in tests that include a backtrace in stderr
This removes the implicit dependency on the environment variables set
when running `./x.py test`
2019-10-02 15:23:22 -04:00
Charles Gleason
864e6feaf8 Add test for LinkedList clone_from 2019-10-02 15:18:31 -04:00
Niko Matsakis
a96bce7c06 avoid using skip_binder and instead look for bound vars properly 2019-10-02 15:07:38 -04:00
Esteban Küber
a5cfc4011d Avoid ICE on ReFree region from malformed code 2019-10-02 11:39:46 -07:00
Niko Matsakis
3f277e1a66 s/async fn/async fn/ 2019-10-02 14:39:44 -04:00
Niko Matsakis
5fea1d279b document shallow_resolve 2019-10-02 14:35:01 -04:00
Niko Matsakis
5d64b3d329 document ret_coercion and ret_coercion_span 2019-10-02 14:32:19 -04:00
bors
2daa404e9a Auto merge of #65009 - Centril:rollup-06g05xj, r=Centril
Rollup of 13 pull requests

Successful merges:

 - #64581 (Fix unreachable_code warnings for try{} block ok-wrapped expressions)
 - #64850 (Remove inlines from DepNode code)
 - #64914 (regression test for 64453 borrow check error.)
 - #64922 (Use PlaceBuilder to avoid a lot of slice -> vec -> slice convertions)
 - #64948 (Improve sidebar styling to make its integration easier)
 - #64961 (Make comment about dummy type a bit more clear)
 - #64967 (Don't mark borrows of zero-sized arrays as indirectly mutable)
 - #64973 (Fix typo while setting `compile-flags` in test)
 - #64980 (Enable support for `IndirectlyMutableLocals` in `rustc_peek` )
 - #64989 (Fix ICE #64964)
 - #64991 ([const-prop] Correctly handle locals that can't be propagated)
 - #64995 (Remove rustdoc warning)
 - #64997 (rustc book: nitpick SLP vectorization)

Failed merges:

r? @ghost
2019-10-02 18:28:11 +00:00
Niko Matsakis
a999132113 improve comments on GeneratorKind and AsyncGeneratorKind 2019-10-02 14:26:32 -04:00
Niko Matsakis
3ae4abbaa3 correct coercion comments 2019-10-02 14:23:36 -04:00
Esteban Küber
e8796cada9 Do not ICE when dereferencing non-Copy raw pointer 2019-10-02 11:23:24 -07:00
Niko Matsakis
dce20bf62a WIP fix tests 2019-10-02 14:17:38 -04:00
AnthonyMikh
df203a297f
Compare primary with value instead of dropping it 2019-10-02 19:48:21 +03:00
Mazdak Farrokhzad
b961f962d0
Rollup merge of #64997 - rust-lang:nitpick-slp, r=jonas-schievink
rustc book: nitpick SLP vectorization

SLP vectorization (in general and as implemented in LLVM) is not limited to loops.
2019-10-02 18:24:46 +02:00
Mazdak Farrokhzad
ebbc9ce5d0
Rollup merge of #64995 - GuillaumeGomez:libtest-rustdoc-warning, r=Mark-Simulacrum
Remove rustdoc warning

Removes this warning:

```bash
    Finished release [optimized] target(s) in 2.62s
 Documenting core v0.0.0 (/home/imperio/rust/rust/src/libcore)
    Finished release [optimized] target(s) in 15.23s
 Documenting std v0.0.0 (/home/imperio/rust/rust/src/libstd)
    Finished release [optimized] target(s) in 17.30s
 Documenting proc_macro v0.0.0 (/home/imperio/rust/rust/src/libproc_macro)
    Finished release [optimized] target(s) in 2.36s
 Documenting test v0.0.0 (/home/imperio/rust/rust/src/libtest)
warning: `[0]` cannot be resolved, ignoring it...
    --> src/libtest/lib.rs:1112:41
     |
1112 |     /// supplied channel. Requires argv[0] to exist and point to the binary
     |                                         ^ cannot be resolved, ignoring
     |
     = note: `#[warn(intra_doc_link_resolution_failure)]` on by default
     = help: to escape `[` and `]` characters, just add '\' before them like `\[` or `\]`

    Finished release [optimized] target(s) in 1.64s
Build completed successfully in 0:02:07
```
2019-10-02 18:24:45 +02:00
Mazdak Farrokhzad
34ea55908e
Rollup merge of #64991 - wesleywiser:fix_too_eager_const_prop, r=oli-obk
[const-prop] Correctly handle locals that can't be propagated

`const_prop()` now handles writing the Rvalue into the Place in the
stack frame for us. So if we're not supposed to propagate that value,
we need to clear it.

r? @oli-obk

Fixes #64970
2019-10-02 18:24:43 +02:00
Mazdak Farrokhzad
028ffd1366
Rollup merge of #64989 - sinkuu:fix_ice_64964, r=davidtwco
Fix ICE #64964

Fixes #64964, which is an ICE with `await`ing in a method + incr-comp.
2019-10-02 18:24:42 +02:00
Mazdak Farrokhzad
7daf2e8946
Rollup merge of #64980 - ecstatic-morse:better-rustc-peek, r=oli-obk
Enable support for `IndirectlyMutableLocals` in `rustc_peek`

This PR allows `rustc_peek` tests to be written for the `IndirectlyMutableLocals` analysis implemented in #64470. See any of the tests in [`test/ui/mir-dataflow`](https://github.com/rust-lang/rust/blob/master/src/test/ui/mir-dataflow/inits-1.rs) for an example.

Included in this PR is a major rewrite of the `rustc_peek` module. This was motivated by the differences between the `IndirectlyMutableLocals` analysis and the initialized places ones.

To properly test `IndirectlyMutableLocals`, we must pass locals by-value to `rustc_peek`, since any local that is not `Freeze` will be marked as indirectly mutable as soon as a reference to it is taken. Unfortunately, `UnsafeCell` is not `Copy`, so we can only do one `rustc_peek` on each value with interior mutability inside a test. I'm not sure how to deal with this restriction; perhaps I need to special case borrows preceding a call to `rustc_peek` in the analysis itself?

`rustc_peek` also assumed that the analysis was done on move paths and that its transfer function only needed to be applied at assignment statements. This PR removes both of those restrictions by adding a trait, `RustcPeekAt`, that controls how the peeked at `Place` maps to the current dataflow state and using a dataflow cursor to retrieve the state itself.

Finally, this PR adds a test which demonstrates some unsoundness in the `IndirectlyMutableLocals` analysis by converting a reference to a `Freeze` field to a reference to a `!Freeze` field by offsetting a pointer (or in this case transmuting a pointer to a ZST field with the same address as a `!Freeze` field). This does not represent a hole in the language proper, since this analysis is only used to validate `const` bodies, in which the unsound code will only compile with `-Zunleash-the-miri-inside-of-you`. Nevertheless, this should get fixed.

r? @oli-obk
2019-10-02 18:24:41 +02:00
Mazdak Farrokhzad
10b0fe9c5c
Rollup merge of #64973 - ecstatic-morse:fix-debuginfo-test, r=alexcrichton
Fix typo while setting `compile-flags` in test

This test is meant to check for an ICE when generating debug info, but didn't actually pass `-g` due to the typo.

I also removed the `FIXME`, since this needs to actually be built (not just checked) to trigger the ICE.
2019-10-02 18:24:39 +02:00
Mazdak Farrokhzad
ccf1d9ca93
Rollup merge of #64967 - ecstatic-morse:issue-64945, r=oli-obk
Don't mark borrows of zero-sized arrays as indirectly mutable

Resolves #64945

r? @oli-obk
2019-10-02 18:24:38 +02:00
Mazdak Farrokhzad
475f5d4a5c
Rollup merge of #64961 - rust-lang:spastorino-patch-1, r=oli-obk
Make comment about dummy type a bit more clear
2019-10-02 18:24:36 +02:00
Mazdak Farrokhzad
1c8ef985f2
Rollup merge of #64948 - GuillaumeGomez:improve-sidebar-styling, r=Mark-Simulacrum
Improve sidebar styling to make its integration easier

Part of https://github.com/rust-lang/docs.rs/issues/417

Setting the height was an error: forcing the element bottom to be at the bottom allows to change to top of the sidebar.

r? @Mark-Simulacrum
2019-10-02 18:24:35 +02:00
Mazdak Farrokhzad
19d035c013
Rollup merge of #64922 - spastorino:make-place-builder, r=nikomatsakis
Use PlaceBuilder to avoid a lot of slice -> vec -> slice convertions

r? @oli-obk
2019-10-02 18:24:33 +02:00
Mazdak Farrokhzad
fe5fad8912
Rollup merge of #64914 - pnkfelix:issue-64453-regression-test, r=nikomatsakis
regression test for 64453 borrow check error.

Fix #64453
2019-10-02 18:24:31 +02:00
Mazdak Farrokhzad
b7290a0642
Rollup merge of #64850 - Mark-Simulacrum:dedup-dep-node, r=michaelwoerister
Remove inlines from DepNode code
2019-10-02 18:24:30 +02:00
Mazdak Farrokhzad
18d0c03a13
Rollup merge of #64581 - ztlpn:fix-ok-wrapping-unreachable-code, r=Centril
Fix unreachable_code warnings for try{} block ok-wrapped expressions

Fixes #54165 and fixes #63324.
2019-10-02 18:24:29 +02:00
Charles Gleason
5055d4b1c6 Use zipped iterators in clone_from for LinkedList 2019-10-02 11:29:12 -04:00
BO41
2ab7a67326 Replace mentions of IRC with Discord 2019-10-02 17:28:48 +02:00
Alex Crichton
b3fe511635 Update llvm-project submodule
Bring in rust-lang/llvm-project#24 which brings in some wasm
improvements related to the bulk-memory proposal
2019-10-02 07:47:38 -07:00
Niko Matsakis
81cd596bc5 WIP rebase for shallow_resolve call 2019-10-02 10:39:58 -04:00
Niko Matsakis
094f3a844e WIP tidy hir/lowering/expr.rs 2019-10-02 10:33:07 -04:00
Niko Matsakis
f7ed53c9da extract expected return type from -> impl Future obligation 2019-10-02 10:03:40 -04:00
Niko Matsakis
c8e58512d4 improved debug output 2019-10-02 10:03:28 -04:00
Niko Matsakis
44e801aca6 thread down the body so we can check if this is an async fn body 2019-10-02 10:03:27 -04:00
Niko Matsakis
c845f3d002 track the kind of async generator we are creating 2019-10-02 10:03:27 -04:00
Santiago Pastorino
03455e47d8
Filter out RLS output directories on tidy runs 2019-10-02 11:02:14 -03:00
Santiago Pastorino
79dc862d4a
Use PlaceBuilder to avoid a lot of slice -> vec -> slice convertions 2019-10-02 10:53:22 -03:00
Robin Kruppe
8e9f635a70
rustc book: nitpick SLP vectorization
SLP vectorization (in general and as implemented in LLVM) is not limited to loops.
2019-10-02 14:41:49 +02:00
Guillaume Gomez
70dcb99889 Remove rustdoc warning 2019-10-02 14:24:59 +02:00
Guillaume Gomez
de961a7e12 Fix rustdoc display with js disabled 2019-10-02 14:21:25 +02:00
Ben Boeckel
fb80e6c62e BacktraceStatus: add Eq impl
See discussion on #53487.
2019-10-02 08:17:28 -04:00
Mark Rousskov
675ed489d5 Remove inline annotations from dep_node 2019-10-02 07:49:11 -04:00
Wesley Wiser
3a8932d9b0 [const-prop] Correctly handle locals that can't be propagated
`const_prop()` now handles writing the Rvalue into the Place in the
stack frame for us. So if we're not supported to propagate that value,
we need to clear it.
2019-10-02 06:18:45 -04:00
Shotaro Yamada
f0fddb1a89 Do not collect to vec for debug output 2019-10-02 18:59:05 +09:00
Shotaro Yamada
8e67180c52 Fix async/await ICE #64964 2019-10-02 18:26:57 +09:00
David Wood
2537a8aa7a
syntax: improve parameter without type suggestions
This commit improves the suggestions provided when function parameters
do not have types:

- A new suggestion is added for arbitrary self types, which suggests
adding `self: ` before the type.

- Existing suggestions are now provided when a `<` is found where a `:`
was expected (previously only `,` and `)` or trait items), this gives
suggestions in the case where the unnamed parameter type is generic
in a free function.

- The suggestion that a type name be provided (e.g. `fn foo(HashMap<u32>)`
-> `fn foo(HashMap: TypeName<u32>)`) will no longer occur when a `<` was
found instead of `:`.

- The ident will not be used for recovery when a `<` was found instead
of `:`.

Signed-off-by: David Wood <david@davidtw.co>
2019-10-02 09:51:27 +01:00
bors
f2023ac599 Auto merge of #64981 - tmandry:rollup-slfkhay, r=tmandry
Rollup of 11 pull requests

Successful merges:

 - #64649 (Avoid ICE on return outside of fn with literal array)
 - #64722 (Make all alt builders produce parallel-enabled compilers)
 - #64801 (Avoid `chain()` in `find_constraint_paths_between_regions()`.)
 - #64805 (Still more `ObligationForest` improvements.)
 - #64840 (SelfProfiler API refactoring and part one of event review)
 - #64885 (use try_fold instead of try_for_each to reduce compile time)
 - #64942 (Fix clippy warnings)
 - #64952 (Update cargo.)
 - #64974 (Fix zebra-striping in generic dataflow visualization)
 - #64978 (Fully clear `HandlerInner` in `Handler::reset_err_count`)
 - #64979 (Update books)

Failed merges:

 - #64959 (syntax: improve parameter without type suggestions)

r? @ghost
2019-10-02 06:08:24 +00:00