@@ -233,19 +233,34 @@ define_wasm_features! {
233
233
}
234
234
235
235
impl WasmFeatures {
236
+ /// The feature set associated with the MVP release of WebAssembly (its
237
+ /// first release).
238
+ //
239
+ // Note that the features listed here are the wasmparser-specific built-in
240
+ // features such as "floats" and "gc-types". These don't actually correspond
241
+ // to any wasm proposals themselves and instead just gate constructs in
242
+ // wasm. They're listed here so they otherwise don't have to be listed
243
+ // below, but for example wasm with `externref` will be rejected due to lack
244
+ // of `externref` first.
245
+ #[ cfg( feature = "features" ) ]
246
+ pub const MVP : WasmFeatures = WasmFeatures :: FLOATS . union ( WasmFeatures :: GC_TYPES ) ;
247
+
236
248
/// The feature set associated with the 1.0 version of the
237
- /// WebAssembly specification or the "MVP" feature set.
249
+ /// WebAssembly specification circa 2017.
250
+ ///
251
+ /// <https://webassembly.github.io/spec/versions/core/WebAssembly-1.0.pdf>
238
252
#[ cfg( feature = "features" ) ]
239
- pub const WASM1 : WasmFeatures = WasmFeatures :: FLOATS . union ( WasmFeatures :: GC_TYPES ) ;
253
+ pub const WASM1 : WasmFeatures = WasmFeatures :: MVP . union ( WasmFeatures :: MUTABLE_GLOBAL ) ;
240
254
241
255
/// The feature set associated with the 2.0 version of the
242
- /// WebAssembly specification.
256
+ /// WebAssembly specification circa 2022.
257
+ ///
258
+ /// <https://webassembly.github.io/spec/versions/core/WebAssembly-2.0.pdf>
243
259
#[ cfg( feature = "features" ) ]
244
260
pub const WASM2 : WasmFeatures = WasmFeatures :: WASM1
245
261
. union ( WasmFeatures :: BULK_MEMORY )
246
262
. union ( WasmFeatures :: REFERENCE_TYPES )
247
263
. union ( WasmFeatures :: SIGN_EXTENSION )
248
- . union ( WasmFeatures :: MUTABLE_GLOBAL )
249
264
. union ( WasmFeatures :: SATURATING_FLOAT_TO_INT )
250
265
. union ( WasmFeatures :: MULTI_VALUE )
251
266
. union ( WasmFeatures :: SIMD ) ;
@@ -256,6 +271,9 @@ impl WasmFeatures {
256
271
/// Note that as of the time of this writing the 3.0 version of the
257
272
/// specification is not yet published. The precise set of features set
258
273
/// here may change as that continues to evolve.
274
+ ///
275
+ /// (draft)
276
+ /// <https://webassembly.github.io/spec/versions/core/WebAssembly-3.0-draft.pdf>
259
277
#[ cfg( feature = "features" ) ]
260
278
pub const WASM3 : WasmFeatures = WasmFeatures :: WASM2
261
279
. union ( WasmFeatures :: GC )
0 commit comments