Debian Codegraph @

crates/wit-parser/tests/ui/feature-gates.wit

raw
1 package a:b;
2
3 @unstable(feature = not-active)
4 interface gated {
5 }
6
7 @unstable(feature = active)
8 interface ungated {
9 @unstable(feature = not-active)
10 gated: func();
11
12 @unstable(feature = active)
13 ungated: func();
14 }
15
16 @unstable(feature = active)
17 interface ungated2 {
18 @unstable(feature = not-active)
19 type gated = u32;
20 @unstable(feature = not-active)
21 type gated2 = gated;
22
23 @unstable(feature = not-active)
24 type gated-with-anonymous-type = option<option<gated>>;
25
26 @unstable(feature = active)
27 type ungated = u32;
28 @unstable(feature = active)
29 type ungated2 = ungated;
30 }
31
32 @unstable(feature = inactive)
33 interface gated-use-target {
34 @unstable(feature = inactive)
35 type t = u32;
36 }
37
38 @unstable(feature = inactive)
39 interface gated-use {
40 @unstable(feature = inactive)
41 use gated-use-target.{t};
42 }
43
44 @unstable(feature = active)
45 interface ungated-use-target {
46 @unstable(feature = active)
47 type t = u32;
48 }
49
50 @unstable(feature = active)
51 interface ungated-use {
52 @unstable(feature = active)
53 use ungated-use-target.{t};
54 }
55
56 @unstable(feature = inactive)
57 interface gated-for-world {}
58
59 @unstable(feature = inactive)
60 world gated-world {
61 @unstable(feature = inactive)
62 import gated-for-world;
63 @unstable(feature = inactive)
64 export gated-for-world;
65 }
66
67 @unstable(feature = active)
68 interface ungated-for-world {}
69
70 @unstable(feature = active)
71 world ungated-world {
72 @unstable(feature = active)
73 import ungated-for-world;
74 @unstable(feature = active)
75 export ungated-for-world;
76 }
77
78 world mixed-world {
79 @unstable(feature = inactive)
80 import gated-for-world;
81 @unstable(feature = inactive)
82 export gated-for-world;
83 @unstable(feature = inactive)
84 include gated-world;
85
86 @unstable(feature = active)
87 import ungated-for-world;
88 @unstable(feature = active)
89 export ungated-for-world;
90 @unstable(feature = inactive)
91 include ungated-world;
92 }
93
94 interface with-resources {
95 @unstable(feature = inactive)
96 resource gated {
97 @unstable(feature = inactive)
98 constructor();
99
100 @unstable(feature = inactive)
101 x: static func();
102
103 @unstable(feature = inactive)
104 y: func();
105 }
106
107 @unstable(feature = active)
108 resource ungated {
109 @unstable(feature = active)
110 constructor();
111
112 @unstable(feature = active)
113 x: static func();
114
115 @unstable(feature = active)
116 y: func();
117 }
118 }