Skip to content

Commit

Permalink
Further refine treatment of voidish arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed Jan 16, 2014
1 parent 14b0abf commit 4b52d89
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/librustc/middle/trans/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub fn type_is_immediate(ccx: &CrateContext, ty: ty::t) -> bool {
let tcx = ccx.tcx;
let simple = ty::type_is_scalar(ty) || ty::type_is_boxed(ty) ||
ty::type_is_unique(ty) || ty::type_is_region_ptr(ty) ||
type_is_newtype_immediate(ccx, ty) ||
type_is_newtype_immediate(ccx, ty) || ty::type_is_bot(ty) ||
ty::type_is_simd(tcx, ty);
if simple {
return true;
Expand All @@ -75,7 +75,7 @@ pub fn type_is_immediate(ccx: &CrateContext, ty: ty::t) -> bool {
let llty = sizing_type_of(ccx, ty);
llsize_of_alloc(ccx, llty) <= llsize_of_alloc(ccx, ccx.int_type)
}
_ => false
_ => type_is_voidish(ccx, ty)
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/librustc/middle/trans/tvec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,6 @@ pub fn get_base_and_byte_len(bcx: &Block,

match vstore {
ty::vstore_fixed(n) => {
assert!(!type_is_immediate(bcx.ccx(), vt.vec_ty));
let base = GEPi(bcx, llval, [0u, 0u]);
let len = Mul(bcx, C_uint(ccx, n), vt.llunit_size);
(base, len)
Expand Down Expand Up @@ -596,7 +595,6 @@ pub fn get_base_and_len(bcx: &Block,

match vstore {
ty::vstore_fixed(n) => {
assert!(!type_is_immediate(bcx.ccx(), vt.vec_ty));
let base = GEPi(bcx, llval, [0u, 0u]);
(base, C_uint(ccx, n))
}
Expand Down

4 comments on commit 4b52d89

@bors
Copy link
Contributor

@bors bors commented on 4b52d89 Jan 16, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from pcwalton
at nikomatsakis@4b52d89

@bors
Copy link
Contributor

@bors bors commented on 4b52d89 Jan 16, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging nikomatsakis/rust/issue-3511-rvalue-lifetimes = 4b52d89 into auto

@bors
Copy link
Contributor

@bors bors commented on 4b52d89 Jan 16, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nikomatsakis/rust/issue-3511-rvalue-lifetimes = 4b52d89 merged ok, testing candidate = b7807c7f

@bors
Copy link
Contributor

@bors bors commented on 4b52d89 Jan 16, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.