mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-10 14:57:14 +00:00
commit
a60c6a8b18
@ -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 {
|
fn exported_name(ccx: @mut CrateContext, path: path, ty: ty::t, attrs: &[ast::Attribute]) -> ~str {
|
||||||
if attr::contains_name(attrs, "no_mangle") {
|
match attr::first_attr_value_str_by_name(attrs, "export_name") {
|
||||||
path_elt_to_str(*path.last(), token::get_ident_interner())
|
// Use provided name
|
||||||
} else {
|
Some(name) => name.to_owned(),
|
||||||
mangle_exported_name(ccx, path, ty)
|
|
||||||
|
// 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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user