librustc: Fix botched merge. rs=merge

This commit is contained in:
Patrick Walton 2013-04-19 15:57:31 -07:00
parent f93b3cd5c3
commit dcea717208
3 changed files with 19 additions and 6 deletions

View File

@ -1976,6 +1976,7 @@ pub trait ImmutableVector<'self, T> {
fn alli(&self, f: &fn(uint, t: &T) -> bool) -> bool;
fn flat_map<U>(&self, f: &fn(t: &T) -> ~[U]) -> ~[U];
fn filter_mapped<U:Copy>(&self, f: &fn(t: &T) -> Option<U>) -> ~[U];
unsafe fn unsafe_ref(&self, index: uint) -> *T;
}
/// Extension methods for vectors
@ -2097,6 +2098,14 @@ impl<'self,T> ImmutableVector<'self, T> for &'self [T] {
fn filter_mapped<U:Copy>(&self, f: &fn(t: &T) -> Option<U>) -> ~[U] {
filter_mapped(*self, f)
}
/// Returns a pointer to the element at the given index, without doing
/// bounds checking.
#[inline(always)]
unsafe fn unsafe_ref(&self, index: uint) -> *T {
let (ptr, _): (*T, uint) = transmute(*self);
ptr.offset(index)
}
}
pub trait ImmutableEqVector<T:Eq> {

View File

@ -288,11 +288,15 @@ pub impl Reflector {
let arg = unsafe {
llvm::LLVMGetParam(llfdecl, first_real_arg as c_uint)
};
let fcx = new_fn_ctxt(ccx, ~[], llfdecl, None);
let fcx = new_fn_ctxt(ccx,
~[],
llfdecl,
ty::mk_uint(ccx.tcx),
None);
let bcx = top_scope_block(fcx, None);
let arg = BitCast(bcx, arg, llptrty);
let ret = adt::trans_get_discr(bcx, repr, arg);
Store(bcx, ret, fcx.llretptr);
Store(bcx, ret, fcx.llretptr.get());
cleanup_and_Br(bcx, bcx, fcx.llreturn);
finish_fn(fcx, bcx.llbb);
llfdecl

View File

@ -376,10 +376,10 @@ pub struct ident_interner {
pub impl ident_interner {
fn intern(&self, val: @~str) -> ast::ident {
ast::ident { repr: self.interner.intern(val), ctxt: 0}
ast::ident { repr: self.interner.intern(val), ctxt: 0 }
}
fn gensym(&self, val: @~str) -> ast::ident {
ast::ident { repr: self.interner.gensym(val), ctxt: 0}
ast::ident { repr: self.interner.gensym(val), ctxt: 0 }
}
fn get(&self, idx: ast::ident) -> @~str {
self.interner.get(idx.repr)
@ -388,9 +388,9 @@ pub impl ident_interner {
self.interner.len()
}
fn find_equiv<Q:Hash + IterBytes + Equiv<@~str>>(&self, val: &Q)
-> Option<ast::ident> {
-> Option<ast::ident> {
match self.interner.find_equiv(val) {
Some(v) => Some(ast::ident { repr: v }),
Some(v) => Some(ast::ident { repr: v, ctxt: 0 }),
None => None,
}
}