Skip to content

Commit 0be41ce

Browse files
committed
rustc: Remove old align_of intrinsic
1 parent e85fc9b commit 0be41ce

File tree

4 files changed

+6
-13
lines changed

4 files changed

+6
-13
lines changed

src/libcore/sys.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ native mod rustrt {
2626
native mod rusti {
2727
fn get_tydesc<T>() -> *();
2828
fn size_of<T>() -> uint;
29-
fn align_of<T>() -> uint;
29+
fn pref_align_of<T>() -> uint;
30+
fn min_align_of<T>() -> uint;
3031
}
3132

3233
#[doc = "
@@ -51,15 +52,12 @@ This is the alignment used for struct fields. It may be smaller
5152
than the preferred alignment.
5253
"]
5354
fn min_align_of<T>() -> uint unsafe {
54-
// FIXME: use rusti::min_align_of after snapshot
55-
// rusti::align_of::<T>()
56-
fail "FIXME: uncomment the above line to use min_align_of";
55+
rusti::min_align_of::<T>()
5756
}
5857

5958
#[doc = "Returns the preferred alignment of a type"]
6059
fn pref_align_of<T>() -> uint unsafe {
61-
// FIXME: use rusti::pref_align_of after snapshot
62-
rusti::align_of::<T>()
60+
rusti::pref_align_of::<T>()
6361
}
6462

6563
#[doc = "Returns the refcount of a shared box"]

src/rustc/middle/trans/native.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -764,11 +764,6 @@ fn trans_intrinsic(ccx: @crate_ctxt, decl: ValueRef, item: @ast::native_item,
764764
Store(bcx, C_uint(ccx, shape::llsize_of_real(ccx, lltp_ty)),
765765
fcx.llretptr);
766766
}
767-
// FIXME: Transitional. Please remove me.
768-
"align_of" {
769-
Store(bcx, C_uint(ccx, shape::llalign_of_pref(ccx, lltp_ty)),
770-
fcx.llretptr);
771-
}
772767
"min_align_of" {
773768
Store(bcx, C_uint(ccx, shape::llalign_of_min(ccx, lltp_ty)),
774769
fcx.llretptr);

src/rustc/middle/trans/type_use.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ fn type_uses_for(ccx: @crate_ctxt, fn_id: def_id, n_tps: uint)
7676
ast_map::node_native_item(i@@{node: native_item_fn(_, _), _}, abi, _) {
7777
if abi == native_abi_rust_intrinsic {
7878
let flags = alt check i.ident {
79-
"size_of" | "align_of" |
79+
"size_of" |
8080
"pref_align_of" | "min_align_of" | "init" |
8181
"reinterpret_cast" { use_repr }
8282
"get_tydesc" | "needs_drop" { use_tydesc }

src/rustc/middle/typeck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2007,7 +2007,7 @@ fn check_intrinsic_type(ccx: @crate_ctxt, it: @ast::native_item) {
20072007
}
20082008
let tcx = ccx.tcx;
20092009
let (n_tps, inputs, output) = alt it.ident {
2010-
"size_of" | "align_of" |
2010+
"size_of" |
20112011
"pref_align_of" | "min_align_of" { (1u, [], ty::mk_uint(ccx.tcx)) }
20122012
"get_tydesc" { (1u, [], ty::mk_nil_ptr(tcx)) }
20132013
"init" { (1u, [], param(ccx, 0u)) }

0 commit comments

Comments
 (0)