auto merge of #7058 : Blei/rust/fix-7048, r=bstrie

This commit is contained in:
bors 2013-06-11 08:01:50 -07:00
commit bf41586a18
3 changed files with 59 additions and 55 deletions

View file

@ -82,17 +82,17 @@ pub fn maybe_find_item(item_id: int, items: ebml::Doc) -> Option<ebml::Doc> {
}
fn find_item(item_id: int, items: ebml::Doc) -> ebml::Doc {
return maybe_find_item(item_id, items).get();
match maybe_find_item(item_id, items) {
None => fail!("lookup_item: id not found: %d", item_id),
Some(d) => d
}
}
// Looks up an item in the given metadata and returns an ebml doc pointing
// to the item data.
fn lookup_item(item_id: int, data: @~[u8]) -> ebml::Doc {
let items = reader::get_doc(reader::Doc(data), tag_items);
match maybe_find_item(item_id, items) {
None => fail!("lookup_item: id not found: %d", item_id),
Some(d) => d
}
find_item(item_id, items)
}
#[deriving(Eq)]

View file

@ -2339,7 +2339,7 @@ pub fn is_instantiable(cx: ctxt, r_ty: t) -> bool {
ty_box(ref mt) |
ty_uniq(ref mt) |
ty_rptr(_, ref mt) => {
return type_requires(cx, seen, r_ty, mt.ty);
type_requires(cx, seen, r_ty, mt.ty)
}
ty_ptr(*) => {
@ -2392,8 +2392,8 @@ pub fn is_instantiable(cx: ctxt, r_ty: t) -> bool {
return r;
}
let seen = @mut ~[];
!subtypes_require(cx, seen, r_ty, r_ty)
let mut seen = ~[];
!subtypes_require(cx, &mut seen, r_ty, r_ty)
}
pub fn type_structurally_contains(cx: ctxt,

View file

@ -772,7 +772,11 @@ fn next_token_inner(rdr: @mut StringReader) -> token::Token {
'/' => { return binop(rdr, token::SLASH); }
'^' => { return binop(rdr, token::CARET); }
'%' => { return binop(rdr, token::PERCENT); }
c => { rdr.fatal(fmt!("unknown start of token: %d", c as int)); }
c => {
// So the error span points to the unrecognized character
rdr.peek_span = codemap::mk_sp(rdr.last_pos, rdr.pos);
rdr.fatal(fmt!("unknown start of token: %d", c as int));
}
}
}