121030 Commits

Author SHA1 Message Date
Aaron Hill
8da494272f
Add missing ASM arena declaration to librustc_middle
Fixes #72386

This type also needs to get allocated on the `librustc_middle` arena
when we deserialize MIR.
2020-05-23 15:50:37 -04:00
Nadrieril
3e8ba3a3cb Remove out-of-date comment 2020-05-23 19:39:38 +01:00
Nadrieril
7addc115eb Work around type normalization issues 2020-05-23 18:59:27 +01:00
bors
8970e8bcf6 Auto merge of #72504 - Dylan-DPC:rollup-6wi1ifz, r=Dylan-DPC
Rollup of 5 pull requests

Successful merges:

 - #72292 (Replace obligation construction with deref_steps())
 - #72431 (add warning sign to UB examples)
 - #72446 (Impl Ord for proc_macro::LineColumn)
 - #72492 (Add some regression tests)
 - #72496 (Correct small typo: 'not' -> 'note')

Failed merges:

r? @ghost
2020-05-23 17:53:54 +00:00
Nadrieril
3bf94b2c9d Naming 2020-05-23 18:49:38 +01:00
Dylan DPC
a03bf3f5f5
Rollup merge of #72496 - shepmaster:typo, r=Dylan-DPC
Correct small typo: 'not' -> 'note'
2020-05-23 19:10:02 +02:00
Dylan DPC
e91897d214
Rollup merge of #72492 - JohnTitor:add-tests, r=matthewjasper
Add some regression tests

Closes #69415
Closes #72455

r? @matthewjasper
2020-05-23 19:10:01 +02:00
Dylan DPC
67759b74f4
Rollup merge of #72446 - dtolnay:ord, r=petrochenkov
Impl Ord for proc_macro::LineColumn

```rust
impl Ord for LineColumn {...}
impl PartialOrd for LineColumn {...}
```

for https://doc.rust-lang.org/nightly/proc_macro/struct.LineColumn.html.

The ordering is the natural one you would get by writing one line after another, where we compare line first, then compare columns within the same line.
2020-05-23 19:10:00 +02:00
Dylan DPC
d5e3009bd8
Rollup merge of #72431 - RalfJung:ub-warning, r=shepmaster
add warning sign to UB examples

Just to make it less likely that people miss the fact that these are examples for how to *not* do it.
2020-05-23 19:09:58 +02:00
Dylan DPC
b24030fc3e
Rollup merge of #72292 - ldm0:derefsteps, r=estebank
Replace obligation construction with deref_steps()

1. Use `probe()` to avoid unwanted binding committing during `deref_steps()`.
2. Fixes #59819 again by using `deref_steps()`, make the code cleaner. And if we want to suggest multiple dereferences (like: `consider dereferencing the borrow: "****a"`) in the future, this change will make it easier to achieve.
2020-05-23 19:09:57 +02:00
Bastian Kauschke
f15e4b30c0 fix Predicate perf regression 2020-05-23 19:02:26 +02:00
mendess
32eedadee1 Add tests 2020-05-23 16:51:02 +01: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
mendess
a5734ca417 Override Box::<[T]>::clone_from 2020-05-23 14:08:53 +01:00
Nadrieril
b7cfb6a9ac Improve debugging 2020-05-23 13:15:29 +01: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
Guillaume Gomez
d01f1314b7 Improve E0601 explanation 2020-05-23 13:19:57 +02: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
Stanislav Tkach
a9199de34d Merge spans for the suggestion 2020-05-23 00:16:17 +03: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
b3a690f5a1 Use OnceCell instead of Once 2020-05-22 13:31:02 -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