mirror of
https://github.com/fluencelabs/marine-rs-sdk
synced 2025-03-15 14:30:48 +00:00
fix compilation for rustc 1.57.0-nightly (#60)
This commit is contained in:
parent
6d045429dc
commit
7cad957fe7
@ -18,25 +18,25 @@ use crate::parsed_type::ParsedType;
|
|||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub(crate) struct AstFnArgument {
|
pub(crate) struct AstFnArgument {
|
||||||
pub name: String,
|
pub(crate) name: String,
|
||||||
pub ty: ParsedType,
|
pub(crate) ty: ParsedType,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub(crate) struct AstFnSignature {
|
pub(crate) struct AstFnSignature {
|
||||||
pub visibility: syn::Visibility,
|
pub(crate) visibility: syn::Visibility,
|
||||||
pub name: String,
|
pub(crate) name: String,
|
||||||
pub arguments: Vec<AstFnArgument>,
|
pub(crate) arguments: Vec<AstFnArgument>,
|
||||||
// only one or zero return values are supported now,
|
// only one or zero return values are supported now,
|
||||||
// waiting for adding multi-value support in Wasmer
|
// waiting for adding multi-value support in Wasmer
|
||||||
pub output_type: Option<ParsedType>,
|
pub(crate) output_type: Option<ParsedType>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub(crate) struct AstRecord {
|
pub(crate) struct AstRecord {
|
||||||
pub name: String,
|
pub(crate) name: String,
|
||||||
pub fields: AstRecordFields,
|
pub(crate) fields: AstRecordFields,
|
||||||
pub original: syn::ItemStruct,
|
pub(crate) original: syn::ItemStruct,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
@ -55,29 +55,28 @@ pub(crate) enum AstRecordFields {
|
|||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
pub(crate) struct AstRecordField {
|
pub(crate) struct AstRecordField {
|
||||||
/// Name of the field. Can be `None` for tuples.
|
/// Name of the field. Can be `None` for tuples.
|
||||||
pub name: Option<String>,
|
pub(crate) name: Option<String>,
|
||||||
pub ty: ParsedType,
|
pub(crate) ty: ParsedType,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub(crate) struct AstExternFn {
|
pub(crate) struct AstExternFn {
|
||||||
pub link_name: Option<String>,
|
pub(crate) link_name: Option<String>,
|
||||||
// only imports are possible here
|
// only imports are possible here
|
||||||
pub signature: AstFnSignature,
|
pub(crate) signature: AstFnSignature,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub(crate) struct AstExternMod {
|
pub(crate) struct AstExternMod {
|
||||||
pub namespace: String,
|
pub(crate) namespace: String,
|
||||||
// only imports are possible here
|
// only imports are possible here
|
||||||
pub imports: Vec<AstExternFn>,
|
pub(crate) imports: Vec<AstExternFn>,
|
||||||
pub original: syn::ItemForeignMod,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub(crate) struct AstFn {
|
pub(crate) struct AstFn {
|
||||||
pub signature: AstFnSignature,
|
pub(crate) signature: AstFnSignature,
|
||||||
pub original: syn::ItemFn,
|
pub(crate) original: syn::ItemFn,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
@ -36,11 +36,7 @@ impl ParseMacroInput for syn::ItemForeignMod {
|
|||||||
let imports = extract_import_functions(&self)?;
|
let imports = extract_import_functions(&self)?;
|
||||||
check_imports(imports.iter().zip(self.items.iter().map(|i| i.span())))?;
|
check_imports(imports.iter().zip(self.items.iter().map(|i| i.span())))?;
|
||||||
|
|
||||||
let extern_mod_item = ast_types::AstExternMod {
|
let extern_mod_item = ast_types::AstExternMod { namespace, imports };
|
||||||
namespace,
|
|
||||||
imports,
|
|
||||||
original: self,
|
|
||||||
};
|
|
||||||
Ok(MarineAst::ExternMod(extern_mod_item))
|
Ok(MarineAst::ExternMod(extern_mod_item))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user