Skip to content

Unused functions in objects can affect whether self calls compile #324

Closed
@lkuper

Description

@lkuper

https://gist.github.com/654a2ffb1b6a0a50ffb0

Should compile and run as expected -- but commenting out the (unused!) 'wrapper' fn produces:

rust: ../rust/src/test/run-pass/obj-self-4.rs:11:19:11:26: error: mismatched types: expected fn(int) -> but found fn() -> int (incorrect number of function parameters)

11:19:11:26 is the call to 'inc_by' inside 'inc_by_5'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions