Commit Graph

120751 Commits

Author SHA1 Message Date
Bastian Kauschke
f15e4b30c0 fix Predicate perf regression 2020-05-23 19:02:26 +02:00
Ralf Jung
b388f96495 bless mir-opt tests 2020-05-23 17:20:17 +02:00
Ralf Jung
89aac16558 fix discriminant type in generator transform 2020-05-23 15:41:57 +02:00
Ralf Jung
1c9b96b754 add warning sign to UB examples 2020-05-23 14:00:55 +02:00
Jake Goulding
749d9e7a26 Correct small typo: 'not' -> 'note' 2020-05-23 07:29:22 -04:00
Bastian Kauschke
810dbf7770 take mir::PlaceElem by value 2020-05-23 12:24:19 +02:00
Bastian Kauschke
da57cedd21 iterate List by value 2020-05-23 12:24:19 +02:00
Bastian Kauschke
647ae50ce6 take predicates by value instead of by reference 2020-05-23 11:09:32 +02:00
Yuki Okushi
47e35cb9bd
Add test for #72455 2020-05-23 17:53:14 +09:00
Yuki Okushi
58fe05a124
Add test for #69415 2020-05-23 17:53:14 +09:00
bors
75b0a68f35 Auto merge of #72478 - Dylan-DPC:rollup-vval8du, r=Dylan-DPC
Rollup of 7 pull requests

Successful merges:

 - #71289 (Allow using `Self::` in doc)
 - #72375 (Improve E0599 explanation)
 - #72385 (Add some teams to prioritization exclude_labels)
 - #72395 (Allow rust-highfive to label issues it creates.)
 - #72453 (Add flag to open docs:  x.py doc --open)
 - #72459 (Add core::future::IntoFuture)
 - #72461 (Clean up E0600 explanation)

Failed merges:

r? @ghost
2020-05-23 07:18:17 +00:00
Gary Guo
e04baed0db Fix ice-72487 2020-05-23 07:33:09 +01:00
bors
7f940ef5d9 Auto merge of #72256 - ecstatic-morse:once-cell, r=Mark-Simulacrum
Use `once_cell` crate instead of custom data structure

Internally, we use the [`Once`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_data_structures/sync/struct.Once.html) type for shared data that is initialized exactly once and only read from afterwards. `Once` uses a `parking_lot::Mutex` when the parallel compiler is enabled and a `RefCell` when it is not. This PR switches to the [`once_cell`](https://crates.io/crates/once_cell) crate, which also uses a `parking_lot::Mutex` for its `sync` version (because we enable the `parking_lot` feature) but has zero overhead for its `unsync` one.

This PR adds `once_cell` to the list of whitelisted dependencies. I think this is acceptable because it is already used in `rustc_driver`, is owned by a well-known community member (cc @matklad), and has a stable release. cc @rust-lang/compiler

`once_cell` has a slightly more minimal API than `Once`, which allows for initialization to be either optimistic (evaluate the initializer and then synchronize) or pessimistic (synchronize and then evaluate the initializer). `once_cell`'s `get_or_init` is always pessimistic. The optimistic version is only used once in the current `master`.

r? @Mark-Simulacrum
2020-05-23 03:30:07 +00:00
Aaron Hill
d277904582
Remove macro_defs map
We store store the `DefId` directly in `ExpnData`. This will allow us to
serialize `ExpnData` in PR #72121 without needing to manage a side
table.
2020-05-22 16:57:25 -04:00
Dylan MacKenzie
1fad3b7a05 Use mk_trait_obligation_with_new_self_ty for new suggestion 2020-05-22 13:34:41 -07:00
Dylan MacKenzie
f99519bebb Bail out if output_ty has bound variables 2020-05-22 13:34:41 -07:00
Dylan MacKenzie
7278e29592 Document invariants of mk_trait_obligation_with_new_self_ty 2020-05-22 13:34:41 -07:00
Dylan MacKenzie
d2bacb18d2 Ensure that new_self_ty has no escaping bound vars
Otherwise inserting it to the `Binder` used by `trait_ref` would cause
problems. This is just to be extra carefult: we aren't going to
start recommending that the user start using HKTs anytime soon.
2020-05-22 13:34:41 -07:00
Dylan MacKenzie
4d9e9c6d4e Bless other example of #71394 2020-05-22 13:34:41 -07:00
Dylan MacKenzie
8ea828be2f Add regression test for #71394 2020-05-22 13:34:41 -07:00
Dylan MacKenzie
730c6f3e57 Preserve substitutions when trying to prove trait obligation
`mk_obligation_for_def_id` is only correct if the trait and self type do
not have any substitutions. Use a different method,
`mk_trait_obligation_with_new_self_ty` that is more clear about what is
happening.
2020-05-22 13:34:38 -07:00
Dylan MacKenzie
307153e611 Switch to non-doc comment 2020-05-22 13:31:02 -07:00
Dylan MacKenzie
f17e2c93a6 Use OnceCell for predecessor cache 2020-05-22 13:31:02 -07:00
Dylan MacKenzie
c282c1c654 Use OnceCell instead of Once 2020-05-22 13:31:02 -07:00
Dylan MacKenzie
9f82785c81 Replace rustc_data_structures::sync::Once with OnceCell 2020-05-22 13:26:39 -07:00
Dylan DPC
bf1b998be6
Rollup merge of #72461 - GuillaumeGomez:cleanup-e0600, r=Dylan-DPC
Clean up E0600 explanation

r? @Dylan-DPC
2020-05-22 21:45:04 +02:00
Dylan DPC
141ce5f2ad
Rollup merge of #72459 - yoshuawuyts:into-future, r=nikomatsakis
Add core::future::IntoFuture

This patch reintroduces the `core::future::IntoFuture` trait. However unlike earlier PRs this patch does not integrate it into the `async/.await` lowering since that lead to performance regressions. By introducing the trait separately from the integration, the integration PR can be more narrowly scoped, and people can start trying out the `IntoFuture` trait today. Thanks heaps!

cc/ @rust-lang/wg-async-foundations

## References
- Original PR adding `IntoFuture` https://github.com/rust-lang/rust/pull/65244
- Open issue to re-land `IntoFuture` (assigned to me) https://github.com/rust-lang/rust/issues/67982
- Tracking issue for `IntoFuture` https://github.com/rust-lang/rust/issues/67644
2020-05-22 21:45:01 +02:00
Dylan DPC
3083ce7ab1
Rollup merge of #72453 - dtolnay:open, r=Mark-Simulacrum
Add flag to open docs:  x.py doc --open

This aligns with Cargo's flag `cargo doc --open`.

Tested with:

```bash
   # opens doc/index.html
x.py doc --stage 0 --open
x.py doc --stage 0 --open src/doc

   # opens doc/book/index.html
x.py doc --stage 0 --open src/doc/book

   # opens doc/std/index.html
x.py doc --stage 0 --open src/libstd

   # opens doc/proc_macro/index.html
x.py doc --stage 0 --open src/libproc_macro

   # opens both
x.py doc --stage 0 --open src/libstd src/libproc_macro
```
2020-05-22 21:45:00 +02:00
Dylan DPC
01adfe1bc3
Rollup merge of #72395 - Elinvynia:highfive, r=Mark-Simulacrum
Allow rust-highfive to label issues it creates.

This is my first meaningful PR, I am unsure how to test this code so any pointers would be welcome!

I am about 50% sure it works.
2020-05-22 21:44:58 +02:00
Dylan DPC
84fbbded1e
Rollup merge of #72385 - spastorino:add-exclude-labels, r=Mark-Simulacrum
Add some teams to prioritization exclude_labels

r? @Mark-Simulacrum @LeSeulArtichaut
2020-05-22 21:44:56 +02:00
Dylan DPC
47f3c440ec
Rollup merge of #72375 - GuillaumeGomez:cleanup-e0599, r=Dylan-DPC
Improve E0599 explanation

r? @Dylan-DPC
2020-05-22 21:44:54 +02:00
Dylan DPC
dd78839432
Rollup merge of #71289 - xliiv:70802-intra-self, r=GuillaumeGomez
Allow using `Self::` in doc

Closes #70802
2020-05-22 21:44:52 +02:00
Aaron Hill
5685e4dd90
Fix rebase fallout 2020-05-22 15:12:11 -04:00
Aaron Hill
30c00fd26a
Add test for macro_rules! invoking a proc-macro with capture groups 2020-05-22 15:07:41 -04:00
Aaron Hill
2af0218bf1
Recursively expand nonterminals 2020-05-22 15:07:36 -04:00
Aaron Hill
7a4c1865fb
Move functions to librustc_parse 2020-05-22 15:01:08 -04:00
Mateusz Mikuła
4b516279a9 Revert MSYS2 CI workaround 2020-05-22 19:08:39 +02:00
Matthew Jasper
9754b3fc1d Document collect_bounding_regions 2020-05-22 18:03:08 +01:00
Matthew Jasper
f9f3063cfa Update tests 2020-05-22 18:03:08 +01:00
Matthew Jasper
3d8a0733ae Remove dead ScopeTree code 2020-05-22 18:03:08 +01:00
Matthew Jasper
52d628f250 Remove unused error reporting code 2020-05-22 18:03:08 +01:00
Matthew Jasper
7d73e4cc47 Remove ReScope 2020-05-22 18:03:08 +01:00
David Tolnay
07b1de4e9a
Report error from opener in bootstrap
On my machine, an error looks like:

    Finished release [optimized] target(s) in 0.29s
    Opening doc /git/rust/build/x86_64-unknown-linux-gnu/doc/std/index.html
    command 'xdg-open (internal)' did not execute successfully; exit code: 4
    command stderr:
    gio: file:///git/rust/build/x86_64-unknown-linux-gnu/doc/std/index.html: Error when getting information for file “/git/rust/build/x86_64-unknown-linux-gnu/doc/std/index.html”: No such file or directory

    Build completed successfully in 0:00:08
2020-05-22 09:51:46 -07:00
Matthew Jasper
c102312c2b Remove the parts of regionck referencing ReScope 2020-05-22 17:38:20 +01:00
Matthew Jasper
187bfb333b Improve the error when an opaque type captures ReEmtpty 2020-05-22 17:38:20 +01:00
Matthew Jasper
33f90f213d Check for upper bound universe errors more carefully 2020-05-22 17:38:20 +01:00
LeSeulArtichaut
01630b26dd Implement Sync for `process::Command on unix and vxworks 2020-05-22 18:33:12 +02:00
bors
215f2d3294 Auto merge of #72464 - RalfJung:rollup-xhm7w7u, r=RalfJung
Rollup of 7 pull requests

Successful merges:

 - #71829 (Fix suggestion to borrow in struct)
 - #72123 (Stabilize process_set_argv0 feature for Unix)
 - #72235 (Clean up E0590 explanation)
 - #72345 (Clean up E0593 explanation)
 - #72376 ([self-profling] Record the cgu name when doing codegen for a module)
 - #72399 (Add fast-path optimization for Ipv4Addr::fmt)
 - #72435 (rustllvm: Fix warnings about unused function parameters)

Failed merges:

r? @ghost
2020-05-22 15:33:32 +00:00
Lzu Tao
2df69baa55 Stabilize str_strip feature 2020-05-22 15:29:47 +00:00
Elinvynia
dc4b9fd863 Allow rust-highfive to label issues it creates.
Replace sets with lists.
2020-05-22 17:28:22 +02:00