dtolnay / quote

Rust quasi-quoting
Apache License 2.0
1.32k stars 90 forks source link

Is it possible to use quote in no_std projects? #792 #264

Closed wojciech-cichocki closed 12 months ago

wojciech-cichocki commented 1 year ago

hello! I want to use quote in my contract written in Ink! The problem is that I cannot compile it to WASM due to std usage. This is how I import quote:

quote = { version = "1.0", default-features = false }

I am trying to build a basic flipper example contract using this command: cargo contract build. Unfortunately, I got a lot of these kinds of errors:

error[E0152]: duplicate lang item in crate `core` (which `proc_macro2` depends on): `CStr`.
  |
  = note: the lang item is first defined in crate `core` (which `std` depends on)
  = note: first definition in `core` loaded from /home/wojciech/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/wasm32-unknown-unknown/lib/libcore-4e48b611ead810f8.rlib
  = note: second definition in `core` loaded from /home/wojciech/a0/no_std-ink/target/ink/wasm32-unknown-unknown/release/deps/libcore-5a37b600ddc3bb47.rmeta

Here are a couple of things about using std in Ink!

wojciech-cichocki commented 1 year ago

@dtolnay

wojciech-cichocki commented 12 months ago

fixed it by bumping quote version

quote = { version = "1.0.33", default-features = false }