Skip to content

Commit e83de2f

Browse files
committed
---
yaml --- r: 42370 b: refs/heads/master c: 9123c58 h: refs/heads/master v: v3
1 parent a848c42 commit e83de2f

File tree

5 files changed

+3
-69
lines changed

5 files changed

+3
-69
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 6cdc283415973c259cfbc869f8c7faed5d4f7e2a
2+
refs/heads/master: 9123c585268fb7ae844b6cd98559a76ba080448f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2f46b763da2c098913884f101b6d71d69af41b49
55
refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650

trunk/src/libcore/ptr.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -187,18 +187,7 @@ pub trait Ptr<T> {
187187
pure fn offset(count: uint) -> Self;
188188
}
189189

190-
#[cfg(stage0)]
191-
unsafe fn memmove32(dst: *mut u8, src: *const u8, count: u32) {
192-
libc::memmove(dst as *c_void, src as *c_void, count as size_t);
193-
}
194-
#[cfg(stage0)]
195-
unsafe fn memmove64(dst: *mut u8, src: *const u8, count: u64) {
196-
libc::memmove(dst as *c_void, src as *c_void, count as size_t);
197-
}
198-
199190
#[abi="rust-intrinsic"]
200-
#[cfg(stage1)]
201-
#[cfg(stage2)]
202191
pub extern {
203192
fn memmove32(dst: *mut u8, src: *u8, size: u32);
204193
fn memmove64(dst: *mut u8, src: *u8, size: u64);

trunk/src/librustc/middle/trans/consts.rs

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -434,13 +434,7 @@ pub fn const_expr(cx: @crate_ctxt, e: @ast::expr) -> ValueRef {
434434
let lldiscrim = base::get_discrim_val(cx, e.span,
435435
enum_did,
436436
variant_did);
437-
// However, we still have to pad it out to the
438-
// size of the full enum; see the expr_call case,
439-
// below.
440-
let ety = ty::expr_ty(cx.tcx, e);
441-
let size = machine::static_size_of_enum(cx, ety);
442-
let padding = C_null(T_array(T_i8(), size));
443-
C_struct(~[lldiscrim, padding])
437+
C_struct(~[lldiscrim])
444438
}
445439
Some(ast::def_struct(_)) => {
446440
let ety = ty::expr_ty(cx.tcx, e);
@@ -476,20 +470,7 @@ pub fn const_expr(cx: @crate_ctxt, e: @ast::expr) -> ValueRef {
476470

477471
// FIXME (#1645): enum body alignment is generaly wrong.
478472
if !degen {
479-
// Pad out the data to the size of its type_of;
480-
// this is necessary if the enum is contained
481-
// within an aggregate (tuple, struct, vector) so
482-
// that the next element is at the right offset.
483-
let actual_size =
484-
machine::llsize_of_real(cx, llvm::LLVMTypeOf(c_args));
485-
let padding =
486-
C_null(T_array(T_i8(), size - actual_size));
487-
// A packed_struct has an alignment of 1; thus,
488-
// wrapping one around c_args will misalign it the
489-
// same way we normally misalign enum bodies
490-
// without affecting its internal alignment or
491-
// changing the alignment of the enum.
492-
C_struct(~[discrim, C_packed_struct(~[c_args]), padding])
473+
C_packed_struct(~[discrim, c_args])
493474
} else if size == 0 {
494475
C_struct(~[discrim])
495476
} else {

trunk/src/test/run-pass/const-enum-tuple.rs

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

trunk/src/test/run-pass/const-enum-tuple2.rs

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

0 commit comments

Comments
 (0)