Skip to content

Running rust code outside of the runtime #4457

Closed
@auroranockert

Description

@auroranockert

Passing a Rust "extern fn" to a foreign API that creates its own threads doesn't work right now, the error is as below.

Assertion failed: (task && "Couldn't get the task from TLS!"), function get_task_tls, file /Users/Jens/Code/Git/rust/src/rt/rust_sched_loop.h, line 168.

There should be some annotation that you could add to your "extern fn" that would cause the compiler to emit only non-runtime dependent code and/or warn if you use features that depend on the runtime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions