Skip to content

Commit a30d64d

Browse files
committed
---
yaml --- r: 59055 b: refs/heads/incoming c: 7d4bb90 h: refs/heads/master i: 59053: a3650b5 59051: fa1c07a 59047: 499af1e 59039: 0539200 v: v3
1 parent 4cdf9d0 commit a30d64d

File tree

5 files changed

+22
-47
lines changed

5 files changed

+22
-47
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c50a9d5b664478e533ba1d1d353213d70c8ad589
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/incoming: d546493096f35e68cbcd9b5d3d7654e7a9345744
9+
refs/heads/incoming: 7d4bb90e76207f3715126562fd50193fda97ff49
1010
refs/heads/dist-snap: 00dbbd01c2aee72982b3e0f9511ae1d4428c3ba9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/libcore/unstable/intrinsics.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,12 @@ pub extern "rust-intrinsic" {
4242

4343
pub fn get_tydesc<T>() -> *();
4444

45-
/// init is unsafe because it returns a zeroed-out datum,
46-
/// which is unsafe unless T is POD. We don't have a POD
47-
/// kind yet. (See #4074)
48-
pub unsafe fn init<T>() -> T;
45+
pub fn init<T>() -> T;
4946

5047
#[cfg(not(stage0))]
5148
pub unsafe fn uninit<T>() -> T;
5249

53-
/// forget is unsafe because the caller is responsible for
54-
/// ensuring the argument is deallocated already
55-
pub unsafe fn forget<T>(_: T) -> ();
50+
pub fn forget<T>(_: T) -> ();
5651

5752
pub fn needs_drop<T>() -> bool;
5853

branches/incoming/src/librustc/middle/resolve.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1909,7 +1909,6 @@ pub impl Resolver {
19091909
}
19101910

19111911
if self.unresolved_imports == prev_unresolved_imports {
1912-
self.session.err(~"failed to resolve imports");
19131912
self.report_unresolved_imports(module_root);
19141913
break;
19151914
}

branches/incoming/src/librustc/middle/trans/expr.rs

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -968,10 +968,7 @@ fn trans_lvalue_unadjusted(bcx: block, expr: @ast::expr) -> DatumBlock {
968968
}
969969

970970
fn get_val(bcx: block, did: ast::def_id, const_ty: ty::t)
971-
-> ValueRef {
972-
// For external constants, we don't inline.
973-
let extern_const_values =
974-
&mut *bcx.ccx().extern_const_values;
971+
-> ValueRef {
975972
if did.crate == ast::local_crate {
976973
// The LLVM global has the type of its initializer,
977974
// which may not be equal to the enum's type for
@@ -980,24 +977,25 @@ fn trans_lvalue_unadjusted(bcx: block, expr: @ast::expr) -> DatumBlock {
980977
base::get_item_val(bcx.ccx(), did.node),
981978
T_ptr(type_of(bcx.ccx(), const_ty)))
982979
} else {
983-
match extern_const_values.find(&did) {
984-
None => {} // Continue.
985-
Some(llval) => {
986-
return *llval;
980+
// For external constants, we don't inline.
981+
match bcx.ccx().extern_const_values.find(&did) {
982+
None => {
983+
unsafe {
984+
let llty = type_of(bcx.ccx(), const_ty);
985+
let symbol = csearch::get_symbol(
986+
bcx.ccx().sess.cstore,
987+
did);
988+
let llval = llvm::LLVMAddGlobal(
989+
bcx.ccx().llmod,
990+
llty,
991+
transmute::<&u8,*i8>(&symbol[0]));
992+
bcx.ccx().extern_const_values.insert(
993+
did,
994+
llval);
995+
llval
996+
}
987997
}
988-
}
989-
990-
unsafe {
991-
let llty = type_of(bcx.ccx(), const_ty);
992-
let symbol = csearch::get_symbol(
993-
bcx.ccx().sess.cstore,
994-
did);
995-
let llval = llvm::LLVMAddGlobal(
996-
bcx.ccx().llmod,
997-
llty,
998-
transmute::<&u8,*i8>(&symbol[0]));
999-
extern_const_values.insert(did, llval);
1000-
llval
998+
Some(llval) => *llval
1001999
}
10021000
}
10031001
}

branches/incoming/src/test/compile-fail/forget-init-unsafe.rs

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)