Skip to content

1.95 beta regression: "expected a closure that implements the Fn trait, but this closure only implements FnOnce" #153816

@theemathas

Description

@theemathas

Regression found by the 1.95 beta crater run.

[INFO] [stdout] error[E0525]: expected a closure that implements the `Fn` trait, but this closure only implements `FnOnce`
[INFO] [stdout]    --> overengineered_hkts/src/hkt/iter.rs:575:40
[INFO] [stdout]     |
[INFO] [stdout] 564 | /             <F as Functor<'t, ReqIn, ConstBool<false>, ReqF1>>::map(
[INFO] [stdout] 565 | |                 {
[INFO] [stdout] 566 | |                     let clone_b = clone_b.clone();
[INFO] [stdout] 567 | |                     move |vec: &Vec<<TInner as Hkt<'t>>::F<'a, B>>| {
[INFO] [stdout] ...   |
[INFO] [stdout] 575 | |                 ReqF1::create_from(&f, |vec: Vec<<TInner as Hkt<'t>>::F<'a, B>>| {
[INFO] [stdout]     | |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this closure implements `FnOnce`, not `Fn`
[INFO] [stdout] ...   |
[INFO] [stdout] 578 | |                 result,
[INFO] [stdout] 579 | |             )
[INFO] [stdout]     | |_____________- the requirement to implement `Fn` derives from here
[INFO] [stdout]     |
[INFO] [stdout] note: required by a bound in `traits::Functor::map`
[INFO] [stdout]    --> overengineered_hkts/src/hkt/traits.rs:310:20
[INFO] [stdout]     |
[INFO] [stdout] 299 |     fn map<'a, A, B, F1Once, F1Mut, F1Fn, F1Clone, F1Copy>(
[INFO] [stdout]     |        --- required by a bound in this associated function
[INFO] [stdout] ...
[INFO] [stdout] 310 |         F1Fn: 'a + Fn(A) -> B,
[INFO] [stdout]     |                    ^^^^^^^^^^ required by this bound in `Functor::map`

https://crater-reports.s3.amazonaws.com/beta-1.95-1/beta-2026-03-05/gh/ArsenalAlex108.overengineered_hkt/log.txt

Metadata

Metadata

Assignees

Labels

A-closuresArea: Closures (`|…| { … }`)A-inferenceArea: Type inferenceA-trait-systemArea: Trait systemC-bugCategory: This is a bug.I-prioritizeIssue: Indicates that prioritization has been requested for this issue.S-has-bisectionStatus: A bisection has been found for this issueS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueT-typesRelevant to the types team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions