Change GlobalInit::Import() to GlobalInit::Import.

This commit is contained in:
Dan Gohman
2018-12-06 09:37:34 -05:00
parent 76583192a8
commit 38d1d58e06
2 changed files with 4 additions and 4 deletions

View File

@@ -95,7 +95,7 @@ pub fn parse_import_section<'data>(
Global {
ty: type_to_type(ty.content_type).unwrap(),
mutability: ty.mutable,
initializer: GlobalInit::Import(),
initializer: GlobalInit::Import,
},
module_name,
field_name,
@@ -253,7 +253,7 @@ pub fn parse_element_section<'data>(
.initializer
{
GlobalInit::I32Const(value) => (None, value as u32 as usize),
GlobalInit::Import() => (Some(GlobalIndex::new(global_index as usize)), 0),
GlobalInit::Import => (Some(GlobalIndex::new(global_index as usize)), 0),
_ => panic!("should not happen"),
},
ref s => panic!("unsupported init expr in element section: {:?}", s),
@@ -301,7 +301,7 @@ pub fn parse_data_section<'data>(
.initializer
{
GlobalInit::I32Const(value) => (None, value as u32 as usize),
GlobalInit::Import() => (Some(GlobalIndex::new(global_index as usize)), 0),
GlobalInit::Import => (Some(GlobalIndex::new(global_index as usize)), 0),
_ => panic!("should not happen"),
},
ref s => panic!("unsupported init expr in data section: {:?}", s),

View File

@@ -73,7 +73,7 @@ pub enum GlobalInit {
/// A `get_global` of another global.
GlobalRef(GlobalIndex),
///< The global is imported from, and thus initialized by, a different module.
Import(),
Import,
}
/// WebAssembly table.