Skip to content

Rollup of 10 pull requests #121800

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

Merged
merged 24 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a6727ba
Support `{async closure}: Fn` in new solver
compiler-errors Feb 26, 2024
118730b
Add a couple helpers, make return types less confusing
compiler-errors Feb 27, 2024
4c0016a
Don't emit higher-ranked Future obligations when confirm async Fn goals
compiler-errors Feb 26, 2024
2252ff7
Also support `fnptr(): async Fn` in codegen
compiler-errors Feb 26, 2024
c8e3f35
Flesh out a few more tests
compiler-errors Feb 26, 2024
8f7b921
CFI: Don't compress user-defined builtin types
rcvalle Feb 27, 2024
b4a0724
Clarify the usage example for hexagon-unknown-none-elf
androm3da Feb 21, 2024
cd47739
Add a platform doc for hexagon-unknown-linux-musl
androm3da Feb 21, 2024
3726cbb
add platform-specific function to get the error number for HermitOS
stlankes Feb 28, 2024
c54d92c
bootstrap/format: send larger batches to rustfmt
RalfJung Feb 29, 2024
f2d9bfb
fix clap warnings
klensy Feb 29, 2024
b5307f5
Document the precision of `f64` methods
tbu- Feb 29, 2024
3770cf7
Improve suggestion to rename type starting with underscore to make it…
GuillaumeGomez Feb 29, 2024
451fd98
Update UI test checking suggestion message to rename type starting wi…
GuillaumeGomez Feb 29, 2024
7400f22
Document which methods on `f32` are precise
tbu- Feb 29, 2024
0c2cb39
Rollup merge of #118217 - tbu-:pr_floating_point, r=Amanieu
GuillaumeGomez Feb 29, 2024
1ee5453
Rollup merge of #121412 - androm3da:bcain/update_hex_docs_03, r=Amanieu
GuillaumeGomez Feb 29, 2024
5978b6f
Rollup merge of #121654 - compiler-errors:async-fn-for-fn-def, r=oli-obk
GuillaumeGomez Feb 29, 2024
b2c3279
Rollup merge of #121700 - rcvalle:rust-cfi-dont-compress-user-defined…
GuillaumeGomez Feb 29, 2024
ad74598
Rollup merge of #121765 - hermit-os:errno, r=ChrisDenton
GuillaumeGomez Feb 29, 2024
b52b699
Rollup merge of #121781 - RalfJung:bootstrap-fmt, r=clubby789
GuillaumeGomez Feb 29, 2024
7147112
Rollup merge of #121788 - klensy:clap-deprecated-fix, r=clubby789
GuillaumeGomez Feb 29, 2024
8a74df9
Rollup merge of #121792 - GuillaumeGomez:improve-suggestion, r=michae…
GuillaumeGomez Feb 29, 2024
bc23b84
Rollup merge of #121793 - tbu-:pr_floating_point_32, r=Amanieu
GuillaumeGomez Feb 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Flesh out a few more tests
  • Loading branch information
compiler-errors committed Feb 27, 2024
commit c8e3f35eb631c35bc7aabf358b7ca5c2a7fbfd1e
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@ extern crate block_on;

fn main() {
block_on::block_on(async {
let x = async || {};

async fn needs_async_fn_once(x: impl async FnOnce()) {
x().await;
}
needs_async_fn_once(x).await;

needs_async_fn_once(async || {}).await;

needs_async_fn_once(|| async {}).await;

async fn foo() {}
needs_async_fn_once(foo).await;
});
}
10 changes: 7 additions & 3 deletions tests/ui/async-await/async-closures/move-is-async-fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//@ edition:2021
//@ build-pass

#![feature(async_closure)]
#![feature(async_closure, async_fn_traits)]

extern crate block_on;

Expand All @@ -15,7 +15,11 @@ fn main() {
c().await;
c().await;

fn is_static<T: 'static>(_: T) {}
is_static(c);
fn is_static<T: 'static>(_: &T) {}
is_static(&c);

// Check that `<{async fn} as AsyncFnOnce>::CallOnceFuture` owns its captures.
fn call_once<F: async FnOnce()>(f: F) -> F::CallOnceFuture { f() }
is_static(&call_once(c));
});
}
13 changes: 10 additions & 3 deletions tests/ui/async-await/async-closures/refd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
//@ edition:2021
//@ build-pass

// check that `&{async-closure}` implements `AsyncFn`.

#![feature(async_closure)]

extern crate block_on;
Expand All @@ -13,6 +11,15 @@ struct NoCopy;
fn main() {
block_on::block_on(async {
async fn call_once(x: impl async Fn()) { x().await }
call_once(&async || {}).await

// check that `&{async-closure}` implements `async Fn`.
call_once(&async || {}).await;

// check that `&{closure}` implements `async Fn`.
call_once(&|| async {}).await;

// check that `&fndef` implements `async Fn`.
async fn foo() {}
call_once(&foo).await;
});
}
12 changes: 12 additions & 0 deletions tests/ui/async-await/async-fn/project.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//@ edition:2018
//@ revisions: current next
//@[next] compile-flags: -Znext-solver
//@ check-pass

#![feature(async_closure, unboxed_closures, async_fn_traits)]

fn project<F: async Fn<()>>(_: F) -> Option<F::Output> { None }

fn main() {
let x: Option<i32> = project(|| async { 1i32 });
}