We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c4cd30 commit e823940Copy full SHA for e823940
src/librustc/middle/trans/base.rs
@@ -2453,7 +2453,12 @@ pub fn get_item_val(ccx: @mut CrateContext, id: ast::node_id) -> ValueRef {
2453
let v = match i.node {
2454
ast::item_static(_, m, expr) => {
2455
let typ = ty::node_id_to_type(ccx.tcx, i.id);
2456
- let s = mangle_exported_name(ccx, my_path, typ);
+ let s =
2457
+ if attr::contains_name(i.attrs, "no_mangle") {
2458
+ path_elt_to_str(*my_path.last(), token::get_ident_interner())
2459
+ } else {
2460
+ mangle_exported_name(ccx, my_path, typ)
2461
+ };
2462
// We need the translated value here, because for enums the
2463
// LLVM type is not fully determined by the Rust type.
2464
let v = consts::const_expr(ccx, expr);
0 commit comments