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 5 pull requests #99231

Merged
merged 24 commits into from Jul 14, 2022
Merged

Rollup of 5 pull requests #99231

merged 24 commits into from Jul 14, 2022

Conversation

Dylan-DPC
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

jyn514 and others added 24 commits July 10, 2022 21:53
Before:
```
thread 'main' panicked at 'Unable to build RLS', dist.rs:42:9
```

After:
```
thread 'main' panicked at 'Unable to build submodule tool RLS (use `missing-tools = true` to ignore this failure)
note: not all tools are available on all nightlies
help: see https://forge.rust-lang.org/infra/toolstate.html for more information', dist.rs:43:9
```
This is first step in implementing RFC 3216.
- Parse `for<'a>` before closures in ast
  - Error in lowering
- Add `closure_lifetime_binder` feature
This helps bring `hir::Expr` size down, `Closure` was the biggest
variant, especially after `for<>` additions.
This only stabilizes the base types, not the non-zero variants, since
those have their own separate tracking issue and have not gone through
FCP to stabilize.
Always create elided lifetime parameters for functions

Anonymous and elided lifetimes in functions are sometimes (async fns) --and sometimes not (regular fns)-- desugared to implicit generic parameters.

This difference of treatment makes it some downstream analyses more complicated to handle.  This step is a pre-requisite to perform lifetime elision resolution on AST.

There is currently an inconsistency in the treatment of argument-position impl-trait for functions and async fns:
```rust
trait Foo<'a> {}
fn foo(t: impl Foo<'_>) {} //~ ERROR missing lifetime specifier
async fn async_foo(t: impl Foo<'_>) {} //~ OK
fn bar(t: impl Iterator<Item = &'_ u8>) {} //~ ERROR missing lifetime specifier
async fn async_bar(t: impl Iterator<Item = &'_ u8>) {} //~ OK
```

The current implementation reports "missing lifetime specifier" on `foo`, but **accepts it** in `async_foo`.
This PR **proposes to accept** the anonymous lifetime in both cases as an extra generic lifetime parameter.
This change would be insta-stable, so let's ping t-lang.
Anonymous lifetimes in GAT bindings keep being forbidden:
```rust
fn foo(t: impl Foo<Assoc<'_> = Bar<'_>>) {}
                         ^^        ^^
                       forbidden   ok
```
I started a discussion here: https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Anonymous.20lifetimes.20in.20universal.20impl-trait/near/284968606

r? ``@petrochenkov``
…r=Mark-Simulacrum

Stabilize `core::ffi:c_*` and rexport in `std::ffi`

This only stabilizes the base types, not the non-zero variants, since
those have their own separate tracking issue and have not gone through
FCP to stabilize.
…llot

Implement `for<>` lifetime binder for closures

This PR implements RFC 3216 ([TI](rust-lang#97362)) and allows code like the following:

```rust
let _f = for<'a, 'b> |a: &'a A, b: &'b B| -> &'b C { b.c(a) };
//       ^^^^^^^^^^^--- new!
```

cc ``@Aaron1011`` ``@cjgillot``
…etrochenkov

remove allow(rustc::potential_query_instability) in rustc_span

Also, avoid sorting before debug output as iteration order can now be
relied upon.

Related rust-lang#84447
…acrum

Give a better error when `x dist` fails for an optional tool

Before:
```
thread 'main' panicked at 'Unable to build RLS', dist.rs:42:9
```

After:
```
thread 'main' panicked at 'Unable to build submodule tool RLS (use `missing-tools = true` to ignore this failure)
note: not all tools are available on all nightlies
help: see https://forge.rust-lang.org/infra/toolstate.html for more information', dist.rs:43:9
```

Closes rust-lang#85683 by explaining better why the error is expected.
@rustbot rustbot added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Jul 14, 2022
@Dylan-DPC
Copy link
Member Author

@bors r+ rollup=never p=5

@bors
Copy link
Contributor

bors commented Jul 14, 2022

📌 Commit c1b43ef has been approved by Dylan-DPC

It is now in the queue for this repository.

@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 Jul 14, 2022
@bors
Copy link
Contributor

bors commented Jul 14, 2022

⌛ Testing commit c1b43ef with merge f1a8854...

@bors
Copy link
Contributor

bors commented Jul 14, 2022

☀️ Test successful - checks-actions
Approved by: Dylan-DPC
Pushing f1a8854 to master...

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f1a8854): comparison url.

Instruction count

  • Primary benchmarks: 😿 relevant regressions found
  • Secondary benchmarks: 😿 relevant regressions found
mean1 max count2
Regressions 😿
(primary)
1.2% 3.2% 117
Regressions 😿
(secondary)
1.7% 6.4% 35
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
-0.3% -0.3% 1
All 😿🎉 (primary) 1.2% 3.2% 117

Max RSS (memory usage)

Results
  • Primary benchmarks: 😿 relevant regressions found
  • Secondary benchmarks: mixed results
mean1 max count2
Regressions 😿
(primary)
2.4% 8.0% 95
Regressions 😿
(secondary)
3.3% 5.2% 12
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
-2.1% -3.7% 10
All 😿🎉 (primary) 2.4% 8.0% 95

Cycles

Results
  • Primary benchmarks: 😿 relevant regressions found
  • Secondary benchmarks: 😿 relevant regressions found
mean1 max count2
Regressions 😿
(primary)
3.0% 4.3% 32
Regressions 😿
(secondary)
3.8% 8.3% 14
Improvements 🎉
(primary)
N/A N/A 0
Improvements 🎉
(secondary)
N/A N/A 0
All 😿🎉 (primary) 3.0% 4.3% 32

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression

Footnotes

  1. the arithmetic mean of the percent change 2 3

  2. number of relevant changes 2 3

@rustbot rustbot added the perf-regression Performance regression. label Jul 14, 2022
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jul 18, 2022
Rollup of 5 pull requests

Successful merges:

 - rust-lang#97720 (Always create elided lifetime parameters for functions)
 - rust-lang#98315 (Stabilize `core::ffi:c_*` and rexport in `std::ffi`)
 - rust-lang#98705 (Implement `for<>` lifetime binder for closures)
 - rust-lang#99126 (remove allow(rustc::potential_query_instability) in rustc_span)
 - rust-lang#99139 (Give a better error when `x dist` fails for an optional tool)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@rylev
Copy link
Member

rylev commented Jul 19, 2022

@Dylan-DPC the performance regression here is unfortunately very bad. It's also very hard to tell which PR is responsible since some of them are very large. We might want to try reverting #98705 (and maybe #99126?) to see if one of them is the culprit.

cc @WaffleLapkin @NiklasJonsson

@Dylan-DPC
Copy link
Member Author

Yeah sure will do the reverts tomorrow

@NiklasJonsson
Copy link
Contributor

NiklasJonsson commented Jul 19, 2022

In the end, #99126 did not contain any functional change. It only moves the allow-attribute to smaller scope so it shouldn't have any effect on performance. I changed the commit name and description to reflect this but forgot to change the PR title, which might be a bit confusing.

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. perf-regression Performance regression. 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. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants