{"id":15031901,"url":"https://github.com/peter-lyons-kehl/no_std_libs","last_synced_at":"2026-01-28T06:15:59.742Z","repository":{"id":49369343,"uuid":"517380731","full_name":"peter-lyons-kehl/no_std_libs","owner":"peter-lyons-kehl","description":"Presentation: Embedded-friendly, low level, no_std libraries in Rust","archived":false,"fork":false,"pushed_at":"2023-10-23T18:05:28.000Z","size":190,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-20T12:05:25.747Z","etag":null,"topics":["embedded","low-level","low-level-programming","nostd","nostdlib","presentation","presentation-slides","rust","rust-embedded","rust-lang","rust-language","slides"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peter-lyons-kehl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-24T16:43:22.000Z","updated_at":"2024-07-13T11:23:08.000Z","dependencies_parsed_at":"2024-08-15T23:36:07.595Z","dependency_job_id":null,"html_url":"https://github.com/peter-lyons-kehl/no_std_libs","commit_stats":null,"previous_names":["peter-lyons-kehl/no_std_libs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peter-lyons-kehl%2Fno_std_libs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peter-lyons-kehl%2Fno_std_libs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peter-lyons-kehl%2Fno_std_libs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peter-lyons-kehl%2Fno_std_libs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peter-lyons-kehl","download_url":"https://codeload.github.com/peter-lyons-kehl/no_std_libs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243441104,"owners_count":20291413,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["embedded","low-level","low-level-programming","nostd","nostdlib","presentation","presentation-slides","rust","rust-embedded","rust-lang","rust-language","slides"],"created_at":"2024-09-24T20:16:51.952Z","updated_at":"2026-01-28T06:15:59.669Z","avatar_url":"https://github.com/peter-lyons-kehl.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- The following comment hides this section from being shown by\n     https://peter-kehl.github.io/no_std_libs.\n--\u003e\n\u003c!-- .slide: data-visibility=\"hidden\" --\u003e\n# Slides and alternative navigation\n\nIf you are seeing this, consider viewing [presentation slides\n(online)](https://peter-kehl.github.io/no_std_libs) instead. Or see [README-NAVIGATE-SLIDES.md\n(online)](https://github.com/peter-kehl/present_markdown_reveal.js/blob/main/README-NAVIGATE-SLIDES.md)\nfor alternatives.\n\n---\n\n\u003c!-- .slide: id=\"Audience-Purpose-Scope\" --\u003e\n# Audience, Purpose, Scope \u003c!-- .element: class=\"header_only_for_menu\" --\u003e\n\n## Audience and purpose\n\n- general Rust developers moving to low level or `no_std`\n- non-Rust low level developers moving to Rust\n\n## Disambiguation of std\n\nRust has `#![no_std]` declaration, but it doesn't have `#![std]`. Instead, if you don't have\n`#![no_std]` at the top of your crate, availability of `std` library is implied.\n\nHere we use `std` to refer to either\n\n- Rust [`std`](https://doc.rust-lang.org/nightly/std/index.html) library, or\n- crates not declared as `no_std` (that is, crates that can use Rust `std` library).\n\n## Scope \u003e In\n\n- developing [`no_std`](https://docs.rust-embedded.org/book/intro/no-std.html) library `crates`\n   (without [`std`](https://doc.rust-lang.org/nightly/std/) library), _with_ or _without_ heap\n\n---\n\n\u003c!-- .slide: id=\"Scope-Limited\" --\u003e\n## Scope \u003e Limited \u003c!-- .element: class=\"header_only_for_menu\" --\u003e\n\n# Scope \u003e Limited: Cross-platform \u0026 features\n\n- This applies to both `no_std` and `std`.\n- Rust can build for various targets (architectures/environments). But Cargo documentation keeps it\n  [hidden in Cargo book's\n  FAQ](https://doc.rust-lang.org/nightly/cargo/faq.html#does-cargo-handle-multi-platform-packages-or-cross-compilation)\n  how to specify a target:\n  - [`.cargo/config.toml` --\u003e\n      `build.target`](https://doc.rust-lang.org/nightly/cargo/reference/config.html#buildtarget),\n      for example:\n\n      ```rust\n      [build]\n      target = \"aarch64-unknown-none-softfloat\"\n      ```\n\n  - or: [`cargo build\n      --target`](https://doc.rust-lang.org/nightly/cargo/commands/cargo-build.html#compilation-options)\n- Architectures supported by Rust are in [three\n   tiers](https://doc.rust-lang.org/nightly/rustc/target-tier-policy.html). See also the [rustc\n   book](https://doc.rust-lang.org/nightly/rustc) \u003e [Platform\n   Support](https://doc.rust-lang.org/nightly/rustc/platform-support.html). Beware many Tier 2\n   targets wouldn't build a simple (`no_std`) application - not even heapless.\n- The [Cargo book \u003e Platform specific\n   dependencies](https://doc.rust-lang.org/nightly/cargo/reference/specifying-dependencies.html#platform-specific-dependencies)\n- Per-platform build/linking configuration: have\n   [`.cargo/config.toml`](https://doc.rust-lang.org/nightly/cargo/reference/config.html).\n- [features](https://doc.rust-lang.org/nightly/cargo/reference/features.html): Compile\n  time-selectable subsets of library\n  [`crates`](https://doc.rust-lang.org/nightly/cargo/appendix/glossary.html#crate).\n\n---\n\n\u003c!-- .slide: id=\"Scope-Out\" --\u003e\n# Scope \u003e Out\n\n- `no_std` binaries\n- hardware, deployment, embedded debugging\n- low level development in general (techniques, architectures, tools)\n- specifics of [real\n  time](https://doc.rust-lang.org/nightly/embedded-book/interoperability/index.html#interoperability-with-rtoss)\n  applications and use with RTOS (Real Time OS)\n  - Rust _is_ suitable for real time (because of no garbage collection \u0026 compilation)\n  - this applies to both `no_std` and `std`\n- `wasm` (Web Assembly), although [`no_std` crates are usually\n   wasm-friendly](https://rahul-thakoor.github.io/using-no-standard-library-crates-with-webassembly)\n- [ABI](https://doc.rust-lang.org/nightly/reference/abi.html) (Application Binary Interface),\n   especially\n  - [`#[no_mangle]`](https://doc.rust-lang.org/nightly/reference/abi.html#the-no_mangle-attribute)\n  - [type layout](https://doc.rust-lang.org/nightly/reference/type-layout.html) and the\n     [Rustonomicon (Unsafe Rust)](https://doc.rust-lang.org/nightly/nomicon) \u003e [Alternative\n     Representations](https://doc.rust-lang.org/nightly/nomicon/other-reprs.html).\n    - Rustonomicon has parts applicable to safe and/or `std` Rust, too. One of its gems:\n       [Higher-Rank Trait Bounds](https://doc.rust-lang.org/nightly/nomicon/hrtb.html).\n- [`async/await` in no_std](https://ferrous-systems.com/blog/stable-async-on-embedded)\n- particular `no_std`-compatible crates\n\n---\n\n\u003c!-- .slide: id=\"Scope-Out-Unsafe\" --\u003e\n# Scope \u003e Out \u003e Unsafe\n\n- [`unsafe` code](https://doc.rust-lang.org/nightly/book/ch19-01-unsafe-rust.html)\n  - seemingly easier in embedded, because of no threads \u0026 no other applications/processes. But that\n    may lead to hidden bugs that show up only once using the same code in non-embedded later.\n  - FFI (Foreign Function\n     Interface)/[Interoperability](https://doc.rust-lang.org/nightly/embedded-book/interoperability/index.html)\n    - [calling external code from Rust:\n       `extern`](https://doc.rust-lang.org/nightly/book/ch19-01-unsafe-rust.html#using-extern-functions-to-call-external-code)\n    - [calling Rust functions from\n       C](https://dev.to/dandyvica/how-to-call-rust-functions-from-c-on-linux-h37)\n- [Rust](https://doc.rust-lang.org) and [Cargo \u0026\n   dependencies](https://doc.rust-lang.org/nightly/cargo/reference/specifying-dependencies.html) in\n   general\n\n---\n\n\u003c!-- .slide: id=\"Prerequisites\" --\u003e\n# Prerequisites\n\n- no need for low level experience\n- common (and a few uncommon) aspects of general Rust, especially\n  - setting up a project and basics of\n     [cargo](https://doc.rust-lang.org/nightly/book/ch01-03-hello-cargo.html)\n  - [package layout](https://doc.rust-lang.org/nightly/cargo/guide/project-layout.html)\n  - [dependencies](https://doc.rust-lang.org/nightly/cargo/guide/dependencies.html)\n  - [features](https://doc.rust-lang.org/nightly/cargo/reference/features.html)\n  - architecture or feature-based [conditional\n     compilation](https://doc.rust-lang.org/nightly/reference/conditional-compilation.html) with\n     [`#[cfg(...)]`](https://doc.rust-lang.org/nightly/rust-by-example/attribute/cfg.html)\n     attribute.\n- experience with a statically typed and compiled language\n- basics of linking, heap and stack\n- Rust [installation](https://doc.rust-lang.org/nightly/book/ch01-01-installation.html) including\n   [`rustup`](https://rust-lang.github.io/rustup) and\n   [`cargo`](https://doc.rust-lang.org/nightly/cargo) (the recommended way)\n- Linux/Mac OS/Unix file path notation\n\n---\n\n\u003c!-- .slide: id=\"no_std\" --\u003e\n# no_std\n\nA Rust `no_std` crate can work with, or without, heap. Either way, it\n\n- is for low level (without an operating system; or it serves as a part of an OS kernel)\n- starts with a [`#![no_std]`](https://docs.rust-embedded.org/book/intro/no-std.html) line at the\n   top of your [crate](https://doc.rust-lang.org/nightly/cargo/appendix/glossary.html#crate)\n   (`lib.rs` or a top level source file for a binary). See also [Rust glossary \u003e\n   `package`](https://doc.rust-lang.org/nightly/cargo/appendix/glossary.html#package) and [Rust\n   glossary \u003e `target`](https://doc.rust-lang.org/nightly/cargo/appendix/glossary.html#target).\n- if binary, it has no default fatal error\n   ([`panic`](https://doc.rust-lang.org/nightly/book/ch09-01-unrecoverable-errors-with-panic.html#unwinding-the-stack-or-aborting-in-response-to-a-panic))\n  handler; you must either\n  - set it to `abort`, or\n  - use one of existing (embedded-friendly) [`panic_handler`-defining\n    crates](https://doc.rust-lang.org/nightly/embedded-book/start/panicking.html)\n- provide a custom [`panic_handler`](https://doc.rust-lang.org/nightly/nomicon/panic-handler.html)\n- if binary, and it uses heap, provide a [global\n  allocator](https://doc.rust-lang.org/nightly/std/alloc/trait.GlobalAlloc.html)\n- has no access to [`std`](https://doc.rust-lang.org/nightly/std/index.html) library - no module\n   paths starting with `std::`, but\n- has a limited subset of `std` available as\n  [`core`](https://doc.rust-lang.org/nightly/core/index.html) and\n  [`alloc`](https://doc.rust-lang.org/nightly/alloc/index.html). For example:\n  - [`core::option::Option`](https://doc.rust-lang.org/nightly/core/option/enum.Option.html) instead\n    of [`std::option::Option`](https://doc.rust-lang.org/nightly/std/option/enum.Option.html),\n  - [`core::result::Result`](https://doc.rust-lang.org/nightly/core/result/enum.Result.html),\n  - [`core::iter::Iterator`](https://doc.rust-lang.org/nightly/core/iter/trait.Iterator.html),\n  - [`alloc::borrow::Cow`](https://doc.rust-lang.org/nightly/alloc/borrow/enum.Cow.html).\n\n---\n\n\u003c!-- .slide: id=\"no_std-Without-Heap\" --\u003e\n# no_std \u003e Without Heap\n\n- all data is on stack, or static\n- common for microcontrollers\n- no availability of\n  - [`std::boxed::Box`](https://doc.rust-lang.org/nightly/std/boxed/struct.Box.html)\n  - [`std::vec::Vec`](https://doc.rust-lang.org/nightly/std/vec/struct.Vec.html)\n  - [`std::String`](https://doc.rust-lang.org/nightly/std/string/struct.String.html),\n  - [`std::rc::Rc`](https://doc.rust-lang.org/nightly/std/rc/struct.Rc.html),\n  - [`std::sync::Arc`](https://doc.rust-lang.org/nightly/std/sync/struct.Arc.html)...\n\n---\n\n\u003c!-- .slide: id=\"no_std-With-Heap\" --\u003e\n# no_std \u003e With Heap\n\n- only if you have an `allocator`\n  - register\n     [`#[global_allocator]`](https://doc.rust-lang.org/nightly/std/prelude/v1/macro.global_allocator.html)\n  - then use [`alloc`](https://doc.rust-lang.org/nightly/alloc/index.html) library\n  - `alloc` is equivalent to the respective subset of `std`. Actually, `std` [re-exports `alloc` and\n     `core` parts](https://doc.rust-lang.org/nightly/src/std/lib.rs.html).\n  - [`alloc::boxed::Box`](https://doc.rust-lang.org/nightly/alloc/boxed/struct.Box.html),\n     [`alloc::vec::Vec`](https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html),\n     [`vec!`](https://doc.rust-lang.org/nightly/alloc/macro.vec.html) macro (import it with `use\n     alloc::vec;`),\n     [`alloc::collections::VecDeque`](https://doc.rust-lang.org/nightly/alloc/collections/index.html#reexport.VecDeque),\n     [`alloc::string::String`](https://doc.rust-lang.org/nightly/alloc/string/struct.String.html),\n     [`alloc::rc::Rc`](https://doc.rust-lang.org/nightly/alloc/rc/struct.Rc.html),\n     [`alloc::sync::Arc`](https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html)\n  - [`alloc::collections::BTreeSet`](https://doc.rust-lang.org/nightly/alloc/collections/index.html#reexport.BTreeSet),\n     [`alloc::collections::BTreeMap`](https://doc.rust-lang.org/nightly/alloc/collections/index.html#reexport.BTreeMap)\n     if your items/keys implement\n     [`core::comp::Ord`](https://doc.rust-lang.org/nightly/core/cmp/trait.Ord.html).\n\n     Even if our `struct` (or `enum`) instances can't be ordered in human terms, or if the actual\n     order doesn't matter for us, we could define some (predictable) order and use\n     `BTreeSet/BTreeMap` for most types.\n\n---\n\n\u003c!-- .slide: id=\"no_std-Any\" --\u003e\n# no_std \u003e Any\n\nAny `no_std` code (whether heapless or with heap) is limited:\n\n- no\n     [`std::collections::HashSet`](https://doc.rust-lang.org/nightly/std/collections/struct.HashSet.html),\n     nor\n     [`std::collections::HashMap`](https://doc.rust-lang.org/nightly/std/collections/struct.HashMap.html)\n     (since computing hashes needs a source of entropy).\n- no [`std::thread::Thread`](https://doc.rust-lang.org/nightly/std/thread/struct.Thread.html) (and\n  no multi-threading)\n\n---\n\n\u003c!-- .slide: id=\"Embrace-Nightly\" --\u003e\n# Embrace Nightly\n\n- Embrace [`nightly` channel](https://rust-lang.github.io/rustup/concepts/toolchains.html) (version)\n   of Rust. `no_std` development is challenging enough. Help yourself by new, often ergonomical,\n   features of the language \u0026 `core` library API (for example,\n   [`#[bench]`](https://doc.rust-lang.org/nightly/cargo/reference/cargo-targets.html#benchmarks)). A\n   lot of `nightly` API has become part of `beta` and `stable` (and anything new goes through\n   `nightly` and `stable`, anyway). See the [Rust Forge](https://forge.rust-lang.org) schedule.\n\n   Also, embedded devices often have no/restricted connectivity, and no other software running, so\n   `nightly` may be secure enough. Plus, any upgrades replace the whole application, so even if\n   `nightly` API changes, nothing outside of your embedded application changes (if the only change\n   was in the Rust `core` or ABI). You you can go ahead and apply such changes bravely.\n\n   If you need `beta` or `nightly`, specify it per-project in\n   [`rust-toolchain.toml`](https://rust-lang.github.io/rustup/overrides.html#the-toolchain-file) \u003e\n   `[toolchain]`. See also [nightly\n   Rust](https://doc.rust-lang.org/nightly/book/appendix-07-nightly-rust.html),\n   [channels](https://rust-lang.github.io/rustup/concepts/channels.html), [Rustup\n   overrides](https://rust-lang.github.io/rustup/overrides.html) and [Rustup\n   profiles](https://rust-lang.github.io/rustup/concepts/profiles.html).\n\n   Because of that, all Rust links here to Rust\n   [`core`](https://doc.rust-lang.org/nightly/core/index.html)/[`alloc`](https://doc.rust-lang.org/nightly/alloc/index.html)\n   API, the [Rust book](https://doc.rust-lang.org/nightly/book) and the [Cargo\n   book](https://doc.rust-lang.org/nightly/cargo) have a `nightly` prefix. The documentation clearly\n   mentions which parts are `nightly` (or `beta`) only, anyway. If you uwant to access it as `beta`\n   then change the `nightly` prefix to `beta`; or see the `stable` by removing the prefix.\n\n   See also the [Rust RFC book](https://rust-lang.github.io/rfcs).\n\n---\n\n\u003c!-- TODO USE SIMILAR: --\u003e\n\u003c!-- .slide: data-visibility=\"hidden\" --\u003e\n\u003c!-- .slide: id=\"no_std-variations\" --\u003e\n\u003c!-- markdownlint-disable MD033 --\u003e\n\u003cpre class=\"language-rust r-stretch pre_relative_to_code_github_repo_raw\"\u003e\n\u003ccode\ndata-url=\"src/lib.rs\"\ndata-line-start-delimiter=\"#![allow(rustdoc::bare_urls)]\" data-line-end-delimiter=\"pub mod\nindex;\"\u003e\n\u003c/code\u003e\n\u003c/pre\u003e\n\u003c!-- markdownlint-enable MD033    --\u003e\n\n---\n\u003c!-- TODO DOCUMENT AND REMOVE --\u003e\n\u003c!-- .slide: data-visibility=\"hidden\" --\u003e\n\u003c!-- markdownlint-disable MD033 --\u003e\n\u003c!-- https://github.com/peter-kehl/no_std_data/blob/main/00_test_harness/../00_utils/Cargo.toml redirects to https://github.com/peter-kehl/no_std_data/blob/main/00_utils/Cargo.toml. But revealjs-embed-code doesn't support redirects. So we have to normalize the URL ourselves.\n\nhttps://raw.githubusercontent.com/ranging-rs/with_heap/main/Cargo.toml\nhttps://raw.githubusercontent.com/ranging-rs/with_heap/main/src/../Cargo.toml\n--\u003e\n\u003c!--\n    Adding CSS class `code-wrapper` to `\u003cpre\u003e` and classes hljs rust language-rust to \u003ccode\u003e didn't\n    change anything.\n--\u003e\n\u003cpre class=\"language-rust r-stretch\"\u003e\n\u003ccode data-url=\"https://raw.githubusercontent.com/ranging-rs/with_heap/main/src/../Cargo.toml\"\u003e\n\u003c/code\u003e\n\u003c/pre\u003e\n\u003c!-- markdownlint-enable MD033 --\u003e\n\n---\n\n\u003c!-- TODO DOCUMENT AND REMOVE --\u003e\n\u003c!-- .slide: data-visibility=\"hidden\" --\u003e\n\u003c!--\n    \u003ccode\u003e without \u003cpre\u003e shows the source as wrapped text... and it doesn't auto-apply highlighing:\n    \n\u003ccode data-url=\"https://raw.githubusercontent.com/ranging-rs/with_heap/main/src/lib.rs\"\nclass=\"hljs rust language-rust\"\u003e \u003c/code\u003e\n--\u003e\n\n---\n\n\u003c!-- .slide: id=\"Unit-Tests\" --\u003e\n# Unit Tests\n\nEven if a library itself is `no_std`, its unit tests (ones in modules marked with `#[cfg(test)]`)\nare in a separate crate (auto-generated by `cargo test`). Hence the tests can use `alloc`, and full\n`std`, too.\n\nHowever, you'll need `extern crate std;` in every test \"top level\" module (a module which has\n`[cfg(test)]` in front of its `mod` keyword in its parent (non-test) module).\n\n---\n\n\u003c!-- .slide: id=\"Builds-and-Integration-Tests\" --\u003e\n# Builds and Integration Tests\n\n- No simple way to run/debug `no_std` binaries on desktop.\n- Workaround: Separate sets of crates:  `*_build` for verification (on `no_std` targets); `*_test`\n  for testing (on desktop).\n  - `*_ok_std_*`, `*_no_std_bare_*` (heapless) and `*_no_std_heap_*` build with the relevant\n    functionality.\n  - Can't use a [workspace](https://doc.rust-lang.org/nightly/cargo/reference/workspaces.html) for\n     these alternatives (as all crates in a workspace share dependencies with same features).\n  - So, have the above builds in a separate crate each, under a directory like\n     [`test_crates/`](https://github.com/ranging-rs/slicing-rs/tree/main/test_crates).\n  - `*_test` crates re-use (some of) the tests. Those are centralized under `*_any_std_test_*`.\n  - Suggest their folder names to start with a prefix based on/equal to the main crate. That makes\n    navigation easier (in VS Code) when you open/compare... multiple main crates with\n    similar-sounding sets of build \u0026 test crates.\n  - For an example see [`ranging-rs/slicing-rs`](https://github.com/ranging-rs/slicing-rs) \u0026gt;\n     [`test_crates`](https://github.com/ranging-rs/slicing-rs/tree/main/test_crates):\n    - [`slicing_any_std_test`](https://github.com/ranging-rs/slicing-rs/blob/main/test_crates/slicing_any_std_test/Cargo.toml)\n      (tests are not run directly here, but are shared with the following `*_test` crates)\n    - [`slicing_no_std_bare_build`](https://github.com/ranging-rs/slicing-rs/blob/main/test_crates/slicing_no_std_bare_build/Cargo.toml)\n    - [`slicing_no_std_bare_test`](https://github.com/ranging-rs/slicing-rs/blob/main/test_crates/slicing_no_std_bare_test/Cargo.toml)\n    - [`slicing_no_std_heap_build`](https://github.com/ranging-rs/slicing-rs/blob/main/test_crates/slicing_no_std_heap_build/Cargo.toml)\n    - [`slicing_no_std_heap_test`](https://github.com/ranging-rs/slicing-rs/blob/main/test_crates/slicing_no_std_heap_test/Cargo.toml)\n    - [`slicing_ok_std_test`](https://github.com/ranging-rs/slicing-rs/blob/main/test_crates/slicing_ok_std_test/Cargo.toml)\n\n---\n\n\u003c!-- .slide: id=\"Timestamped-Nightly\" --\u003e\n## Timestamped Nightly\n\nSuggest not to specify `channel = \"nightly\"` in `rust-toolchain.toml`. Why?  Occasionally some\ntargets are not available (on `nightly`), unfortunately. To prevent that, look up the [rustup\ncomponents history](https://rust-lang.github.io/rustup-components-history). Then in your\n`rust-toolchain.toml` \u003e `[toolchain]` have (for example) `channel = \"nightly-2022-08-27\"`.\n\nHowever, only numeric Rust versions qualify for the minimum supported Rust version - in your crate's\n`Cargo.toml \u003e [package]` \u003e\n[`rust-version`](https://doc.rust-lang.org/nightly/cargo/reference/manifest.html#the-rust-version-field).\nIf you need `nightly`, you can run `rustc --version`. Then specify its numeric version (excluding\n`-nightly`) in `Cargo.toml \u003e [package] \u003e rust-version`. And put a timestamped `channel =\n\"nightly-YYYY-MM-DD\"` in `rust-toolchain.toml \u003e [toolchain]`.\n\nAs of August 2022, these `no_std` targets seem to build smoothly: `aarch64-unknown-none-softfloat,\naarch64-unknown-none, x86_64-unknown-none, riscv32i-unknown-none-elf, riscv32imac-unknown-none-elf,\nriscv32imc-unknown-none-elf, riscv64gc-unknown-none-elf, riscv64imac-unknown-none-elf`.\n\n---\n\n\u003c!-- .slide: id=\"More-Takeaway-for-std\" --\u003e\n# More \u0026 Takeaway for std \u003c!-- .element: class=\"header_only_for_menu\" --\u003e\n\n# More\n\nSee\n\n- [no_std_data](../no_std_data): Patterns on no_std data handling. Code is mostly done, but slides\n  are work in progress.\n- [rust_incompatible_features](../rust_incompatible_features): When `std`, `no_std_bare` and\n  `no_std_heap` features (and potentially other features, as needed) benefit from being mutually\n  exclusive/incompatible.\n\n# Takeaway for std\n\n- Import `core::` and `alloc::` (instead of `std::`) wherever you can - even in `std` development.\n   That brings awareness about what parts of your library are `no_std`-friendly. `std` [re-exports\n   `core` and `alloc` parts](https://doc.rust-lang.org/nightly/src/std/lib.rs.html), so your library\n   (whether `no_std` or `std`) will automatically work with crates that import the same symbols from\n   `std`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeter-lyons-kehl%2Fno_std_libs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeter-lyons-kehl%2Fno_std_libs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeter-lyons-kehl%2Fno_std_libs/lists"}