Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make spirv_headers no_std #177

Merged
merged 1 commit into from
Dec 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion autogen/src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ fn gen_value_enum_operand_kind(grammar: &structs::OperandKind) -> TokenStream {

#from_prim_impl

impl std::str::FromStr for #kind {
impl core::str::FromStr for #kind {
type Err = ();

fn from_str(s: &str) -> Result<Self, Self::Err> {
Expand Down
2 changes: 1 addition & 1 deletion spirv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ path = "lib.rs"

[dependencies]
bitflags = "1"
num-traits = "0.2"
num-traits = { version = "0.2", default-features = false }
serde = {version = "1", optional = true, features = ["derive"]}
50 changes: 25 additions & 25 deletions spirv/autogen_spirv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl num_traits::FromPrimitive for SourceLanguage {
Self::from_i64(n as i64)
}
}
impl std::str::FromStr for SourceLanguage {
impl core::str::FromStr for SourceLanguage {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
Expand Down Expand Up @@ -152,7 +152,7 @@ impl num_traits::FromPrimitive for ExecutionModel {
Self::from_i64(n as i64)
}
}
impl std::str::FromStr for ExecutionModel {
impl core::str::FromStr for ExecutionModel {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
Expand Down Expand Up @@ -220,7 +220,7 @@ impl num_traits::FromPrimitive for AddressingModel {
Self::from_i64(n as i64)
}
}
impl std::str::FromStr for AddressingModel {
impl core::str::FromStr for AddressingModel {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
Expand Down Expand Up @@ -270,7 +270,7 @@ impl num_traits::FromPrimitive for MemoryModel {
Self::from_i64(n as i64)
}
}
impl std::str::FromStr for MemoryModel {
impl core::str::FromStr for MemoryModel {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
Expand Down Expand Up @@ -484,7 +484,7 @@ impl num_traits::FromPrimitive for ExecutionMode {
Self::from_i64(n as i64)
}
}
impl std::str::FromStr for ExecutionMode {
impl core::str::FromStr for ExecutionMode {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
Expand Down Expand Up @@ -643,7 +643,7 @@ impl num_traits::FromPrimitive for StorageClass {
Self::from_i64(n as i64)
}
}
impl std::str::FromStr for StorageClass {
impl core::str::FromStr for StorageClass {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
Expand Down Expand Up @@ -728,7 +728,7 @@ impl num_traits::FromPrimitive for Dim {
Self::from_i64(n as i64)
}
}
impl std::str::FromStr for Dim {
impl core::str::FromStr for Dim {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
Expand Down Expand Up @@ -783,7 +783,7 @@ impl num_traits::FromPrimitive for SamplerAddressingMode {
Self::from_i64(n as i64)
}
}
impl std::str::FromStr for SamplerAddressingMode {
impl core::str::FromStr for SamplerAddressingMode {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
Expand Down Expand Up @@ -826,7 +826,7 @@ impl num_traits::FromPrimitive for SamplerFilterMode {
Self::from_i64(n as i64)
}
}
impl std::str::FromStr for SamplerFilterMode {
impl core::str::FromStr for SamplerFilterMode {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
Expand Down Expand Up @@ -981,7 +981,7 @@ impl num_traits::FromPrimitive for ImageFormat {
Self::from_i64(n as i64)
}
}
impl std::str::FromStr for ImageFormat {
impl core::str::FromStr for ImageFormat {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
Expand Down Expand Up @@ -1114,7 +1114,7 @@ impl num_traits::FromPrimitive for ImageChannelOrder {
Self::from_i64(n as i64)
}
}
impl std::str::FromStr for ImageChannelOrder {
impl core::str::FromStr for ImageChannelOrder {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
Expand Down Expand Up @@ -1218,7 +1218,7 @@ impl num_traits::FromPrimitive for ImageChannelDataType {
Self::from_i64(n as i64)
}
}
impl std::str::FromStr for ImageChannelDataType {
impl core::str::FromStr for ImageChannelDataType {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
Expand Down Expand Up @@ -1280,7 +1280,7 @@ impl num_traits::FromPrimitive for FPRoundingMode {
Self::from_i64(n as i64)
}
}
impl std::str::FromStr for FPRoundingMode {
impl core::str::FromStr for FPRoundingMode {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
Expand Down Expand Up @@ -1322,7 +1322,7 @@ impl num_traits::FromPrimitive for LinkageType {
Self::from_i64(n as i64)
}
}
impl std::str::FromStr for LinkageType {
impl core::str::FromStr for LinkageType {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
Expand Down Expand Up @@ -1366,7 +1366,7 @@ impl num_traits::FromPrimitive for AccessQualifier {
Self::from_i64(n as i64)
}
}
impl std::str::FromStr for AccessQualifier {
impl core::str::FromStr for AccessQualifier {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
Expand Down Expand Up @@ -1426,7 +1426,7 @@ impl num_traits::FromPrimitive for FunctionParameterAttribute {
Self::from_i64(n as i64)
}
}
impl std::str::FromStr for FunctionParameterAttribute {
impl core::str::FromStr for FunctionParameterAttribute {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
Expand Down Expand Up @@ -1663,7 +1663,7 @@ impl num_traits::FromPrimitive for Decoration {
Self::from_i64(n as i64)
}
}
impl std::str::FromStr for Decoration {
impl core::str::FromStr for Decoration {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
Expand Down Expand Up @@ -2100,7 +2100,7 @@ impl num_traits::FromPrimitive for BuiltIn {
Self::from_i64(n as i64)
}
}
impl std::str::FromStr for BuiltIn {
impl core::str::FromStr for BuiltIn {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
Expand Down Expand Up @@ -2272,7 +2272,7 @@ impl num_traits::FromPrimitive for Scope {
Self::from_i64(n as i64)
}
}
impl std::str::FromStr for Scope {
impl core::str::FromStr for Scope {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
Expand Down Expand Up @@ -2340,7 +2340,7 @@ impl num_traits::FromPrimitive for GroupOperation {
Self::from_i64(n as i64)
}
}
impl std::str::FromStr for GroupOperation {
impl core::str::FromStr for GroupOperation {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
Expand Down Expand Up @@ -2389,7 +2389,7 @@ impl num_traits::FromPrimitive for KernelEnqueueFlags {
Self::from_i64(n as i64)
}
}
impl std::str::FromStr for KernelEnqueueFlags {
impl core::str::FromStr for KernelEnqueueFlags {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
Expand Down Expand Up @@ -2895,7 +2895,7 @@ impl num_traits::FromPrimitive for Capability {
Self::from_i64(n as i64)
}
}
impl std::str::FromStr for Capability {
impl core::str::FromStr for Capability {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
Expand Down Expand Up @@ -3140,7 +3140,7 @@ impl num_traits::FromPrimitive for RayQueryIntersection {
Self::from_i64(n as i64)
}
}
impl std::str::FromStr for RayQueryIntersection {
impl core::str::FromStr for RayQueryIntersection {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
Expand Down Expand Up @@ -3186,7 +3186,7 @@ impl num_traits::FromPrimitive for RayQueryCommittedIntersectionType {
Self::from_i64(n as i64)
}
}
impl std::str::FromStr for RayQueryCommittedIntersectionType {
impl core::str::FromStr for RayQueryCommittedIntersectionType {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
Expand Down Expand Up @@ -3236,7 +3236,7 @@ impl num_traits::FromPrimitive for RayQueryCandidateIntersectionType {
Self::from_i64(n as i64)
}
}
impl std::str::FromStr for RayQueryCandidateIntersectionType {
impl core::str::FromStr for RayQueryCandidateIntersectionType {
type Err = ();
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
Expand Down
1 change: 1 addition & 0 deletions spirv/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//!
//! The version of this crate is the version of SPIR-V it contains.

#![no_std]
#![allow(non_camel_case_types)]
#![cfg_attr(rustfmt, rustfmt_skip)]

Expand Down