-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Harmonize AsyncFn
implementations, make async closures conditionally impl Fn*
traits
#120712
Harmonize AsyncFn
implementations, make async closures conditionally impl Fn*
traits
#120712
Conversation
AsyncFn
implementations, make async closures conditionally impl Fn*
traits
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
…nize, r=<try> Harmonize `AsyncFn` implementations, make async closures conditionally impl `Fn*` traits TODO: description TODO: tests (specifically: check that `&async ||` impls `AsyncFn`, flesh out the `Fn` tests, add an always-fnonce test maybe using `Option::map`) r? `@ghost`
This comment has been minimized.
This comment has been minimized.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
Finished benchmarking commit (788c8f4): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 662.774s -> 664.823s (0.31%) |
e988944
to
b093e0c
Compare
This comment has been minimized.
This comment has been minimized.
Hey CI, wtf is wrong with you? |
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
🎉 Experiment
|
The job Click to see the possible cause of the failure (guessed by this bot)
|
…nize, r=oli-obk Harmonize `AsyncFn` implementations, make async closures conditionally impl `Fn*` traits This PR implements several changes to the built-in and libcore-provided implementations of `Fn*` and `AsyncFn*` to address two problems: 1. async closures do not implement the `Fn*` family traits, leading to breakage: https://crater-reports.s3.amazonaws.com/pr-120361/index.html 2. *references* to async closures do not implement `AsyncFn*`, as a consequence of the existing blanket impls of the shape `AsyncFn for F where F: Fn, F::Output: Future`. In order to fix (1.), we implement `Fn` traits appropriately for async closures. It turns out that async closures can: * always implement `FnOnce`, meaning that they're drop-in compatible with `FnOnce`-bound combinators like `Option::map`. * conditionally implement `Fn`/`FnMut` if they have no captures, which means that existing usages of async closures should *probably* work without breakage (crater checking this: rust-lang#120712 (comment)). In order to fix (2.), we make all of the built-in callables implement `AsyncFn*` via built-in impls, and instead adjust the blanket impls for `AsyncFn*` provided by libcore to match the blanket impls for `Fn*`.
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
Linker error on clif looks unrelated? @bors retry |
☀️ Test successful - checks-actions |
Finished benchmarking commit (757b8ef): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 667.844s -> 666.007s (-0.28%) |
…li-obk Harmonize `AsyncFn` implementations, make async closures conditionally impl `Fn*` traits This PR implements several changes to the built-in and libcore-provided implementations of `Fn*` and `AsyncFn*` to address two problems: 1. async closures do not implement the `Fn*` family traits, leading to breakage: https://crater-reports.s3.amazonaws.com/pr-120361/index.html 2. *references* to async closures do not implement `AsyncFn*`, as a consequence of the existing blanket impls of the shape `AsyncFn for F where F: Fn, F::Output: Future`. In order to fix (1.), we implement `Fn` traits appropriately for async closures. It turns out that async closures can: * always implement `FnOnce`, meaning that they're drop-in compatible with `FnOnce`-bound combinators like `Option::map`. * conditionally implement `Fn`/`FnMut` if they have no captures, which means that existing usages of async closures should *probably* work without breakage (crater checking this: rust-lang/rust#120712 (comment)). In order to fix (2.), we make all of the built-in callables implement `AsyncFn*` via built-in impls, and instead adjust the blanket impls for `AsyncFn*` provided by libcore to match the blanket impls for `Fn*`.
…-check, r=oli-obk Actually use the right closure kind when checking async Fn goals Dumb copy-paste mistake on my part from rust-lang#120712. Sorry! r? oli-obk Fixes rust-lang#121599
Rollup merge of rust-lang#121617 - compiler-errors:async-closure-kind-check, r=oli-obk Actually use the right closure kind when checking async Fn goals Dumb copy-paste mistake on my part from rust-lang#120712. Sorry! r? oli-obk Fixes rust-lang#121599
This PR implements several changes to the built-in and libcore-provided implementations of
Fn*
andAsyncFn*
to address two problems:Fn*
family traits, leading to breakage: https://crater-reports.s3.amazonaws.com/pr-120361/index.htmlAsyncFn*
, as a consequence of the existing blanket impls of the shapeAsyncFn for F where F: Fn, F::Output: Future
.In order to fix (1.), we implement
Fn
traits appropriately for async closures. It turns out that async closures can:FnOnce
, meaning that they're drop-in compatible withFnOnce
-bound combinators likeOption::map
.Fn
/FnMut
if they have no captures, which means that existing usages of async closures should probably work without breakage (crater checking this: HarmonizeAsyncFn
implementations, make async closures conditionally implFn*
traits #120712 (comment)).In order to fix (2.), we make all of the built-in callables implement
AsyncFn*
via built-in impls, and instead adjust the blanket impls forAsyncFn*
provided by libcore to match the blanket impls forFn*
.