Export scalar statics in wasm

This commit is contained in:
maik 2020-01-07 15:33:33 +01:00
parent 4f074dea1d
commit eb4fc2d4fe

View file

@ -349,7 +349,12 @@ fn symbol_export_level(tcx: TyCtxt<'_>, sym_def_id: DefId) -> SymbolExportLevel
if let Some(Node::Item(&hir::Item { kind: hir::ItemKind::Static(..), .. })) =
tcx.hir().get_if_local(sym_def_id)
{
return SymbolExportLevel::Rust;
let export_level = if tcx.type_of(sym_def_id).is_scalar() {
SymbolExportLevel::C
} else {
SymbolExportLevel::Rust
};
return export_level;
}
}