Skip to content

no_std build with pest_derive fails #1057

Answered by tomtau
jzbor asked this question in Q&A
Nov 30, 2024 · 2 comments · 10 replies
Discussion options

You must be logged in to vote

@jzbor

  1. I checked out the branch you posted: https://github.com/jzbor/lash/tree/pest
  2. I added extern crate alloc to src/lib.rs
diff --git a/src/lib.rs b/src/lib.rs
index 605d50c..ae0daa5 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,5 +1,5 @@
 #![cfg_attr(not(feature = "std"), no_std)]
-
+extern crate alloc;
 pub mod debruijn;
 pub mod environment;
 pub mod error;
  1. it builds fine:
$ cargo build -j1 -Z build-std=core,alloc --lib --no-default-features
   Compiling lash v0.3.1 (/workspaces/lash)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.22s

Replies: 2 comments 10 replies

Comment options

You must be logged in to vote
7 replies
@jzbor
Comment options

@jzbor
Comment options

@tomtau
Comment options

@jzbor
Comment options

@jzbor
Comment options

Comment options

You must be logged in to vote
3 replies
@tomtau
Comment options

@tomtau
Comment options

Answer selected by jzbor
@jzbor
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants
Converted from issue

This discussion was converted from issue #1056 on December 01, 2024 00:05.