Skip to content

Commit

Permalink
Export scalar statics in wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
MaikKlein committed Jan 7, 2020
1 parent 4f074de commit eb4fc2d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/librustc_codegen_ssa/back/symbol_export.rs
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit eb4fc2d

Please sign in to comment.