Anonymous user
Porting Rust standard library: Difference between revisions
Jump to navigation
Jump to search
→Runtime
[unchecked revision] | [unchecked revision] |
m (Add Rust category) |
|||
Line 133:
</source>
== Runtime
=== Integrating a crate ===
If you use a crate for the runtime (e.g. <code>myos_rt</code>), you can add it as a dependency to the standard library:
<source lang="ini">
[target.'cfg(target_os = "myos")'.dependencies]
myos_rt = { version = "*", features = ["rustc-dep-of-std"] }
</source>
The <code>rustc-dep-of-std</code> feature is necessary since <code>libcore</code> et al. don't exist yet.
Modify the <code>Cargo.toml</code> of your runtime library to include the feature and propagate it up, e.g.:
<source lang="ini">
[features]
rustc-dep-of-std = [
"core",
"compiler_builtins",
"cfg-if/rustc-dep-of-std"
]
</source>
[[Category:Rust]]
|