librustc: Fix merge fallout.
This commit is contained in:
parent
03ab6351cc
commit
89eb995195
12 changed files with 34 additions and 37 deletions
|
@ -1155,7 +1155,7 @@ fn encode_info_for_items(ecx: &EncodeContext,
|
||||||
ast_map::path_to_str(
|
ast_map::path_to_str(
|
||||||
*pt,
|
*pt,
|
||||||
token::get_ident_interner()),
|
token::get_ident_interner()),
|
||||||
*token::ident_to_str(&ni.ident));
|
token::ident_to_str(&ni.ident));
|
||||||
|
|
||||||
let mut ebml_w = copy ebml_w;
|
let mut ebml_w = copy ebml_w;
|
||||||
// See above
|
// See above
|
||||||
|
|
|
@ -109,7 +109,7 @@ impl ReachableContext {
|
||||||
let reachable_symbols = self.reachable_symbols;
|
let reachable_symbols = self.reachable_symbols;
|
||||||
let worklist = self.worklist;
|
let worklist = self.worklist;
|
||||||
let visitor = visit::mk_vt(@Visitor {
|
let visitor = visit::mk_vt(@Visitor {
|
||||||
visit_item: |item, _, visitor| {
|
visit_item: |item, (_, visitor)| {
|
||||||
match item.node {
|
match item.node {
|
||||||
item_fn(*) => {
|
item_fn(*) => {
|
||||||
reachable_symbols.insert(item.id);
|
reachable_symbols.insert(item.id);
|
||||||
|
@ -184,13 +184,13 @@ impl ReachableContext {
|
||||||
}
|
}
|
||||||
|
|
||||||
if item.vis == public {
|
if item.vis == public {
|
||||||
visit::visit_item(item, (), visitor)
|
visit::visit_item(item, ((), visitor))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
.. *visit::default_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
|
// 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 (worklist, method_map) = (self.worklist, self.method_map);
|
||||||
let (tcx, reachable_symbols) = (self.tcx, self.reachable_symbols);
|
let (tcx, reachable_symbols) = (self.tcx, self.reachable_symbols);
|
||||||
visit::mk_vt(@visit::Visitor {
|
visit::mk_vt(@visit::Visitor {
|
||||||
visit_expr: |expr, _, visitor| {
|
visit_expr: |expr, (_, visitor)| {
|
||||||
match expr.node {
|
match expr.node {
|
||||||
expr_path(_) => {
|
expr_path(_) => {
|
||||||
let def = match tcx.def_map.find(&expr.id) {
|
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()
|
..*visit::default_visitor()
|
||||||
})
|
})
|
||||||
|
@ -325,7 +325,7 @@ impl ReachableContext {
|
||||||
Some(&ast_map::node_item(item, _)) => {
|
Some(&ast_map::node_item(item, _)) => {
|
||||||
match item.node {
|
match item.node {
|
||||||
item_fn(_, _, _, _, ref search_block) => {
|
item_fn(_, _, _, _, ref search_block) => {
|
||||||
visit::visit_block(search_block, (), visitor)
|
visit::visit_block(search_block, ((), visitor))
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
self.tcx.sess.span_bug(item.span,
|
self.tcx.sess.span_bug(item.span,
|
||||||
|
@ -342,12 +342,12 @@ impl ReachableContext {
|
||||||
worklist?!")
|
worklist?!")
|
||||||
}
|
}
|
||||||
provided(ref method) => {
|
provided(ref method) => {
|
||||||
visit::visit_block(&method.body, (), visitor)
|
visit::visit_block(&method.body, ((), visitor))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Some(&ast_map::node_method(ref method, _, _)) => {
|
Some(&ast_map::node_method(ref method, _, _)) => {
|
||||||
visit::visit_block(&method.body, (), visitor)
|
visit::visit_block(&method.body, ((), visitor))
|
||||||
}
|
}
|
||||||
Some(_) => {
|
Some(_) => {
|
||||||
let ident_interner = token::get_ident_interner();
|
let ident_interner = token::get_ident_interner();
|
||||||
|
|
|
@ -1299,7 +1299,7 @@ impl Resolver {
|
||||||
}
|
}
|
||||||
|
|
||||||
item_impl(_, Some(_), ty, ref methods) => {
|
item_impl(_, Some(_), ty, ref methods) => {
|
||||||
visit_item(item, parent, visitor);
|
visit_item(item, (parent, visitor));
|
||||||
}
|
}
|
||||||
|
|
||||||
item_trait(_, _, ref methods) => {
|
item_trait(_, _, ref methods) => {
|
||||||
|
@ -1349,7 +1349,7 @@ impl Resolver {
|
||||||
match ty_m.explicit_self.node {
|
match ty_m.explicit_self.node {
|
||||||
sty_static => {}
|
sty_static => {}
|
||||||
_ => {
|
_ => {
|
||||||
method_names.insert(ident);
|
method_names.insert(ident, ());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2054,7 +2054,7 @@ impl Resolver {
|
||||||
} else {
|
} else {
|
||||||
result.push_str("::")
|
result.push_str("::")
|
||||||
}
|
}
|
||||||
result.push_str(*self.session.str_of(*ident));
|
result.push_str(self.session.str_of(*ident));
|
||||||
};
|
};
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,7 +98,7 @@ pub fn trans_inline_asm(bcx: block, ia: &ast::inline_asm) -> block {
|
||||||
if !ia.clobbers.is_empty() && !clobbers.is_empty() {
|
if !ia.clobbers.is_empty() && !clobbers.is_empty() {
|
||||||
clobbers = fmt!("%s,%s", ia.clobbers, clobbers);
|
clobbers = fmt!("%s,%s", ia.clobbers, clobbers);
|
||||||
} else {
|
} else {
|
||||||
clobbers.push_str(*ia.clobbers);
|
clobbers.push_str(ia.clobbers);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Add the clobbers to our constraints list
|
// Add the clobbers to our constraints list
|
||||||
|
|
|
@ -2890,7 +2890,7 @@ pub fn trans_crate(sess: session::Session,
|
||||||
emap2: resolve::ExportMap2,
|
emap2: resolve::ExportMap2,
|
||||||
reachable_map: @mut HashSet<ast::node_id>,
|
reachable_map: @mut HashSet<ast::node_id>,
|
||||||
maps: astencode::Maps)
|
maps: astencode::Maps)
|
||||||
-> (ContextRef, ModuleRef, LinkMeta) {
|
-> (ModuleRef, LinkMeta) {
|
||||||
|
|
||||||
let mut symbol_hasher = hash::default_state();
|
let mut symbol_hasher = hash::default_state();
|
||||||
let link_meta = link::build_link_meta(sess, crate, output, &mut symbol_hasher);
|
let link_meta = link::build_link_meta(sess, crate, output, &mut symbol_hasher);
|
||||||
|
|
|
@ -1046,7 +1046,7 @@ pub fn path_str(sess: session::Session, p: &[path_elt]) -> ~str {
|
||||||
} else {
|
} else {
|
||||||
r.push_str("::")
|
r.push_str("::")
|
||||||
}
|
}
|
||||||
r.push_str(*sess.str_of(s));
|
r.push_str(sess.str_of(s));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -799,9 +799,8 @@ impl FnCtxt {
|
||||||
match self.inh.node_types.find(&ex.id) {
|
match self.inh.node_types.find(&ex.id) {
|
||||||
Some(&t) => t,
|
Some(&t) => t,
|
||||||
None => {
|
None => {
|
||||||
self.tcx().sess.bug(
|
self.tcx().sess.bug(fmt!("no type for expr in fcx %s",
|
||||||
fmt!("no type for %s in fcx %s",
|
self.tag()));
|
||||||
self.expr_to_str(ex), self.tag()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1141,7 +1140,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
|
||||||
expr: @ast::expr,
|
expr: @ast::expr,
|
||||||
expected: Option<ty::t>,
|
expected: Option<ty::t>,
|
||||||
unifier: &fn()) {
|
unifier: &fn()) {
|
||||||
debug!(">> typechecking %s", fcx.expr_to_str(expr));
|
debug!(">> typechecking");
|
||||||
|
|
||||||
fn check_method_argument_types(
|
fn check_method_argument_types(
|
||||||
fcx: @mut FnCtxt,
|
fcx: @mut FnCtxt,
|
||||||
|
@ -1730,8 +1729,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
|
||||||
ty::mk_closure(tcx, fn_ty_copy)
|
ty::mk_closure(tcx, fn_ty_copy)
|
||||||
};
|
};
|
||||||
|
|
||||||
debug!("check_expr_fn_with_unifier %s fty=%s",
|
debug!("check_expr_fn_with_unifier fty=%s",
|
||||||
fcx.expr_to_str(expr),
|
|
||||||
fcx.infcx().ty_to_str(fty));
|
fcx.infcx().ty_to_str(fty));
|
||||||
|
|
||||||
fcx.write_ty(expr.id, fty);
|
fcx.write_ty(expr.id, fty);
|
||||||
|
|
|
@ -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)) {
|
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);
|
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 tcx = rcx.fcx.tcx();
|
||||||
let r_deref_expr = ty::re_scope(deref_expr.id);
|
let r_deref_expr = ty::re_scope(deref_expr.id);
|
||||||
for uint::range(0, derefs) |i| {
|
for uint::range(0, derefs) |i| {
|
||||||
debug!("constrain_derefs(deref_expr=%s, derefd_ty=%s, derefs=%?/%?",
|
debug!("constrain_derefs(deref_expr=?, derefd_ty=%s, derefs=%?/%?",
|
||||||
rcx.fcx.expr_to_str(deref_expr),
|
|
||||||
rcx.fcx.infcx().ty_to_str(derefd_ty),
|
rcx.fcx.infcx().ty_to_str(derefd_ty),
|
||||||
i, derefs);
|
i, derefs);
|
||||||
|
|
||||||
|
@ -576,8 +575,7 @@ fn constrain_index(rcx: @mut Rcx,
|
||||||
|
|
||||||
let tcx = rcx.fcx.tcx();
|
let tcx = rcx.fcx.tcx();
|
||||||
|
|
||||||
debug!("constrain_index(index_expr=%s, indexed_ty=%s",
|
debug!("constrain_index(index_expr=?, indexed_ty=%s",
|
||||||
rcx.fcx.expr_to_str(index_expr),
|
|
||||||
rcx.fcx.infcx().ty_to_str(indexed_ty));
|
rcx.fcx.infcx().ty_to_str(indexed_ty));
|
||||||
|
|
||||||
let r_index_expr = ty::re_scope(index_expr.id);
|
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).
|
* 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);
|
let guarantor = guarantor(rcx, base);
|
||||||
link(rcx, expr.span, expr.id, guarantor);
|
link(rcx, expr.span, expr.id, guarantor);
|
||||||
|
@ -842,8 +840,7 @@ pub mod guarantor {
|
||||||
* region pointers.
|
* region pointers.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
debug!("guarantor::for_autoref(expr=%s, autoref=%?)",
|
debug!("guarantor::for_autoref(autoref=%?)", autoref);
|
||||||
rcx.fcx.expr_to_str(expr), autoref);
|
|
||||||
|
|
||||||
let mut expr_ct = categorize_unadjusted(rcx, expr);
|
let mut expr_ct = categorize_unadjusted(rcx, expr);
|
||||||
debug!(" unadjusted cat=%?", expr_ct.cat);
|
debug!(" unadjusted cat=%?", expr_ct.cat);
|
||||||
|
@ -970,7 +967,7 @@ pub mod guarantor {
|
||||||
* `&expr`).
|
* `&expr`).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
debug!("guarantor(expr=%s)", rcx.fcx.expr_to_str(expr));
|
debug!("guarantor()");
|
||||||
match expr.node {
|
match expr.node {
|
||||||
ast::expr_unary(_, ast::deref, b) => {
|
ast::expr_unary(_, ast::deref, b) => {
|
||||||
let cat = categorize(rcx, b);
|
let cat = categorize(rcx, b);
|
||||||
|
@ -1034,7 +1031,7 @@ pub mod guarantor {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn categorize(rcx: @mut Rcx, expr: @ast::expr) -> ExprCategorization {
|
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);
|
let mut expr_ct = categorize_unadjusted(rcx, expr);
|
||||||
debug!("before adjustments, cat=%?", expr_ct.cat);
|
debug!("before adjustments, cat=%?", expr_ct.cat);
|
||||||
|
@ -1086,7 +1083,7 @@ pub mod guarantor {
|
||||||
fn categorize_unadjusted(rcx: @mut Rcx,
|
fn categorize_unadjusted(rcx: @mut Rcx,
|
||||||
expr: @ast::expr)
|
expr: @ast::expr)
|
||||||
-> ExprCategorizationType {
|
-> ExprCategorizationType {
|
||||||
debug!("categorize_unadjusted(expr=%s)", rcx.fcx.expr_to_str(expr));
|
debug!("categorize_unadjusted()");
|
||||||
|
|
||||||
let guarantor = {
|
let guarantor = {
|
||||||
if rcx.fcx.inh.method_map.contains_key(&expr.id) {
|
if rcx.fcx.inh.method_map.contains_key(&expr.id) {
|
||||||
|
|
|
@ -21,7 +21,7 @@ use cmp::Eq;
|
||||||
use iterator::IteratorUtil;
|
use iterator::IteratorUtil;
|
||||||
use libc;
|
use libc;
|
||||||
use option::{None, Option, Some};
|
use option::{None, Option, Some};
|
||||||
use str::{Str, StrSlice, StrVector};
|
use str::{OwnedStr, Str, StrSlice, StrVector};
|
||||||
use str;
|
use str;
|
||||||
use to_str::ToStr;
|
use to_str::ToStr;
|
||||||
use ascii::{AsciiCast, AsciiStr};
|
use ascii::{AsciiCast, AsciiStr};
|
||||||
|
|
|
@ -1427,7 +1427,8 @@ impl<'self> StrSlice<'self> for &'self str {
|
||||||
fn slice_chars(&self, begin: uint, end: uint) -> &'self str {
|
fn slice_chars(&self, begin: uint, end: uint) -> &'self str {
|
||||||
assert!(begin <= end);
|
assert!(begin <= end);
|
||||||
// not sure how to use the iterators for this nicely.
|
// 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();
|
let l = self.len();
|
||||||
while count < begin && position < l {
|
while count < begin && position < l {
|
||||||
position = self.char_range_at(position).next;
|
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`
|
* The original string with all occurances of `from` replaced with `to`
|
||||||
*/
|
*/
|
||||||
pub fn replace(&self, from: &str, to: &str) -> ~str {
|
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)| {
|
for self.matches_index_iter(from).advance |(start, end)| {
|
||||||
result.push_str(unsafe{raw::slice_bytes(*self, last_end, start)});
|
result.push_str(unsafe{raw::slice_bytes(*self, last_end, start)});
|
||||||
result.push_str(to);
|
result.push_str(to);
|
||||||
|
|
|
@ -98,7 +98,7 @@ impl gen_send for message {
|
||||||
}
|
}
|
||||||
body.push_str(fmt!("let message = %s(%s);\n",
|
body.push_str(fmt!("let message = %s(%s);\n",
|
||||||
name,
|
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(", ")));
|
.connect(", ")));
|
||||||
|
|
||||||
if !try {
|
if !try {
|
||||||
|
|
|
@ -378,7 +378,7 @@ impl Parser {
|
||||||
self.fatal(
|
self.fatal(
|
||||||
fmt!(
|
fmt!(
|
||||||
"expected `%s`, found `%s`",
|
"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()
|
self.this_token_to_str()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue