Skip to content

Commit 052a174

Browse files
committed
---
yaml --- r: 273579 b: refs/heads/beta c: e8dfaa7 h: refs/heads/master i: 273577: e7e8abd 273575: 4d5d911
1 parent baa4232 commit 052a174

File tree

4 files changed

+18
-15
lines changed

4 files changed

+18
-15
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 5a681162400b913eaa75eb8de5868db587f4fa35
26+
refs/heads/beta: e8dfaa71e6a6d9b415011ca4d59e9ab498584e73
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/librustc_metadata/decoder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ pub fn maybe_get_item_ast<'tcx>(cdata: Cmd, tcx: &TyCtxt<'tcx>, id: DefIndex)
810810
let mut parent_path = item_path(item_doc);
811811
parent_path.pop();
812812
let mut parent_def_path = def_path(cdata, id);
813-
parent_def_path.pop();
813+
parent_def_path.data.pop();
814814
if let Some(ast_doc) = reader::maybe_get_doc(item_doc, tag_ast as usize) {
815815
let ii = decode_inlined_item(cdata,
816816
tcx,
@@ -830,7 +830,7 @@ pub fn maybe_get_item_ast<'tcx>(cdata: Cmd, tcx: &TyCtxt<'tcx>, id: DefIndex)
830830
let mut grandparent_path = parent_path;
831831
grandparent_path.pop();
832832
let mut grandparent_def_path = parent_def_path;
833-
grandparent_def_path.pop();
833+
grandparent_def_path.data.pop();
834834
let parent_doc = cdata.lookup_item(parent_did.index);
835835
if let Some(ast_doc) = reader::maybe_get_doc(parent_doc, tag_ast as usize) {
836836
let ii = decode_inlined_item(cdata,

branches/beta/src/librustc_trans/trans/link_guard.rs

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,11 @@ pub fn get_or_insert_link_guard<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>)
4949
}
5050

5151
let llfty = Type::func(&[], &Type::void(ccx));
52-
let guard_function = declare::define_cfn(ccx,
53-
&guard_name[..],
54-
llfty,
55-
ccx.tcx().mk_nil()).unwrap_or_else(|| {
56-
ccx.sess().bug("Link guard already defined.");
57-
});
52+
if declare::get_defined_value(ccx, &guard_name[..]).is_some() {
53+
ccx.sess().bug(
54+
&format!("Link guard already defined"));
55+
}
56+
let guard_function = declare::declare_cfn(ccx, &guard_name[..], llfty);
5857

5958
attributes::emit_uwtable(guard_function, true);
6059
attributes::unwind(guard_function, false);
@@ -76,10 +75,12 @@ pub fn get_or_insert_link_guard<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>)
7675

7776
let dependency_guard_name = link_guard_name(&crate_name[..], &svh);
7877

79-
let decl = declare::declare_cfn(ccx,
80-
&dependency_guard_name[..],
81-
llfty,
82-
ccx.tcx().mk_nil());
78+
if declare::get_defined_value(ccx, &dependency_guard_name[..]).is_some() {
79+
ccx.sess().bug(
80+
&format!("Link guard already defined for dependency `{}`",
81+
crate_name));
82+
}
83+
let decl = declare::declare_cfn(ccx, &dependency_guard_name[..], llfty);
8384
attributes::unwind(decl, false);
8485

8586
llvm::LLVMPositionBuilderAtEnd(bld, llbb);

branches/beta/src/librustc_trans/trans/symbol_names_test.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ use rustc_front::intravisit::{self, Visitor};
2121
use syntax::ast;
2222
use syntax::attr::AttrMetaMethods;
2323
use trans::common::CrateContext;
24+
use trans::monomorphize::Instance;
2425

2526
const SYMBOL_NAME: &'static str = "rustc_symbol_name";
2627
const ITEM_PATH: &'static str = "rustc_item_path";
@@ -50,8 +51,9 @@ impl<'a, 'tcx> SymbolNamesTest<'a, 'tcx> {
5051
let def_id = self.tcx.map.local_def_id(node_id);
5152
for attr in self.tcx.get_attrs(def_id).iter() {
5253
if attr.check_name(SYMBOL_NAME) {
53-
// for now, just monomorphic names
54-
let name = symbol_names::exported_name(self.ccx, def_id, &[]);
54+
// for now, can only use on monomorphic names
55+
let instance = Instance::mono(self.tcx, def_id);
56+
let name = symbol_names::exported_name(self.ccx, &instance);
5557
self.tcx.sess.span_err(attr.span, &format!("symbol-name({})", name));
5658
} else if attr.check_name(ITEM_PATH) {
5759
let path = self.tcx.item_path_str(def_id);

0 commit comments

Comments
 (0)