Skip to content

Commit 000db38

Browse files
committed
Rebase fallout
1 parent ea04cdf commit 000db38

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

src/librustc_trans/trans/base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ use middle::astencode;
3939
use middle::cfg;
4040
use middle::lang_items::{LangItem, ExchangeMallocFnLangItem, StartFnLangItem};
4141
use middle::weak_lang_items;
42-
use middle::subst::{Subst, Substs};
42+
use middle::subst::Substs;
4343
use middle::ty::{self, Ty, ClosureTyper, type_is_simd, simd_size};
4444
use session::config::{self, NoDebugInfo};
4545
use session::Session;

src/librustc_trans/trans/closure.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,10 @@ fn trans_fn_once_adapter_shim<'a, 'tcx>(
386386

387387
// Create the by-value helper.
388388
let function_name = link::mangle_internal_name_by_type_and_seq(ccx, llonce_fn_ty, "once_shim");
389-
let lloncefn = decl_internal_rust_fn(ccx, llonce_fn_ty, &function_name);
389+
let lloncefn = declare::define_internal_rust_fn(ccx, &function_name[..], llonce_fn_ty)
390+
.unwrap_or_else(||{
391+
ccx.sess().bug(&format!("symbol `{}` already defined", function_name));
392+
});
390393

391394
let sig = ty::erase_late_bound_regions(tcx, &llonce_bare_fn_ty.sig);
392395
let (block_arena, fcx): (TypedArena<_>, FunctionContext);

src/librustc_trans/trans/consts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub fn const_lit(cx: &CrateContext, e: &ast::Expr, lit: &ast::Lit)
8585
ast::LitBool(b) => C_bool(cx, b),
8686
ast::LitStr(ref s, _) => C_str_slice(cx, (*s).clone()),
8787
ast::LitBinary(ref data) => {
88-
addr_of(cx, C_bytes(cx, &data[..]), "binary", e.id)
88+
addr_of(cx, C_bytes(cx, &data[..]), "binary")
8989
}
9090
}
9191
}

src/librustc_trans/trans/glue.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ use trans::callee;
3030
use trans::cleanup;
3131
use trans::cleanup::CleanupMethods;
3232
use trans::common::*;
33-
use trans::consts;
3433
use trans::datum;
3534
use trans::debuginfo::DebugLoc;
3635
use trans::declare;
@@ -39,8 +38,7 @@ use trans::foreign;
3938
use trans::inline;
4039
use trans::machine::*;
4140
use trans::monomorphize;
42-
use trans::tvec;
43-
use trans::type_of::{type_of, sizing_type_of, align_of};
41+
use trans::type_of::{type_of, type_of_dtor, sizing_type_of, align_of};
4442
use trans::type_::Type;
4543
use util::ppaux;
4644
use util::ppaux::{ty_to_short_str, Repr};
@@ -191,8 +189,9 @@ pub fn get_drop_glue<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, t: Ty<'tcx>) -> Val
191189
};
192190

193191
let fn_nm = mangle_internal_name_by_type_and_seq(ccx, t, "drop");
194-
let llfn = decl_cdecl_fn(ccx, &fn_nm, llfnty, ty::mk_nil(ccx.tcx()));
195-
note_unique_llvm_symbol(ccx, fn_nm.clone());
192+
let llfn = declare::define_cfn(ccx, &fn_nm, llfnty, ty::mk_nil(ccx.tcx())).unwrap_or_else(||{
193+
ccx.sess().bug(&format!("symbol `{}` already defined", fn_nm));
194+
});
196195
ccx.available_drop_glues().borrow_mut().insert(t, fn_nm);
197196

198197
let _s = StatRecorder::new(ccx, format!("drop {}", ty_to_short_str(ccx.tcx(), t)));

src/test/compile-fail/dupe-symbols-4.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010
//
11+
// error-pattern: symbol `fail` is already defined
1112
#![crate_type="rlib"]
1213
#![allow(warnings)]
1314

@@ -27,5 +28,4 @@ impl A for B {
2728
impl A for C {
2829
#[no_mangle]
2930
fn fail(self) {}
30-
//~^ symbol `fail` is already defined
3131
}

0 commit comments

Comments
 (0)