-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
magic conversion fails to compile under no_std
#282
Comments
Probably need a pass through |
Unfortunately I have no time to look on it. |
I am happy to make a PR. 🙂 but, can I expect a quick release with it ? 🙏 |
If you provide a PR I'll review and add it ASAP |
Just a note: you have a workaround here: // lib.rs
#![no_std]
pub fn add(left: u64, right: u64) -> u64 {
left + right
}
#[cfg(test)]
mod tests {
use super::*;
use rstest::rstest;
use ::core as std;
#[rstest]
#[case("2", "2", "4")]
fn it_works(#[case] left: u64, #[case] right: u64, #[case] expected: u64) {
assert_eq!(add(left, right), expected);
}
} Or better // lib.rs
#![no_std]
#![cfg(test)]
extern crate std;
pub fn add(left: u64, right: u64) -> u64 {
left + right
}
#[cfg(test)]
mod tests {
use super::*;
use rstest::rstest;
#[rstest]
#[case("2", "2", "4")]
fn it_works(#[case] left: u64, #[case] right: u64, #[case] expected: u64) {
assert_eq!(add(left, right), expected);
}
} |
Even if your crate is a So, we can just just take care that the rendered code use I'll add these notes in the PR also. |
The following tests fails to compile
because this is how it is expanded,
rstest
could have usedcore::marker::PhantomData
.The text was updated successfully, but these errors were encountered: