E1112: standard-library module is not available for the target

View source

Some modules of the standard library need services that only an operating system provides, such as files and processes.

Some modules of the standard library need services that only an operating system provides, such as files and processes. They exist for hosted targets and are not part of the library for a freestanding target. Importing one of them in a project with a freestanding target gives this error, not E1101, because the module exists but this build cannot use it (ADR-0050). The message names the module and the facade that is unavailable.

Example

actus
import std::fs;

verb main() {
}
toml
[package]
name = "example"
version = "0.1.0"
edition = "alpha"
entry = "main"

[build]
target = "x86_64-unknown-none"
profile = "debug"
runtime = "std"

Fix

Build for a hosted target, or use only the modules that the freestanding target provides.

actus
import std::fs;

verb main() {
}
toml
[package]
name = "example"
version = "0.1.0"
edition = "alpha"
entry = "main"

[build]
target = "host"
profile = "debug"
runtime = "std"

Run actus explain E1112 in your terminal to read this entry offline. Browse Modules & rules or all error codes.