From 21cc0ccea10bb9d1b83612d26c8e62d06fe365a1 Mon Sep 17 00:00:00 2001 From: Young-il Choi Date: Sat, 29 Jun 2013 14:07:24 +0900 Subject: [PATCH] librustc: fix #7467 for android --- src/librustc/middle/trans/meth.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/librustc/middle/trans/meth.rs b/src/librustc/middle/trans/meth.rs index fc0c9c06c45..7d6a5b5fef9 100644 --- a/src/librustc/middle/trans/meth.rs +++ b/src/librustc/middle/trans/meth.rs @@ -28,7 +28,7 @@ use middle::trans::type_of::*; use middle::ty; use middle::typeck; use util::common::indenter; -use util::ppaux::{Repr, ty_to_str}; +use util::ppaux::Repr; use middle::trans::type_::Type; @@ -36,7 +36,6 @@ use core::vec; use syntax::ast_map::{path, path_mod, path_name}; use syntax::ast_util; use syntax::{ast, ast_map}; -use syntax::parse::token; /** The main "translation" pass for methods. Generates code @@ -755,10 +754,9 @@ pub fn make_vtable(ccx: &mut CrateContext, components.push(ptr) } - let name = fmt!("%s_vtable_%u", ty_to_str(ccx.tcx, tydesc.ty), token::gensym("vtable")); - let tbl = C_struct(components); - let vt_gvar = do name.as_c_str |buf| { + let vtable = ccx.sess.str_of(gensym_name("vtable")); + let vt_gvar = do vtable.as_c_str |buf| { llvm::LLVMAddGlobal(ccx.llmod, val_ty(tbl).to_ref(), buf) }; llvm::LLVMSetInitializer(vt_gvar, tbl);