@@ -34,7 +34,7 @@ fn populate_atomic_result() {
34
34
// the differences between the test cases.
35
35
fn try_variant (
36
36
variant : Variant ,
37
- ) -> Result < naga :: valid :: ModuleInfo , naga:: WithSpan < naga:: valid:: ValidationError > > {
37
+ ) -> Result < ModuleInfo , naga:: WithSpan < naga:: valid:: ValidationError > > {
38
38
let span = naga:: Span :: default ( ) ;
39
39
let mut module = Module :: default ( ) ;
40
40
let ty_u32 = module. types . insert (
@@ -135,7 +135,7 @@ fn populate_call_result() {
135
135
// the differences between the test cases.
136
136
fn try_variant (
137
137
variant : Variant ,
138
- ) -> Result < naga :: valid :: ModuleInfo , naga:: WithSpan < naga:: valid:: ValidationError > > {
138
+ ) -> Result < ModuleInfo , naga:: WithSpan < naga:: valid:: ValidationError > > {
139
139
let span = naga:: Span :: default ( ) ;
140
140
let mut module = Module :: default ( ) ;
141
141
let ty_u32 = module. types . insert (
@@ -211,9 +211,7 @@ fn emit_workgroup_uniform_load_result() {
211
211
//
212
212
// Looking at uses of the `wg_load` makes it easy to identify the
213
213
// differences between the two variants.
214
- fn variant (
215
- wg_load : bool ,
216
- ) -> Result < naga:: valid:: ModuleInfo , naga:: WithSpan < naga:: valid:: ValidationError > > {
214
+ fn variant ( wg_load : bool ) -> Result < ModuleInfo , naga:: WithSpan < naga:: valid:: ValidationError > > {
217
215
let span = naga:: Span :: default ( ) ;
218
216
let mut module = Module :: default ( ) ;
219
217
let ty_u32 = module. types . insert (
@@ -284,7 +282,7 @@ fn builtin_cross_product_args() {
284
282
fn variant (
285
283
size : VectorSize ,
286
284
arity : usize ,
287
- ) -> Result < naga :: valid :: ModuleInfo , naga:: WithSpan < naga:: valid:: ValidationError > > {
285
+ ) -> Result < ModuleInfo , naga:: WithSpan < naga:: valid:: ValidationError > > {
288
286
let span = naga:: Span :: default ( ) ;
289
287
let mut module = Module :: default ( ) ;
290
288
let ty_vec3f = module. types . insert (
@@ -546,7 +544,7 @@ fn main(input: VertexOutput) {{
546
544
547
545
#[ allow( dead_code) ]
548
546
struct BindingArrayFixture {
549
- module : naga :: Module ,
547
+ module : Module ,
550
548
span : naga:: Span ,
551
549
ty_u32 : naga:: Handle < naga:: Type > ,
552
550
ty_array : naga:: Handle < naga:: Type > ,
@@ -556,7 +554,7 @@ struct BindingArrayFixture {
556
554
557
555
impl BindingArrayFixture {
558
556
fn new ( ) -> Self {
559
- let mut module = naga :: Module :: default ( ) ;
557
+ let mut module = Module :: default ( ) ;
560
558
let span = naga:: Span :: default ( ) ;
561
559
let ty_u32 = module. types . insert (
562
560
naga:: Type {
@@ -694,7 +692,7 @@ error: Function [1] 'main' is invalid
694
692
#[ cfg( feature = "wgsl-in" ) ]
695
693
#[ test]
696
694
fn bad_texture_dimensions_level ( ) {
697
- fn validate ( level : & str ) -> Result < naga :: valid :: ModuleInfo , naga:: valid:: ValidationError > {
695
+ fn validate ( level : & str ) -> Result < ModuleInfo , naga:: valid:: ValidationError > {
698
696
let source = format ! (
699
697
r#"
700
698
@group(0) @binding(0)
@@ -710,9 +708,7 @@ fn bad_texture_dimensions_level() {
710
708
. map_err ( |err| err. into_inner ( ) ) // discard spans
711
709
}
712
710
713
- fn is_bad_level_error (
714
- result : Result < naga:: valid:: ModuleInfo , naga:: valid:: ValidationError > ,
715
- ) -> bool {
711
+ fn is_bad_level_error ( result : Result < ModuleInfo , naga:: valid:: ValidationError > ) -> bool {
716
712
matches ! (
717
713
result,
718
714
Err ( naga:: valid:: ValidationError :: Function {
@@ -739,7 +735,7 @@ fn arity_check() {
739
735
use naga:: Span ;
740
736
let _ = env_logger:: builder ( ) . is_test ( true ) . try_init ( ) ;
741
737
742
- type Result = core:: result:: Result < naga :: valid :: ModuleInfo , naga:: valid:: ValidationError > ;
738
+ type Result = core:: result:: Result < ModuleInfo , naga:: valid:: ValidationError > ;
743
739
744
740
fn validate ( fun : ir:: MathFunction , args : & [ usize ] ) -> Result {
745
741
let nowhere = Span :: default ( ) ;
@@ -924,6 +920,7 @@ fn main() {
924
920
/// Parse and validate the module defined in `source`.
925
921
///
926
922
/// Panics if unsuccessful.
923
+ #[ cfg( feature = "wgsl-in" ) ]
927
924
fn parse_validate ( source : & str ) -> ( Module , ModuleInfo ) {
928
925
let module = naga:: front:: wgsl:: parse_str ( source) . expect ( "module should parse" ) ;
929
926
let info = valid:: Validator :: new ( Default :: default ( ) , valid:: Capabilities :: all ( ) )
@@ -947,6 +944,7 @@ fn parse_validate(source: &str) -> (Module, ModuleInfo) {
947
944
///
948
945
/// The optional `unused_body` can introduce additional objects to the module,
949
946
/// to verify that they are adjusted correctly by compaction.
947
+ #[ cfg( feature = "wgsl-in" ) ]
950
948
fn override_test ( test_case : & str , unused_body : Option < & str > ) {
951
949
use hashbrown:: HashMap ;
952
950
use naga:: back:: pipeline_constants:: PipelineConstantError ;
0 commit comments