Skip to content

Commit 093fb85

Browse files
committedJan 7, 2020
Always export static variables as SymbolExportLevel::C in wasm
1 parent eb4fc2d commit 093fb85

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed
 

‎src/librustc_codegen_ssa/back/symbol_export.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -345,16 +345,11 @@ fn symbol_export_level(tcx: TyCtxt<'_>, sym_def_id: DefId) -> SymbolExportLevel
345345
if is_extern && !std_internal {
346346
let target = &tcx.sess.target.target.llvm_target;
347347
// WebAssembly cannot export data symbols, so reduce their export level
348-
if target.contains("wasm32") || target.contains("emscripten") {
348+
if target.contains("emscripten") {
349349
if let Some(Node::Item(&hir::Item { kind: hir::ItemKind::Static(..), .. })) =
350350
tcx.hir().get_if_local(sym_def_id)
351351
{
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;
352+
return SymbolExportLevel::Rust;
358353
}
359354
}
360355

0 commit comments

Comments
 (0)