File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
src/librustc/middle/trans Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -2453,10 +2453,16 @@ pub fn item_path(ccx: &CrateContext, id: &ast::NodeId) -> path {
24532453}
24542454
24552455fn exported_name ( ccx : @mut CrateContext , path : path , ty : ty:: t , attrs : & [ ast:: Attribute ] ) -> ~str {
2456- if attr:: contains_name ( attrs, "no_mangle" ) {
2457- path_elt_to_str ( * path. last ( ) , token:: get_ident_interner ( ) )
2458- } else {
2459- mangle_exported_name ( ccx, path, ty)
2456+ match attr:: first_attr_value_str_by_name ( attrs, "export_name" ) {
2457+ // Use provided name
2458+ Some ( name) => name. to_owned ( ) ,
2459+
2460+ // Don't mangle
2461+ _ if attr:: contains_name ( attrs, "no_mangle" )
2462+ => path_elt_to_str ( * path. last ( ) , token:: get_ident_interner ( ) ) ,
2463+
2464+ // Usual name mangling
2465+ _ => mangle_exported_name ( ccx, path, ty)
24602466 }
24612467}
24622468
You can’t perform that action at this time.
0 commit comments