Skip to content

Commit

Permalink
std:: in unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-lyons-kehl committed Oct 23, 2023
1 parent 3322664 commit d45a40f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,9 @@ Even if a library itself is `no_std`, its unit tests (ones in modules marked wit
are in a separate crate (auto-generated by `cargo test`). Hence the tests can use `alloc`, and full
`std`, too.

However, you'll need `extern crate std;` in every test "top level" module (a module which has
`[cfg(test)]` in front of its `mod` keyword in its parent (non-test) module).

---

<!-- .slide: id="Builds-and-Integration-Tests" -->
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ <h1>no_std libraries in Rust</h1>
-->
<section
data-markdown="../present_markdown_reveal.js/README-NAVIGATE-SLIDES.md"></section>
<section data-markdown="README.md"></section>
<section data-markdown="README.md" data-separator-notes="^SpeakerNote:"></section>
<section
data-markdown="../present_markdown_reveal.js/README-RELATED-ISSUES-SLIDES.md"></section>
</div>
Expand Down

0 comments on commit d45a40f

Please sign in to comment.