Skip to content

Inference regression in nightly affecting Pin::set and futures #56237

Closed
@withoutboats

Description

@withoutboats

futures-util-preview does not build on the current nightly because the compiler is unable to infer that a type is Sized. This is a regression in the latest nightly.

The line that errors is here.

Error message:

error[E0277]: the size for values of type `<&mut future::maybe_done::MaybeDone<Fut> as std::ops::Deref>::Target` cannot be known at compilation time
   --> futures-util/src/future/maybe_done.rs:110:9
    |
110 |         Pin::set(self, MaybeDone::Done(res));
    |         ^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `<&mut future::maybe_done::MaybeDone<Fut> as std::ops::Deref>::Target`

Relevant commits: edaac35...6acbb5b

cc rust-lang/futures-rs#1350

Metadata

Metadata

Assignees

Labels

P-highHigh priorityT-compilerRelevant to the compiler 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

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions