-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Rollup of 5 pull requests #99231
Conversation
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.
@bors r+ rollup=never p=5 |
☀️ Test successful - checks-actions |
Finished benchmarking commit (f1a8854): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
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 Footnotes |
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
@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. |
Yeah sure will do the reverts tomorrow |
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. |
Successful merges:
core::ffi:c_*
and re-export instd::ffi
#98315 (Stabilizecore::ffi:c_*
and rexport instd::ffi
)for<>
lifetime binder for closures #98705 (Implementfor<>
lifetime binder for closures)x dist
fails for an optional tool #99139 (Give a better error whenx dist
fails for an optional tool)Failed merges:
r? @ghost
@rustbot modify labels: rollup
Create a similar rollup