Skip to content

EII, support extern_item_impls #5247

Description

@boozook

Please support "lazy linking", rust feature extern_item_impls (or eii).

Currently Miri throws error on try to call "eii-implementation":

error: unsupported operation: can't call foreign function `_RNvCs2.._event_handler13event_handler` on OS `none`
  --> sdk/entry/src/lib.rs:84:4
   |
84 |             self::event_handler(api, event, arg)
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsupported operation occurred here
   |
   = help: this means the program tried to do something Miri does not support; it does not indicate a bug in the program

Steps to reproduce

#![no_std]
#![feature(extern_item_impls)]

#[eii(entry)]
fn foo();

// isolate in mod or another crate:
mod __ {
	#[super::entry]
	fn foo() {}
}


#[cfg(miri)]
#[unsafe(no_mangle)]
fn miri_start(_argc: isize, _argv: *const *const u8) -> isize {
	foo(); // <— unsupported operation occurred here
	0
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-interpreterArea: affects the core interpreterC-enhancementCategory: a PR with an enhancement or an issue tracking an accepted enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions