Skip to content

Commit eb4fc2d

Browse files
committed
Export scalar statics in wasm
1 parent 4f074de commit eb4fc2d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/librustc_codegen_ssa/back/symbol_export.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,12 @@ fn symbol_export_level(tcx: TyCtxt<'_>, sym_def_id: DefId) -> SymbolExportLevel
349349
if let Some(Node::Item(&hir::Item { kind: hir::ItemKind::Static(..), .. })) =
350350
tcx.hir().get_if_local(sym_def_id)
351351
{
352-
return SymbolExportLevel::Rust;
352+
let export_level = if tcx.type_of(sym_def_id).is_scalar() {
353+
SymbolExportLevel::C
354+
} else {
355+
SymbolExportLevel::Rust
356+
};
357+
return export_level;
353358
}
354359
}
355360

0 commit comments

Comments
 (0)