Skip to content

fns using c-stack-cdecl native ABI cannot be called from outside crate #1059

Closed
@nikomatsakis

Description

@nikomatsakis

Calling a native function declared with "c-stack-cdecl" ABI from outside the create fails in LLVM. The type of the function includes the implicit parameters when it should not. The path through the code is: The code path is that when we look up the external identifier we go through trans_external_path() -> type_of_ty_param_kinds_and_ty() -> type_of_fn_from_ty() -> type_of_fn(), and type_of_fn() adds the implicit parameters.

I added a test: src/test/run-pass/invoke-external-native.rs

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