Skip to content

regression: change in async capture rules? #117059

Closed
@Mark-Simulacrum

Description

@Mark-Simulacrum

https://crater-reports.s3.amazonaws.com/beta-1.74-4/beta-2023-10-21/reg/esl01-dag-0.3.0/log.txt

[INFO] [stdout] error: future cannot be sent between threads safely
[INFO] [stdout]    --> src/nameset/lazy.rs:102:9
[INFO] [stdout]     |
[INFO] [stdout] 102 | /         Box::pin(futures::stream::unfold(self, |mut state| async move {
[INFO] [stdout] 103 | |             let result = state.next().await;
[INFO] [stdout] 104 | |             result.map(|r| (r, state))
[INFO] [stdout] 105 | |         }))
[INFO] [stdout]     | |___________^ future created by async block is not `Send`
[INFO] [stdout]     |
[INFO] [stdout]     = help: the trait `Sync` is not implemented for `(dyn VertexStream<Item = std::result::Result<VertexName, DagError>> + 'static)`
[INFO] [stdout] note: future is not `Send` as this value is used across an await
[INFO] [stdout]    --> src/nameset/lazy.rs:90:72
[INFO] [stdout]     |
[INFO] [stdout] 78  |             match inner.state {
[INFO] [stdout]     |                   ----------- has type `&lazy::Inner` which is not `Send`
[INFO] [stdout] ...
[INFO] [stdout] 90  |                             if let Err(err) = inner.load_more(1, None).await {
[INFO] [stdout]     |                                                                        ^^^^^ await occurs here, with `inner.state` maybe used later
[INFO] [stdout]     = note: required for the cast from `Pin<Box<Unfold<Iter, {[email protected]:102:48}, {async block@src/nameset/lazy.rs:102:60: 105:10}>>>` to `Pin<Box<dyn VertexStream<Item = std::result::Result<VertexName, DagError>>>>`
[INFO] [stdout]     = note: the full name for the source type has been written to '/opt/rustwide/target/debug/deps/dag-bd0c9923e92e6bff.long-type-3400019024982072103.txt'
[INFO] [stdout] 

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleI-types-nominatedNominated for discussion during a types team meeting.P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-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

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions