Skip to content

Commit 369122e

Browse files
committed
add #[non_exhaustive] to SpirvBuilder and all dependent structs
1 parent 86fc480 commit 369122e

File tree

1 file changed

+7
-0
lines changed
  • crates/spirv-builder/src

1 file changed

+7
-0
lines changed

crates/spirv-builder/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ const SPIRV_TARGET_PREFIX: &str = "spirv-unknown-";
134134

135135
#[derive(Debug, PartialEq, Eq, Clone, Copy, Default, serde::Deserialize, serde::Serialize)]
136136
#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
137+
#[non_exhaustive]
137138
pub enum MetadataPrintout {
138139
/// Print no cargo metadata.
139140
#[default]
@@ -148,6 +149,7 @@ pub enum MetadataPrintout {
148149

149150
#[derive(Debug, PartialEq, Eq, Clone, Copy, Default, serde::Deserialize, serde::Serialize)]
150151
#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
152+
#[non_exhaustive]
151153
pub enum SpirvMetadata {
152154
/// Strip all names and other debug information from SPIR-V output.
153155
#[default]
@@ -162,6 +164,7 @@ pub enum SpirvMetadata {
162164
/// Strategy used to handle Rust `panic!`s in shaders compiled to SPIR-V.
163165
#[derive(Debug, PartialEq, Eq, Clone, Copy, Default, serde::Deserialize, serde::Serialize)]
164166
#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
167+
#[non_exhaustive]
165168
pub enum ShaderPanicStrategy {
166169
/// Return from shader entry-point with no side-effects **(default)**.
167170
///
@@ -247,6 +250,7 @@ pub enum ShaderPanicStrategy {
247250
/// Copied from `spirv-tools/src/val.rs` struct `ValidatorOptions`, with some fields disabled.
248251
#[derive(Default, Debug, Clone, serde::Deserialize, serde::Serialize)]
249252
#[cfg_attr(feature = "clap", derive(clap::Parser))]
253+
#[non_exhaustive]
250254
pub struct ValidatorOptions {
251255
/// Record whether or not the validator should relax the rules on types for
252256
/// stores to structs. When relaxed, it will allow a type mismatch as long as
@@ -323,6 +327,7 @@ pub struct ValidatorOptions {
323327
/// Copied from `spirv-tools/src/opt.rs` struct `Options`, with some fields disabled.
324328
#[derive(Default, Debug, Clone, serde::Deserialize, serde::Serialize)]
325329
#[cfg_attr(feature = "clap", derive(clap::Parser))]
330+
#[non_exhaustive]
326331
pub struct OptimizerOptions {
327332
// /// Records the validator options that should be passed to the validator,
328333
// /// the validator will run with the options before optimizer.
@@ -340,6 +345,7 @@ pub struct OptimizerOptions {
340345
/// Cargo features specification for building the shader crate.
341346
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
342347
#[cfg_attr(feature = "clap", derive(clap::Parser))]
348+
#[non_exhaustive]
343349
pub struct ShaderCrateFeatures {
344350
/// Set --default-features for the target shader crate.
345351
#[cfg_attr(feature = "clap", clap(long = "no-default-features", default_value = "true", action = clap::ArgAction::SetFalse))]
@@ -360,6 +366,7 @@ impl Default for ShaderCrateFeatures {
360366

361367
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
362368
#[cfg_attr(feature = "clap", derive(clap::Parser))]
369+
#[non_exhaustive]
363370
pub struct SpirvBuilder {
364371
#[cfg_attr(feature = "clap", clap(skip))]
365372
pub path_to_crate: Option<PathBuf>,

0 commit comments

Comments
 (0)