Move the 'data lifetime parameter to the ModuleEnvironment trait.

This is needed to allow implementations to have 'data-lifetime
references if they choose to. The DummyEnvironment is an example of an
implementation that doesn't choose to.
This commit is contained in:
Dan Gohman
2017-10-11 21:28:36 -07:00
parent d6ab7e3abf
commit bd94a3b202
4 changed files with 26 additions and 26 deletions

View File

@@ -56,9 +56,9 @@ pub fn parse_function_signatures(
}
/// Retrieves the imports from the imports section of the binary.
pub fn parse_import_section(
parser: &mut Parser,
environ: &mut ModuleEnvironment,
pub fn parse_import_section<'data>(
parser: &mut Parser<'data>,
environ: &mut ModuleEnvironment<'data>,
) -> Result<(), SectionParsingError> {
loop {
match *parser.read() {
@@ -128,9 +128,9 @@ pub fn parse_function_section(
}
/// Retrieves the names of the functions from the export section
pub fn parse_export_section(
parser: &mut Parser,
environ: &mut ModuleEnvironment,
pub fn parse_export_section<'data>(
parser: &mut Parser<'data>,
environ: &mut ModuleEnvironment<'data>,
) -> Result<(), SectionParsingError> {
loop {
match *parser.read() {
@@ -246,9 +246,9 @@ pub fn parse_global_section(
Ok(())
}
pub fn parse_data_section(
parser: &mut Parser,
environ: &mut ModuleEnvironment,
pub fn parse_data_section<'data>(
parser: &mut Parser<'data>,
environ: &mut ModuleEnvironment<'data>,
) -> Result<(), SectionParsingError> {
loop {
let memory_index = match *parser.read() {