librustc: Fix merge fallout.
This commit is contained in:
parent
278b487cab
commit
99daec602f
|
@ -1528,14 +1528,17 @@ pub struct BytesWriter {
|
|||
impl Writer for BytesWriter {
|
||||
fn write(&self, v: &[u8]) {
|
||||
let v_len = v.len();
|
||||
let bytes_len = vec::uniq_len(&const *self.bytes);
|
||||
|
||||
let count = uint::max(bytes_len, *self.pos + v_len);
|
||||
vec::reserve(&mut *self.bytes, count);
|
||||
let bytes = &mut *self.bytes;
|
||||
let count = uint::max(bytes.len(), *self.pos + v_len);
|
||||
vec::reserve(bytes, count);
|
||||
|
||||
unsafe {
|
||||
vec::raw::set_len(&mut *self.bytes, count);
|
||||
let view = vec::mut_slice(*self.bytes, *self.pos, count);
|
||||
// Silly stage0 borrow check workaround...
|
||||
let casted: &mut ~[u8] = cast::transmute_copy(&bytes);
|
||||
vec::raw::set_len(casted, count);
|
||||
|
||||
let view = vec::mut_slice(*bytes, *self.pos, count);
|
||||
vec::bytes::copy_memory(view, v, v_len);
|
||||
}
|
||||
|
||||
|
|
|
@ -457,7 +457,7 @@ impl TyVisitor for ReprVisitor {
|
|||
let disr = unsafe {
|
||||
get_disr(transmute(*self.ptr))
|
||||
};
|
||||
self.var_stk.push(SearchingFor(disr));
|
||||
var_stk.push(SearchingFor(disr));
|
||||
true
|
||||
}
|
||||
|
||||
|
@ -494,7 +494,7 @@ impl TyVisitor for ReprVisitor {
|
|||
_offset: uint,
|
||||
inner: *TyDesc)
|
||||
-> bool {
|
||||
match self.var_stk[vec::uniq_len(&const self.var_stk) - 1] {
|
||||
match self.var_stk[vec::uniq_len(&const *self.var_stk) - 1] {
|
||||
Matched => {
|
||||
if i != 0 {
|
||||
self.writer.write_str(", ");
|
||||
|
@ -530,7 +530,7 @@ impl TyVisitor for ReprVisitor {
|
|||
_align: uint)
|
||||
-> bool {
|
||||
let var_stk: &mut ~[VariantState] = self.var_stk;
|
||||
match self.var_stk.pop() {
|
||||
match var_stk.pop() {
|
||||
SearchingFor(*) => fail!(~"enum value matched no variant"),
|
||||
_ => true
|
||||
}
|
||||
|
|
|
@ -4718,7 +4718,7 @@ pub impl Resolver {
|
|||
for vec::each(class_def.fields) |field| {
|
||||
match field.node.kind {
|
||||
unnamed_field => {},
|
||||
named_field(ident, _, _) => {
|
||||
named_field(ident, _) => {
|
||||
if str::eq_slice(*this.session.str_of(ident),
|
||||
name) {
|
||||
return true
|
||||
|
|
|
@ -28,6 +28,13 @@ use core::pipes::recv;
|
|||
use core::task;
|
||||
|
||||
#[doc = "The future type"]
|
||||
#[cfg(stage0)]
|
||||
pub struct Future<A> {
|
||||
priv mut state: FutureState<A>,
|
||||
}
|
||||
|
||||
#[doc = "The future type"]
|
||||
#[cfg(not(stage0))]
|
||||
pub struct Future<A> {
|
||||
priv state: FutureState<A>,
|
||||
}
|
||||
|
|
|
@ -902,8 +902,10 @@ impl io::Reader for TcpSocketBuf {
|
|||
// need to read in data from the socket. Note that the internal
|
||||
// buffer is of no use anymore as we read all bytes from it,
|
||||
// so we can throw it away.
|
||||
let data = &*self.data;
|
||||
let read_result = read(&data.sock, 0u);
|
||||
let read_result = {
|
||||
let data = &*self.data;
|
||||
read(&data.sock, 0)
|
||||
};
|
||||
if read_result.is_err() {
|
||||
let err_data = read_result.get_err();
|
||||
|
||||
|
@ -918,8 +920,7 @@ impl io::Reader for TcpSocketBuf {
|
|||
// should show up in a later call to read().
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
self.data.buf = result::unwrap(read_result);
|
||||
self.data.buf_off = 0;
|
||||
}
|
||||
|
@ -935,8 +936,10 @@ impl io::Reader for TcpSocketBuf {
|
|||
return c as int
|
||||
}
|
||||
|
||||
let data = &*self.data;
|
||||
let read_result = read(&data.sock, 0u);
|
||||
let read_result = {
|
||||
let data = &*self.data;
|
||||
read(&data.sock, 0)
|
||||
};
|
||||
if read_result.is_err() {
|
||||
let err_data = read_result.get_err();
|
||||
|
||||
|
@ -948,8 +951,7 @@ impl io::Reader for TcpSocketBuf {
|
|||
err_data.err_name, err_data.err_msg);
|
||||
fail!()
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
self.data.buf = result::unwrap(read_result);
|
||||
self.data.buf_off = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue