Skip to content

Commit 0a738d3

Browse files
committed
fix(core): add missing bounds to type-alias-impl-traits
It seems that [rust-lang/rust#96736][1] introduced checks for these missing bounds, resulting in the following compilation error: error[E0277]: expected a `FnOnce<(Output,)>` closure, found `Mapper` --> src/r3_core/src/bind.rs:1360:5 | 1360 | move || (mapper)(inner_bound_fn()) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `FnOnce<(Output,)>` closure, found `Mapper` | note: required by a bound in `map_bind_inner` --> src/r3_core/src/bind.rs:1358:13 | 1352 | const fn map_bind_inner<InnerBoundFn, Output, Mapper, NewOutput>( | -------------- required by a bound in this ... 1358 | Mapper: FnOnce(Output) -> NewOutput + Copy + Send + 'static, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map_bind_inner` help: consider further restricting this bound | 1349 | Mapper: Copy + Send + 'static + core::ops::FnOnce<(Output,)>, | ++++++++++++++++++++++++++++++ [1]: rust-lang/rust#96736
1 parent a6331be commit 0a738d3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/r3_core/src/bind.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,8 @@ macro_rules! impl_fn_bind {
12161216
type BoundFn<T, Output, $( $RuntimeBinderI, )*>
12171217
where
12181218
$( $RuntimeBinderI: RuntimeBinder, )*
1219-
T: Copy + Send + 'static,
1219+
T: for<'call> FnOnce($( $RuntimeBinderI::Target<'call>, )*)
1220+
-> Output + Copy + Send + 'static,
12201221
= impl FnOnce() -> Output + Copy + Send + 'static;
12211222

12221223
const fn bind_inner<
@@ -1345,8 +1346,8 @@ where
13451346

13461347
type MappedBoundFn<InnerBoundFn, Output, Mapper, NewOutput>
13471348
where
1348-
InnerBoundFn: Copy + Send + 'static,
1349-
Mapper: Copy + Send + 'static,
1349+
InnerBoundFn: FnOnce() -> Output + Copy + Send + 'static,
1350+
Mapper: FnOnce(Output) -> NewOutput + Copy + Send + 'static,
13501351
= impl FnOnce() -> NewOutput + Copy + Send + 'static;
13511352

13521353
const fn map_bind_inner<InnerBoundFn, Output, Mapper, NewOutput>(

0 commit comments

Comments
 (0)