Skip to content

Rollup of 9 pull requests #125743

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

Closed
wants to merge 24 commits into from
Closed
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
5cf198d
Remove path choice from `x fmt` and add `--all` option.
nnethercote May 28, 2024
e98740a
Clarify `x fmt` messages.
nnethercote May 29, 2024
3d5d6d2
Adjust `x fmt` printed output.
nnethercote May 29, 2024
a22cfcc
Rename `fmt_override`.
nnethercote May 29, 2024
4dec0a0
Clarify the closure in `rustfmt`.
nnethercote May 29, 2024
5b0e6cb
Migrate `run-make/const-prop-lint` to `rmake.rs`
GuillaumeGomez May 28, 2024
de1d0e0
Migrate `run-make/crate-data-smoke` to `rmake.rs`
GuillaumeGomez May 29, 2024
22953b3
convert simple-dylib to ui test
Oneirical May 28, 2024
0697884
convert fpic to ui test
Oneirical May 28, 2024
8c8d0db
rewrite and rename issue-37893 to rmake
Oneirical May 28, 2024
301d722
Add `run-make-support::rust_lib_name`
GuillaumeGomez May 29, 2024
0d63e6b
[ACP 362] genericize `ptr::from_raw_parts`
scottmcm May 29, 2024
7f11d6f
Add lang items for AsyncFn's associated types
compiler-errors May 29, 2024
3c4066d
Add a test for resolving `macro_rules` calls inside attributes
petrochenkov May 29, 2024
a9c7e02
Add lang item for Future::Output
compiler-errors May 29, 2024
a03ba7f
Add lang item for AsyncFnKindHelper::Upvars
compiler-errors May 29, 2024
6e67eaa
ast: Revert a breaking attribute visiting order change
petrochenkov May 29, 2024
a2c36d9
Rollup merge of #125653 - GuillaumeGomez:migrate-const-prop-lint, r=j…
fmease May 29, 2024
7736722
Rollup merge of #125662 - Oneirical:more-tests-again, r=jieyouxu
fmease May 29, 2024
e0d697a
Rollup merge of #125699 - nnethercote:streamline-rustfmt, r=Guillaume…
fmease May 29, 2024
d355ac2
Rollup merge of #125701 - scottmcm:generic-from-raw-parts, r=WaffleLa…
fmease May 29, 2024
5ab9868
Rollup merge of #125723 - GuillaumeGomez:migrate-run-make-crate-data-…
fmease May 29, 2024
1b0b2b3
Rollup merge of #125733 - compiler-errors:async-fn-assoc-item, r=fmease
fmease May 29, 2024
ad8e162
Rollup merge of #125734 - petrochenkov:macinattr, r=wesleywiser
fmease May 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
Add lang items for AsyncFn's associated types
  • Loading branch information
compiler-errors committed May 29, 2024
commit 7f11d6f4bf8c4574b29d683ff72e596e7bcfbb50
3 changes: 3 additions & 0 deletions compiler/rustc_hir/src/lang_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ language_item_table! {
AsyncFn, sym::async_fn, async_fn_trait, Target::Trait, GenericRequirement::Exact(1);
AsyncFnMut, sym::async_fn_mut, async_fn_mut_trait, Target::Trait, GenericRequirement::Exact(1);
AsyncFnOnce, sym::async_fn_once, async_fn_once_trait, Target::Trait, GenericRequirement::Exact(1);
AsyncFnOnceOutput, sym::async_fn_once_output,async_fn_once_output, Target::AssocTy, GenericRequirement::Exact(1);
CallOnceFuture, sym::call_once_future, call_once_future, Target::AssocTy, GenericRequirement::Exact(1);
CallRefFuture, sym::call_ref_future, call_ref_future, Target::AssocTy, GenericRequirement::Exact(2);
AsyncFnKindHelper, sym::async_fn_kind_helper,async_fn_kind_helper, Target::Trait, GenericRequirement::Exact(1);

FnOnceOutput, sym::fn_once_output, fn_once_output, Target::AssocTy, GenericRequirement::None;
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ symbols! {
async_fn_kind_helper,
async_fn_mut,
async_fn_once,
async_fn_once_output,
async_fn_track_caller,
async_fn_traits,
async_for_loop,
Expand Down Expand Up @@ -498,6 +499,8 @@ symbols! {
call,
call_mut,
call_once,
call_once_future,
call_ref_future,
caller_location,
capture_disjoint_fields,
catch_unwind,
Expand Down
22 changes: 14 additions & 8 deletions compiler/rustc_trait_selection/src/solve/normalizes_to/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,16 +407,20 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
output_coroutine_ty,
coroutine_return_ty,
}| {
let (projection_term, term) = match tcx.item_name(goal.predicate.def_id()) {
sym::CallOnceFuture => (
let lang_items = tcx.lang_items();
let (projection_term, term) = if Some(goal.predicate.def_id())
== lang_items.call_once_future()
{
(
ty::AliasTerm::new(
tcx,
goal.predicate.def_id(),
[goal.predicate.self_ty(), tupled_inputs_ty],
),
output_coroutine_ty.into(),
),
sym::CallRefFuture => (
)
} else if Some(goal.predicate.def_id()) == lang_items.call_ref_future() {
(
ty::AliasTerm::new(
tcx,
goal.predicate.def_id(),
Expand All @@ -427,8 +431,9 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
],
),
output_coroutine_ty.into(),
),
sym::Output => (
)
} else if Some(goal.predicate.def_id()) == lang_items.async_fn_once_output() {
(
ty::AliasTerm::new(
tcx,
goal.predicate.def_id(),
Expand All @@ -438,8 +443,9 @@ impl<'tcx> assembly::GoalKind<'tcx> for NormalizesTo<'tcx> {
],
),
coroutine_return_ty.into(),
),
name => bug!("no such associated type: {name}"),
)
} else {
bug!("no such associated type in `AsyncFn*`: {:?}", goal.predicate.def_id())
};
ty::ProjectionPredicate { projection_term, term }
},
Expand Down
3 changes: 3 additions & 0 deletions library/core/src/ops/async_function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub trait AsyncFn<Args: Tuple>: AsyncFnMut<Args> {
pub trait AsyncFnMut<Args: Tuple>: AsyncFnOnce<Args> {
/// Future returned by [`AsyncFnMut::async_call_mut`] and [`AsyncFn::async_call`].
#[unstable(feature = "async_fn_traits", issue = "none")]
#[cfg_attr(not(bootstrap), lang = "call_ref_future")]
type CallRefFuture<'a>: Future<Output = Self::Output>
where
Self: 'a;
Expand All @@ -46,10 +47,12 @@ pub trait AsyncFnMut<Args: Tuple>: AsyncFnOnce<Args> {
pub trait AsyncFnOnce<Args: Tuple> {
/// Future returned by [`AsyncFnOnce::async_call_once`].
#[unstable(feature = "async_fn_traits", issue = "none")]
#[cfg_attr(not(bootstrap), lang = "call_once_future")]
type CallOnceFuture: Future<Output = Self::Output>;

/// Output type of the called closure's future.
#[unstable(feature = "async_fn_traits", issue = "none")]
#[cfg_attr(not(bootstrap), lang = "async_fn_once_output")]
type Output;

/// Call the [`AsyncFnOnce`], returning a future which may move out of the called closure.
Expand Down
Loading