@@ -7,14 +7,14 @@ pub(crate) mod language_extension;
7
7
8
8
/// A parsed sentinel word indicating the type of directive to be parsed next.
9
9
#[ derive( Clone , Copy , Debug , Hash , Eq , PartialEq ) ]
10
+ #[ cfg_attr( test, derive( strum:: EnumIter ) ) ]
10
11
pub ( crate ) enum DirectiveKind {
11
12
/// A [`crate::diagnostic_filter`].
12
13
Diagnostic ,
13
14
/// An [`enable_extension`].
14
15
Enable ,
15
16
/// A [`language_extension`].
16
17
Requires ,
17
- Unimplemented ( UnimplementedDirectiveKind ) ,
18
18
}
19
19
20
20
impl DirectiveKind {
@@ -31,36 +31,6 @@ impl DirectiveKind {
31
31
_ => return None ,
32
32
} )
33
33
}
34
-
35
- /// Maps this [`DirectiveKind`] into the sentinel word associated with it in WGSL.
36
- pub const fn to_ident ( self ) -> & ' static str {
37
- match self {
38
- Self :: Diagnostic => Self :: DIAGNOSTIC ,
39
- Self :: Enable => Self :: ENABLE ,
40
- Self :: Requires => Self :: REQUIRES ,
41
- Self :: Unimplemented ( kind) => match kind { } ,
42
- }
43
- }
44
-
45
- #[ cfg( test) ]
46
- fn iter ( ) -> impl Iterator < Item = Self > {
47
- use strum:: IntoEnumIterator ;
48
-
49
- [ Self :: Diagnostic , Self :: Enable , Self :: Requires ]
50
- . into_iter ( )
51
- . chain ( UnimplementedDirectiveKind :: iter ( ) . map ( Self :: Unimplemented ) )
52
- }
53
- }
54
-
55
- /// A [`DirectiveKind`] that is not yet implemented. See [`DirectiveKind::Unimplemented`].
56
- #[ derive( Clone , Copy , Debug , Hash , Eq , PartialEq ) ]
57
- #[ cfg_attr( test, derive( strum:: EnumIter ) ) ]
58
- pub ( crate ) enum UnimplementedDirectiveKind { }
59
-
60
- impl UnimplementedDirectiveKind {
61
- pub const fn tracking_issue_num ( self ) -> u16 {
62
- match self { }
63
- }
64
34
}
65
35
66
36
impl crate :: diagnostic_filter:: Severity {
@@ -83,19 +53,7 @@ mod test {
83
53
84
54
use crate :: front:: wgsl:: assert_parse_err;
85
55
86
- use super :: { DirectiveKind , UnimplementedDirectiveKind } ;
87
-
88
- #[ test]
89
- #[ allow( clippy:: never_loop, unreachable_code, unused_variables) ]
90
- fn unimplemented_directives ( ) {
91
- for unsupported_shader in UnimplementedDirectiveKind :: iter ( ) {
92
- let shader;
93
- let expected_msg;
94
- match unsupported_shader { } ;
95
-
96
- assert_parse_err ( shader, expected_msg) ;
97
- }
98
- }
56
+ use super :: DirectiveKind ;
99
57
100
58
#[ test]
101
59
fn directive_after_global_decl ( ) {
@@ -142,7 +100,6 @@ error: expected global declaration, but found a global directive
142
100
143
101
" ;
144
102
}
145
- DirectiveKind :: Unimplemented ( kind) => match kind { } ,
146
103
}
147
104
148
105
let shader = format ! (
0 commit comments