Skip to content

Commit

Permalink
auto merge of #8903 : luqmana/rust/en, r=thestinger
Browse files Browse the repository at this point in the history
Fixes #8735.
  • Loading branch information
bors committed Aug 31, 2013
2 parents 04fac7f + ba5f101 commit a60c6a8
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/librustc/middle/trans/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2453,10 +2453,16 @@ pub fn item_path(ccx: &CrateContext, id: &ast::NodeId) -> path {
}

fn exported_name(ccx: @mut CrateContext, path: path, ty: ty::t, attrs: &[ast::Attribute]) -> ~str {
if attr::contains_name(attrs, "no_mangle") {
path_elt_to_str(*path.last(), token::get_ident_interner())
} else {
mangle_exported_name(ccx, path, ty)
match attr::first_attr_value_str_by_name(attrs, "export_name") {
// Use provided name
Some(name) => name.to_owned(),

// Don't mangle
_ if attr::contains_name(attrs, "no_mangle")
=> path_elt_to_str(*path.last(), token::get_ident_interner()),

// Usual name mangling
_ => mangle_exported_name(ccx, path, ty)
}
}

Expand Down

0 comments on commit a60c6a8

Please sign in to comment.