Skip to content

Commit 194a832

Browse files
Crzyrndmnicholasbishop
authored andcommitted
Add minimal executable to ensure lib is no-std and no-alloc
Test with: cargo build --target x86_64-unknown-none \ --manifest-path ci/ensure_no_std/Cargo.toml Note that currently this test fails, because the lib unconditionally depends on `alloc`. After fixing this, the build will be added to run in CI.
1 parent c214336 commit 194a832

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
/target
2-
Cargo.lock
1+
**/target
2+
**/Cargo.lock

ci/ensure_no_std/Cargo.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[package]
2+
name = "ensure_no_std"
3+
version = "0.0.0"
4+
edition = "2021"
5+
publish = false
6+
7+
[dependencies]
8+
printf-compat = { path = "../..", default-features = false }
9+

ci/ensure_no_std/src/main.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#![no_main]
2+
#![no_std]
3+
4+
use core::panic::PanicInfo;
5+
use printf_compat as _; // ensure it gets linked
6+
7+
#[panic_handler]
8+
fn panic(_panic: &PanicInfo<'_>) -> ! {
9+
loop {}
10+
}

0 commit comments

Comments
 (0)