Skip to content

Overloaded call inferred to be through Fn when only FnOnce works #38305

Open
@causal-agent

Description

@causal-agent

Repro: https://is.gd/AbO8K4

A wrapper around a closure F implements FnOnce, FnMut and Fn where F does. However, when the wrapper is created with a closure which implements only FnOnce, and then the wrapper is called, the compiler expects the closure to implement FnMut or Fn.

rustc 1.15.0-nightly (daf8c1dfc 2016-12-05)
binary: rustc
commit-hash: daf8c1dfce3b448fc581cc319f64632ec22bd0e1
commit-date: 2016-12-05
host: x86_64-apple-darwin
release: 1.15.0-nightly
LLVM version: 3.9

cc @eddyb (discussed on IRC)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-closuresArea: Closures (`|…| { … }`)C-bugCategory: This is a bug.P-mediumMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions