]> git.lizzy.rs Git - rust.git/commitdiff
librustc: Respect #[link_name] on extern statics. Fixes #9270
authorLuqman Aden <laden@csclub.uwaterloo.ca>
Wed, 18 Sep 2013 01:03:56 +0000 (21:03 -0400)
committerLuqman Aden <laden@csclub.uwaterloo.ca>
Wed, 18 Sep 2013 01:03:56 +0000 (21:03 -0400)
src/librustc/middle/trans/base.rs

index b4979c335b5292535396dc128f1bb1ba83575bf9..f8ecf084a36d6c3a8087f56d8f953abe3d15a86d 100644 (file)
@@ -2641,7 +2641,7 @@ pub fn get_item_val(ccx: @mut CrateContext, id: ast::NodeId) -> ValueRef {
                             foreign::register_foreign_item_fn(ccx, abis, &path, ni)
                         }
                         ast::foreign_item_static(*) => {
-                            let ident = token::ident_to_str(&ni.ident);
+                            let ident = foreign::link_name(ccx, ni);
                             let g = do ident.with_c_str |buf| {
                                 unsafe {
                                     let ty = type_of(ccx, ty);