Skip to content

Miri/CTFE function call checks should only look at layout, not the type #62137

Closed
@RalfJung

Description

@RalfJung

Since #61814 we have a strange condition in the Miri/interpreter code that checks if a function got called with appropriate arguments: !callee_layout.abi.is_uninhabited() got replaced by !self.tcx.is_ty_uninhabited_from_any_module(ty). That's really strange, the layout should contain all the information we need for execution, and module boundaries certainly shouldn't matter for the call ABI. So I don't think this change is right, at least not for Miri. Unfortunately, there is 0 explanation of the "why" in that PR and in the code. It also does fix an ICE.

Is this a case of running the interpreter on untyped code? Or why does looking at the layout not work?

Cc @oli-obk @eddyb @varkor

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)A-miriArea: The miri toolC-bugCategory: This is a bug.T-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