diff --git a/naga/src/front/wgsl/lower/mod.rs b/naga/src/front/wgsl/lower/mod.rs index eb6f919930..149a684fd6 100644 --- a/naga/src/front/wgsl/lower/mod.rs +++ b/naga/src/front/wgsl/lower/mod.rs @@ -343,7 +343,6 @@ pub enum ExpressionContextType<'temp, 'out> { /// [`naga::Function`]: crate::Function /// [`Constant`]: ExpressionContextType::Constant /// [`naga::Module`]: crate::Module -/// [`as_const`]: ExpressionContext::as_const /// [`Expression::Constant`]: crate::Expression::Constant pub struct ExpressionContext<'source, 'temp, 'out> { // WGSL AST values. @@ -372,18 +371,6 @@ pub struct ExpressionContext<'source, 'temp, 'out> { } impl<'source, 'temp, 'out> ExpressionContext<'source, 'temp, 'out> { - fn as_const(&mut self) -> ExpressionContext<'source, '_, '_> { - ExpressionContext { - globals: self.globals, - types: self.types, - ast_expressions: self.ast_expressions, - const_typifier: self.const_typifier, - module: self.module, - expr_type: ExpressionContextType::Constant(None), - global_expression_kind_tracker: self.global_expression_kind_tracker, - } - } - fn as_global(&mut self) -> GlobalContext<'source, '_, '_> { GlobalContext { ast_expressions: self.ast_expressions, @@ -2903,7 +2890,7 @@ impl<'source, 'temp> Lowerer<'source, 'temp> { let offset = args .next() - .map(|arg| self.expression(arg, &mut ctx.as_const())) + .map(|arg| self.expression(arg, &mut ctx.as_global().as_const())) .ok() .transpose()?;