mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-05 19:43:24 +00:00
middle: trans: adt: remove dead code
This commit is contained in:
parent
ee82233a1e
commit
a9bf099000
@ -644,25 +644,6 @@ pub fn num_args(r: &Repr, discr: Disr) -> uint {
|
||||
}
|
||||
}
|
||||
|
||||
/// Access a field, at a point when the value's case is known.
|
||||
pub fn deref_ty(ccx: &CrateContext, r: &Repr) -> ty::t {
|
||||
match *r {
|
||||
CEnum(..) => {
|
||||
ccx.sess().bug("deref of c-like enum")
|
||||
}
|
||||
Univariant(ref st, _) => {
|
||||
*st.fields.get(0)
|
||||
}
|
||||
General(_, ref cases) => {
|
||||
assert!(cases.len() == 1);
|
||||
*cases.get(0).fields.get(0)
|
||||
}
|
||||
NullablePointer{ .. } => {
|
||||
ccx.sess().bug("deref of nullable ptr")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Access a field, at a point when the value's case is known.
|
||||
pub fn trans_field_ptr(bcx: &Block, r: &Repr, val: ValueRef, discr: Disr,
|
||||
ix: uint) -> ValueRef {
|
||||
@ -896,11 +877,3 @@ fn const_struct_field(ccx: &CrateContext, val: ValueRef, ix: uint)
|
||||
real_ix = real_ix + 1;
|
||||
}
|
||||
}
|
||||
|
||||
/// Is it safe to bitcast a value to the one field of its one variant?
|
||||
pub fn is_newtypeish(r: &Repr) -> bool {
|
||||
match *r {
|
||||
Univariant(ref st, false) => st.fields.len() == 1,
|
||||
_ => false
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user