librustc: Fix merge fallout.

This commit is contained in:
Patrick Walton 2013-06-14 19:40:11 -07:00 committed by Corey Richardson
parent 03ab6351cc
commit 89eb995195
12 changed files with 34 additions and 37 deletions

View File

@ -1155,7 +1155,7 @@ fn encode_info_for_items(ecx: &EncodeContext,
ast_map::path_to_str(
*pt,
token::get_ident_interner()),
*token::ident_to_str(&ni.ident));
token::ident_to_str(&ni.ident));
let mut ebml_w = copy ebml_w;
// See above

View File

@ -109,7 +109,7 @@ impl ReachableContext {
let reachable_symbols = self.reachable_symbols;
let worklist = self.worklist;
let visitor = visit::mk_vt(@Visitor {
visit_item: |item, _, visitor| {
visit_item: |item, (_, visitor)| {
match item.node {
item_fn(*) => {
reachable_symbols.insert(item.id);
@ -184,13 +184,13 @@ impl ReachableContext {
}
if item.vis == public {
visit::visit_item(item, (), visitor)
visit::visit_item(item, ((), visitor))
}
},
.. *visit::default_visitor()
});
visit::visit_crate(crate, (), visitor)
visit::visit_crate(crate, ((), visitor))
}
// Returns true if the given def ID represents a local item that is
@ -256,7 +256,7 @@ impl ReachableContext {
let (worklist, method_map) = (self.worklist, self.method_map);
let (tcx, reachable_symbols) = (self.tcx, self.reachable_symbols);
visit::mk_vt(@visit::Visitor {
visit_expr: |expr, _, visitor| {
visit_expr: |expr, (_, visitor)| {
match expr.node {
expr_path(_) => {
let def = match tcx.def_map.find(&expr.id) {
@ -300,7 +300,7 @@ impl ReachableContext {
_ => {}
}
visit::visit_expr(expr, (), visitor)
visit::visit_expr(expr, ((), visitor))
},
..*visit::default_visitor()
})
@ -325,7 +325,7 @@ impl ReachableContext {
Some(&ast_map::node_item(item, _)) => {
match item.node {
item_fn(_, _, _, _, ref search_block) => {
visit::visit_block(search_block, (), visitor)
visit::visit_block(search_block, ((), visitor))
}
_ => {
self.tcx.sess.span_bug(item.span,
@ -342,12 +342,12 @@ impl ReachableContext {
worklist?!")
}
provided(ref method) => {
visit::visit_block(&method.body, (), visitor)
visit::visit_block(&method.body, ((), visitor))
}
}
}
Some(&ast_map::node_method(ref method, _, _)) => {
visit::visit_block(&method.body, (), visitor)
visit::visit_block(&method.body, ((), visitor))
}
Some(_) => {
let ident_interner = token::get_ident_interner();

View File

@ -1299,7 +1299,7 @@ impl Resolver {
}
item_impl(_, Some(_), ty, ref methods) => {
visit_item(item, parent, visitor);
visit_item(item, (parent, visitor));
}
item_trait(_, _, ref methods) => {
@ -1349,7 +1349,7 @@ impl Resolver {
match ty_m.explicit_self.node {
sty_static => {}
_ => {
method_names.insert(ident);
method_names.insert(ident, ());
}
}
}
@ -2054,7 +2054,7 @@ impl Resolver {
} else {
result.push_str("::")
}
result.push_str(*self.session.str_of(*ident));
result.push_str(self.session.str_of(*ident));
};
return result;
}

View File

@ -98,7 +98,7 @@ pub fn trans_inline_asm(bcx: block, ia: &ast::inline_asm) -> block {
if !ia.clobbers.is_empty() && !clobbers.is_empty() {
clobbers = fmt!("%s,%s", ia.clobbers, clobbers);
} else {
clobbers.push_str(*ia.clobbers);
clobbers.push_str(ia.clobbers);
};
// Add the clobbers to our constraints list

View File

@ -2890,7 +2890,7 @@ pub fn trans_crate(sess: session::Session,
emap2: resolve::ExportMap2,
reachable_map: @mut HashSet<ast::node_id>,
maps: astencode::Maps)
-> (ContextRef, ModuleRef, LinkMeta) {
-> (ModuleRef, LinkMeta) {
let mut symbol_hasher = hash::default_state();
let link_meta = link::build_link_meta(sess, crate, output, &mut symbol_hasher);

View File

@ -1046,7 +1046,7 @@ pub fn path_str(sess: session::Session, p: &[path_elt]) -> ~str {
} else {
r.push_str("::")
}
r.push_str(*sess.str_of(s));
r.push_str(sess.str_of(s));
}
}
}

View File

@ -799,9 +799,8 @@ impl FnCtxt {
match self.inh.node_types.find(&ex.id) {
Some(&t) => t,
None => {
self.tcx().sess.bug(
fmt!("no type for %s in fcx %s",
self.expr_to_str(ex), self.tag()));
self.tcx().sess.bug(fmt!("no type for expr in fcx %s",
self.tag()));
}
}
}
@ -1141,7 +1140,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
expr: @ast::expr,
expected: Option<ty::t>,
unifier: &fn()) {
debug!(">> typechecking %s", fcx.expr_to_str(expr));
debug!(">> typechecking");
fn check_method_argument_types(
fcx: @mut FnCtxt,
@ -1730,8 +1729,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
ty::mk_closure(tcx, fn_ty_copy)
};
debug!("check_expr_fn_with_unifier %s fty=%s",
fcx.expr_to_str(expr),
debug!("check_expr_fn_with_unifier fty=%s",
fcx.infcx().ty_to_str(fty));
fcx.write_ty(expr.id, fty);

View File

@ -230,7 +230,7 @@ fn constrain_bindings_in_pat(pat: @ast::pat, rcx: @mut Rcx) {
}
fn visit_expr(expr: @ast::expr, (rcx, v): (@mut Rcx, rvt)) {
debug!("regionck::visit_expr(e=%s)", rcx.fcx.expr_to_str(expr));
debug!("regionck::visit_expr(e=?)");
let has_method_map = rcx.fcx.inh.method_map.contains_key(&expr.id);
@ -520,8 +520,7 @@ fn constrain_derefs(rcx: @mut Rcx,
let tcx = rcx.fcx.tcx();
let r_deref_expr = ty::re_scope(deref_expr.id);
for uint::range(0, derefs) |i| {
debug!("constrain_derefs(deref_expr=%s, derefd_ty=%s, derefs=%?/%?",
rcx.fcx.expr_to_str(deref_expr),
debug!("constrain_derefs(deref_expr=?, derefd_ty=%s, derefs=%?/%?",
rcx.fcx.infcx().ty_to_str(derefd_ty),
i, derefs);
@ -576,8 +575,7 @@ fn constrain_index(rcx: @mut Rcx,
let tcx = rcx.fcx.tcx();
debug!("constrain_index(index_expr=%s, indexed_ty=%s",
rcx.fcx.expr_to_str(index_expr),
debug!("constrain_index(index_expr=?, indexed_ty=%s",
rcx.fcx.infcx().ty_to_str(indexed_ty));
let r_index_expr = ty::re_scope(index_expr.id);
@ -808,7 +806,7 @@ pub mod guarantor {
* to the lifetime of its guarantor (if any).
*/
debug!("guarantor::for_addr_of(base=%s)", rcx.fcx.expr_to_str(base));
debug!("guarantor::for_addr_of(base=?)");
let guarantor = guarantor(rcx, base);
link(rcx, expr.span, expr.id, guarantor);
@ -842,8 +840,7 @@ pub mod guarantor {
* region pointers.
*/
debug!("guarantor::for_autoref(expr=%s, autoref=%?)",
rcx.fcx.expr_to_str(expr), autoref);
debug!("guarantor::for_autoref(autoref=%?)", autoref);
let mut expr_ct = categorize_unadjusted(rcx, expr);
debug!(" unadjusted cat=%?", expr_ct.cat);
@ -970,7 +967,7 @@ pub mod guarantor {
* `&expr`).
*/
debug!("guarantor(expr=%s)", rcx.fcx.expr_to_str(expr));
debug!("guarantor()");
match expr.node {
ast::expr_unary(_, ast::deref, b) => {
let cat = categorize(rcx, b);
@ -1034,7 +1031,7 @@ pub mod guarantor {
}
fn categorize(rcx: @mut Rcx, expr: @ast::expr) -> ExprCategorization {
debug!("categorize(expr=%s)", rcx.fcx.expr_to_str(expr));
debug!("categorize()");
let mut expr_ct = categorize_unadjusted(rcx, expr);
debug!("before adjustments, cat=%?", expr_ct.cat);
@ -1086,7 +1083,7 @@ pub mod guarantor {
fn categorize_unadjusted(rcx: @mut Rcx,
expr: @ast::expr)
-> ExprCategorizationType {
debug!("categorize_unadjusted(expr=%s)", rcx.fcx.expr_to_str(expr));
debug!("categorize_unadjusted()");
let guarantor = {
if rcx.fcx.inh.method_map.contains_key(&expr.id) {

View File

@ -21,7 +21,7 @@ use cmp::Eq;
use iterator::IteratorUtil;
use libc;
use option::{None, Option, Some};
use str::{Str, StrSlice, StrVector};
use str::{OwnedStr, Str, StrSlice, StrVector};
use str;
use to_str::ToStr;
use ascii::{AsciiCast, AsciiStr};

View File

@ -1427,7 +1427,8 @@ impl<'self> StrSlice<'self> for &'self str {
fn slice_chars(&self, begin: uint, end: uint) -> &'self str {
assert!(begin <= end);
// not sure how to use the iterators for this nicely.
let mut (position, count) = (0, 0);
let mut position = 0;
let mut count = 0;
let l = self.len();
while count < begin && position < l {
position = self.char_range_at(position).next;
@ -1575,7 +1576,8 @@ impl<'self> StrSlice<'self> for &'self str {
* The original string with all occurances of `from` replaced with `to`
*/
pub fn replace(&self, from: &str, to: &str) -> ~str {
let mut (result, last_end) = (~"", 0);
let mut result = ~"";
let mut last_end = 0;
for self.matches_index_iter(from).advance |(start, end)| {
result.push_str(unsafe{raw::slice_bytes(*self, last_end, start)});
result.push_str(to);

View File

@ -98,7 +98,7 @@ impl gen_send for message {
}
body.push_str(fmt!("let message = %s(%s);\n",
name,
vec::append_one(arg_names.map(|x| cx.str_of(*x)), ~"s")
vec::append_one(arg_names.map(|x| cx.str_of(*x)), @"s")
.connect(", ")));
if !try {

View File

@ -378,7 +378,7 @@ impl Parser {
self.fatal(
fmt!(
"expected `%s`, found `%s`",
*self.id_to_str(kw.to_ident()),
self.id_to_str(kw.to_ident()).to_str(),
self.this_token_to_str()
)
);