Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 6 pull requests #69012

Merged
merged 20 commits into from
Feb 10, 2020
Merged

Rollup of 6 pull requests #69012

merged 20 commits into from
Feb 10, 2020

Conversation

Dylan-DPC-zz
Copy link

Successful merges:

Failed merges:

r? @ghost

ecstatic-morse and others added 20 commits February 8, 2020 16:02
Now the line for each statement will show the diff resulting from the
combination of `before_statement_effect` and `statement_effect`. It's
still possible to observe each in isolation via
`borrowck_graphviz_format = "two_phase"`.
including their unnormalized forms.
Add more documentation for them.
`InferCtxt` contains six structures within `RefCell`s. Every time we
create and dispose of (commit or rollback) a snapshot we have to
`borrow_mut` each one of them.

This commit moves the six structures under a single `RefCell`, which
gives significant speed-ups by reducing the number of `borrow_mut`
calls. To avoid runtime errors I had to reduce the lifetimes of dynamic
borrows in a couple of places.
This has negligible perf impact, but it does improve the code a bit.

* Only query the specialization graph of any trait once instead of once per
  impl
* Loop over impls only once, precomputing impl DefId and TraitRef
This was showing up in profiles. Also deduplicates the code to get just
the impl header span.
This was previously a future-compat warning that has since been turned into
hard error, but without actually removing all the code.

Avoids a call to `traits::overlapping_impls`, which is expensive.
…rCtxt, r=varkor

Reduce the number of `RefCell`s in `InferCtxt`.

`InferCtxt` contains six structures within `RefCell`s. Every time we
create and dispose of (commit or rollback) a snapshot we have to
`borrow_mut` each one of them.

This commit moves the six structures under a single `RefCell`, which
gives significant speed-ups by reducing the number of `borrow_mut`
calls. To avoid runtime errors I had to reduce the lifetimes of dynamic
borrows in a couple of places.

r? @varkor
…arkor

Improve performance of coherence checks

The biggest perf improvement in here is expected to come from the removal of the remaining rust-lang#43355 warning code since that effectively runs the expensive parts of coherence *twice*, which can even be visualized by obtaining a flamegraph:

![image](https://user-images.githubusercontent.com/5047365/74091959-e1f41200-4a8b-11ea-969d-2849d3f86c63.png)
…olnay

Make `num::NonZeroX::new` an unstable `const fn`

cc rust-lang#53718

These require `#[feature(const_if_match)]`, meaning they must remain unstable for the time being.
…phviz, r=wesleywiser

Small graphviz improvements for the new dataflow framework

Split out from rust-lang#68241. This prints the correct effect diff for each line (the before-effect and the after-effect) and makes marginal improvements to the graphviz output for the new dataflow framework including using monospaced font and better line breaking. This will only be useful when rust-lang#68241 is merged and the graphviz output changes from this:

![image](https://user-images.githubusercontent.com/29463364/74107776-5e3c3300-4b28-11ea-9d33-4862228b5e87.png)

to this:

![image](https://user-images.githubusercontent.com/29463364/74107751-20d7a580-4b28-11ea-99ca-24f749386601.png)

r? @wesleywiser
parser: Keep current and previous tokens precisely

...including their unnormalized forms.
Add more documentation for them.

Hopefully, this will help to eliminate footguns like rust-lang#68728 (comment).

I'll try to address the FIXMEs in separate PRs during the next week.

r? @Centril
@Dylan-DPC-zz
Copy link
Author

@bors r+ rollup=never p=6

@bors
Copy link
Contributor

bors commented Feb 10, 2020

📌 Commit 18c6d39 has been approved by Dylan-DPC

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Feb 10, 2020
@Dylan-DPC-zz Dylan-DPC-zz added the rollup A PR which is a rollup label Feb 10, 2020
@bors
Copy link
Contributor

bors commented Feb 10, 2020

⌛ Testing commit 18c6d39 with merge c508e9f244f9d5f23ba0541e1c3b3b8381355fe7...

@bors
Copy link
Contributor

bors commented Feb 10, 2020

💥 Test timed out

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 10, 2020
@Centril
Copy link
Contributor

Centril commented Feb 10, 2020

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 10, 2020
@jonas-schievink
Copy link
Contributor

@bors retry

queue's stuck?

@bors
Copy link
Contributor

bors commented Feb 10, 2020

⌛ Testing commit 18c6d39 with merge 4d1241f...

bors added a commit that referenced this pull request Feb 10, 2020
Rollup of 6 pull requests

Successful merges:

 - #68694 (Reduce the number of `RefCell`s in `InferCtxt`.)
 - #68966 (Improve performance of coherence checks)
 - #68976 (Make `num::NonZeroX::new` an unstable `const fn`)
 - #68992 (Correctly parse `mut a @ b`)
 - #69005 (Small graphviz improvements for the new dataflow framework)
 - #69006 (parser: Keep current and previous tokens precisely)

Failed merges:

r? @ghost
@bors
Copy link
Contributor

bors commented Feb 10, 2020

☀️ Test successful - checks-azure
Approved by: Dylan-DPC
Pushing 4d1241f to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 10, 2020
@bors bors merged commit 18c6d39 into rust-lang:master Feb 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants