Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/etc/x86.supp
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,13 @@
...
}

{
enum-instruction-scheduling-8
Memcheck:Cond
fun:*should_set_output_format_to_markdown_if_requested*
...
}

{
llvm-user-new-leak
Memcheck:Leak
Expand Down
8 changes: 4 additions & 4 deletions src/librustdoc/path_pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ pub fn mk_pass() -> Pass {

struct Ctxt {
srv: astsrv::Srv,
mut path: ~[~str]
path: @mut ~[~str]
}

impl Clone for Ctxt {
fn clone(&self) -> Ctxt {
Ctxt {
srv: self.srv.clone(),
path: copy self.path
path: @mut copy *self.path
}
}
}
Expand All @@ -47,7 +47,7 @@ impl Clone for Ctxt {
fn run(srv: astsrv::Srv, doc: doc::Doc) -> doc::Doc {
let ctxt = Ctxt {
srv: srv,
mut path: ~[]
path: @mut ~[]
};
let fold = Fold {
ctxt: ctxt.clone(),
Expand All @@ -61,7 +61,7 @@ fn run(srv: astsrv::Srv, doc: doc::Doc) -> doc::Doc {

fn fold_item(fold: &fold::Fold<Ctxt>, doc: doc::ItemDoc) -> doc::ItemDoc {
doc::ItemDoc {
path: copy fold.ctxt.path,
path: copy *fold.ctxt.path,
.. doc
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/librustpkg/rustpkg.rc
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ impl PackageScript {
struct Ctx {
cfgs: ~[~str],
json: bool,
mut dep_cache: LinearMap<~str, bool>
dep_cache: @mut LinearMap<~str, bool>
}

impl Ctx {
Expand Down Expand Up @@ -912,7 +912,7 @@ pub fn main() {
Ctx {
cfgs: cfgs,
json: json,
mut dep_cache: LinearMap::new()
dep_cache: @mut LinearMap::new()
}.run(cmd, args);
}

Expand Down
31 changes: 16 additions & 15 deletions src/librustpkg/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ struct ReadyCtx {
sess: session::Session,
crate: @ast::crate,
ext_cx: ext_ctxt,
mut path: ~[ast::ident],
mut fns: ~[ListenerFn]
path: ~[ast::ident],
fns: ~[ListenerFn]
}

fn fold_mod(_ctx: @ReadyCtx, m: ast::_mod,
fn fold_mod(_ctx: @mut ReadyCtx, m: ast::_mod,
fold: fold::ast_fold) -> ast::_mod {
fn strip_main(item: @ast::item) -> @ast::item {
@ast::item {
Expand All @@ -95,7 +95,7 @@ fn fold_mod(_ctx: @ReadyCtx, m: ast::_mod,
}, fold)
}

fn fold_item(ctx: @ReadyCtx, item: @ast::item,
fn fold_item(ctx: @mut ReadyCtx, item: @ast::item,
fold: fold::ast_fold) -> Option<@ast::item> {

ctx.path.push(item.ident);
Expand Down Expand Up @@ -133,7 +133,7 @@ fn fold_item(ctx: @ReadyCtx, item: @ast::item,
res
}

fn add_pkg_module(ctx: @ReadyCtx, m: ast::_mod) -> ast::_mod {
fn add_pkg_module(ctx: @mut ReadyCtx, m: ast::_mod) -> ast::_mod {
let listeners = mk_listener_vec(ctx);
let ext_cx = ctx.ext_cx;
let item = quote_item! (
Expand All @@ -152,24 +152,25 @@ fn add_pkg_module(ctx: @ReadyCtx, m: ast::_mod) -> ast::_mod {
}
}

fn mk_listener_vec(ctx: @ReadyCtx) -> @ast::expr {
fn mk_listener_vec(ctx: @mut ReadyCtx) -> @ast::expr {
let fns = ctx.fns;
let descs = do fns.map |listener| {
mk_listener_rec(ctx, *listener)
};
build::mk_slice_vec_e(ctx.ext_cx, dummy_sp(), descs)
let ext_cx = ctx.ext_cx;
build::mk_slice_vec_e(ext_cx, dummy_sp(), descs)
}

fn mk_listener_rec(ctx: @ReadyCtx, listener: ListenerFn) -> @ast::expr {

fn mk_listener_rec(ctx: @mut ReadyCtx, listener: ListenerFn) -> @ast::expr {
let span = listener.span;
let cmds = do listener.cmds.map |&cmd| {
build::mk_base_str(ctx.ext_cx, span, cmd)
let ext_cx = ctx.ext_cx;
build::mk_base_str(ext_cx, span, cmd)
};

let cmds_expr = build::mk_slice_vec_e(ctx.ext_cx, span, cmds);
let cb_expr = build::mk_path(ctx.ext_cx, span, copy listener.path);
let ext_cx = ctx.ext_cx;
let cmds_expr = build::mk_slice_vec_e(ext_cx, span, cmds);
let cb_expr = build::mk_path(ext_cx, span, copy listener.path);

quote_expr!(
Listener {
Expand All @@ -182,12 +183,12 @@ fn mk_listener_rec(ctx: @ReadyCtx, listener: ListenerFn) -> @ast::expr {
/// Generate/filter main function, add the list of commands, etc.
pub fn ready_crate(sess: session::Session,
crate: @ast::crate) -> @ast::crate {
let ctx = @ReadyCtx {
let ctx = @mut ReadyCtx {
sess: sess,
crate: crate,
ext_cx: mk_ctxt(sess.parse_sess, copy sess.opts.cfg),
mut path: ~[],
mut fns: ~[]
path: ~[],
fns: ~[]
};
let precursor = @fold::AstFoldFns {
// fold_crate: fold::wrap(|a, b| fold_crate(ctx, a, b)),
Expand Down
6 changes: 3 additions & 3 deletions src/libsyntax/codemap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ pub struct FileMap {
/// The start position of this source in the CodeMap
start_pos: BytePos,
/// Locations of lines beginnings in the source code
mut lines: ~[BytePos],
lines: @mut ~[BytePos],
/// Locations of multi-byte characters in the source code
multibyte_chars: DVec<MultiByteChar>
}
Expand Down Expand Up @@ -312,7 +312,7 @@ pub impl CodeMap {
let filemap = @FileMap {
name: filename, substr: substr, src: src,
start_pos: BytePos(start_pos),
mut lines: ~[],
lines: @mut ~[],
multibyte_chars: DVec()
};

Expand Down Expand Up @@ -439,7 +439,7 @@ priv impl CodeMap {
let idx = self.lookup_filemap_idx(pos);
let f = self.files[idx];
let mut a = 0u;
let mut b = vec::len(f.lines);
let mut b = f.lines.len();
while b - a > 1u {
let m = (a + b) / 2u;
if f.lines[m] > pos { b = m; } else { a = m; }
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/diagnostic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ pub fn mk_handler(emitter: Option<Emitter>) -> @handler {
}
};

@mut HandlerT { mut err_count: 0, emit: emit } as @handler
@mut HandlerT { err_count: 0, emit: emit } as @handler
}

#[deriving_eq]
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/ext/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ pub fn get_exprs_from_tts(cx: ext_ctxt, tts: ~[ast::token_tree])
cx.cfg(),
tts);
let mut es = ~[];
while p.token != token::EOF {
while *p.token != token::EOF {
if es.len() != 0 {
p.eat(token::COMMA);
}
Expand Down
2 changes: 1 addition & 1 deletion src/libsyntax/ext/pipes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub fn expand_proto(cx: ext_ctxt, _sp: span, id: ast::ident,
let rdr = tt_rdr as reader;
let rust_parser = Parser(sess, cfg, rdr.dup());

let proto = rust_parser.parse_proto(cx.str_of(id));
let mut proto = rust_parser.parse_proto(cx.str_of(id));

// check for errors
visit(proto, cx);
Expand Down
19 changes: 10 additions & 9 deletions src/libsyntax/ext/pipes/parse_proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub trait proto_parser {

pub impl proto_parser for parser::Parser {
fn parse_proto(&self, id: ~str) -> protocol {
let proto = protocol(id, self.span);
let proto = protocol(id, *self.span);

self.parse_seq_to_before_end(token::EOF, SeqSep {
sep: None,
Expand All @@ -40,7 +40,7 @@ pub impl proto_parser for parser::Parser {
let name = *self.interner.get(id);

self.expect(token::COLON);
let dir = match copy self.token {
let dir = match *self.token {
token::IDENT(n, _) => self.interner.get(n),
_ => fail!()
};
Expand All @@ -51,10 +51,11 @@ pub impl proto_parser for parser::Parser {
_ => fail!()
};

let typarms = if self.token == token::LT {
let typarms = if *self.token == token::LT {
self.parse_ty_params()
}
else { ~[] };
} else {
~[]
};

let state = proto.add_state_poly(name, id, dir, typarms);

Expand All @@ -69,7 +70,7 @@ pub impl proto_parser for parser::Parser {
fn parse_message(&self, state: state) {
let mname = *self.interner.get(self.parse_ident());

let args = if self.token == token::LPAREN {
let args = if *self.token == token::LPAREN {
self.parse_unspanned_seq(token::LPAREN,
token::RPAREN, SeqSep {
sep: Some(token::COMMA),
Expand All @@ -80,10 +81,10 @@ pub impl proto_parser for parser::Parser {

self.expect(token::RARROW);

let next = match copy self.token {
let next = match *self.token {
token::IDENT(_, _) => {
let name = *self.interner.get(self.parse_ident());
let ntys = if self.token == token::LT {
let ntys = if *self.token == token::LT {
self.parse_unspanned_seq(token::LT,
token::GT, SeqSep {
sep: Some(token::COMMA),
Expand All @@ -101,7 +102,7 @@ pub impl proto_parser for parser::Parser {
_ => self.fatal(~"invalid next state")
};

state.add_message(mname, copy self.span, args, next);
state.add_message(mname, *self.span, args, next);

}
}
Loading