Skip to content

Convert to no_std#152

Closed
c410-f3r wants to merge 1 commit into
ctz:mainfrom
c410-f3r:main
Closed

Convert to no_std#152
c410-f3r wants to merge 1 commit into
ctz:mainfrom
c410-f3r:main

Conversation

@c410-f3r

@c410-f3r c410-f3r commented Mar 5, 2026

Copy link
Copy Markdown

One of the things that #![no_std] implies is that the prelude is no longer available, thus the std:: prefixes.

};
(@_inner $feature:tt) => {{
#[cfg(feature = "std")]
{ crate::low::x86_64::cpu::test_toggle($feature, std::is_x86_feature_detected!($feature)) }

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curly braces because of stmt_expr_attributes

#[cfg(feature = "std")]
{ crate::low::x86_64::cpu::test_toggle($feature, std::is_x86_feature_detected!($feature)) }
#[cfg(not(feature = "std"))]
{ crate::low::x86_64::cpu::test_toggle("", false) }

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_toggle is still called to avoid it being labeled as dead code


// assorted intrinsic code
assert!(
is_x86_feature_detected!("avx"),

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a misunderstanding

Ok(out)
}

#[allow(dead_code)]

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only called in tests, #[allow(dead_code)] is not necessary

Comment thread graviola/Cargo.toml

[dev-dependencies]
aws-lc-rs = { version = "1.13", default-features = false, features = ["alloc", "prebuilt-nasm", "non-fips"] }
graviola = { features = ["std"], path = "." }

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IFAICT, that is the only way to enable std in tests

Comment thread graviola/src/lib.rs
)]
#![no_std]

extern crate alloc;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alloc usage by default because of RSA

@c410-f3r c410-f3r closed this Mar 8, 2026
@theoparis

Copy link
Copy Markdown

Is there a reason this is closed? I'm also interested in this - are you still able to work on this, or should someone else take this over in a new PR?

@c410-f3r

c410-f3r commented Jun 2, 2026

Copy link
Copy Markdown
Author

Closed due to the lack of feedback. Another example is #110.

Feel free to copy any associated code to open another related PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants