docs(naga): use hyphenated "enable-extension" noun like spec.

This commit is contained in:
Erich Gubler 2024-10-22 17:01:23 -04:00
parent 64884d1eba
commit fc0a488246
2 changed files with 9 additions and 9 deletions

View File

@ -946,13 +946,13 @@ impl<'a> Error<'a> {
}, },
Error::EnableExtensionNotYetImplemented { kind, span } => ParseError { Error::EnableExtensionNotYetImplemented { kind, span } => ParseError {
message: format!( message: format!(
"the `{}` enable extension is not yet supported", "the `{}` enable-extension is not yet supported",
EnableExtension::Unimplemented(kind).to_ident() EnableExtension::Unimplemented(kind).to_ident()
), ),
labels: vec![( labels: vec![(
span, span,
concat!( concat!(
"this extension specifies standard functionality ", "this enable-extension specifies standard functionality ",
"which is not yet implemented in Naga" "which is not yet implemented in Naga"
) )
.into(), .into(),
@ -967,12 +967,12 @@ impl<'a> Error<'a> {
)], )],
}, },
Error::EnableExtensionNotEnabled { kind, span } => ParseError { Error::EnableExtensionNotEnabled { kind, span } => ParseError {
message: format!("`{}` enable extension is not enabled", kind.to_ident()), message: format!("`{}` enable-extension is not enabled", kind.to_ident()),
labels: vec![( labels: vec![(
span, span,
format!( format!(
concat!( concat!(
"the `{}` enable extension is needed for this functionality, ", "the `{}` enable-extension is needed for this functionality, ",
"but it is not currently enabled" "but it is not currently enabled"
), ),
kind.to_ident() kind.to_ident()
@ -982,7 +982,7 @@ impl<'a> Error<'a> {
notes: if let EnableExtension::Unimplemented(kind) = kind { notes: if let EnableExtension::Unimplemented(kind) = kind {
vec![format!( vec![format!(
concat!( concat!(
"This extension is not yet implemented. ", "This enable-extension is not yet implemented. ",
"Let Naga maintainers know that you ran into this at ", "Let Naga maintainers know that you ran into this at ",
"<https://github.com/gfx-rs/wgpu/issues/{}>, ", "<https://github.com/gfx-rs/wgpu/issues/{}>, ",
"so they can prioritize it!" "so they can prioritize it!"

View File

@ -3,7 +3,7 @@
//! The focal point of this module is the [`EnableExtension`] API. //! The focal point of this module is the [`EnableExtension`] API.
use crate::{front::wgsl::error::Error, Span}; use crate::{front::wgsl::error::Error, Span};
/// Tracks the status of every enable extension known to Naga. /// Tracks the status of every enable-extension known to Naga.
#[derive(Clone, Debug, Eq, PartialEq)] #[derive(Clone, Debug, Eq, PartialEq)]
pub struct EnableExtensions {} pub struct EnableExtensions {}
@ -12,14 +12,14 @@ impl EnableExtensions {
Self {} Self {}
} }
/// Add an enable extension to the set requested by a module. /// Add an enable-extension to the set requested by a module.
#[allow(unreachable_code)] #[allow(unreachable_code)]
pub(crate) fn add(&mut self, ext: ImplementedEnableExtension) { pub(crate) fn add(&mut self, ext: ImplementedEnableExtension) {
let _field: &mut bool = match ext {}; let _field: &mut bool = match ext {};
*_field = true; *_field = true;
} }
/// Query whether an enable extension tracked here has been requested. /// Query whether an enable-extension tracked here has been requested.
#[allow(unused)] #[allow(unused)]
pub(crate) const fn contains(&self, ext: ImplementedEnableExtension) -> bool { pub(crate) const fn contains(&self, ext: ImplementedEnableExtension) -> bool {
match ext {} match ext {}
@ -32,7 +32,7 @@ impl Default for EnableExtensions {
} }
} }
/// A shader language extension not guaranteed to be present in all environments. /// An enable-extension not guaranteed to be present in all environments.
/// ///
/// WGSL spec.: <https://www.w3.org/TR/WGSL/#enable-extensions-sec> /// WGSL spec.: <https://www.w3.org/TR/WGSL/#enable-extensions-sec>
#[derive(Clone, Copy, Debug, Hash, Eq, PartialEq)] #[derive(Clone, Copy, Debug, Hash, Eq, PartialEq)]