librustc: De-@mut several instances of io::Writer.

There are a few more related to pretty printing.
This commit is contained in:
Patrick Walton 2013-12-21 15:24:10 -08:00
parent 992696fd27
commit 473d048095
4 changed files with 9 additions and 7 deletions

View File

@ -569,13 +569,14 @@ pub fn pretty_print_input(sess: Session,
let src = sess.codemap.get_filemap(source_name(input)).src;
let rdr = @mut MemReader::new(src.as_bytes().to_owned());
let stdout = io::stdout();
pprust::print_crate(sess.codemap,
token::get_ident_interner(),
sess.span_diagnostic,
&crate,
source_name(input),
rdr as @mut io::Reader,
@mut io::stdout() as @mut io::Writer,
@mut stdout as @mut io::Writer,
annotation,
is_expanded);
}
@ -1080,7 +1081,7 @@ pub fn early_error(emitter: @diagnostic::Emitter, msg: &str) -> ! {
fail!();
}
pub fn list_metadata(sess: Session, path: &Path, out: @mut io::Writer) {
pub fn list_metadata(sess: Session, path: &Path, out: &mut io::Writer) {
metadata::loader::list_file_metadata(
token::get_ident_interner(),
session::sess_os_to_meta_os(sess.targ_cfg.os), path, out);

View File

@ -275,8 +275,9 @@ pub fn run_compiler(args: &[~str], demitter: @diagnostic::Emitter) {
if ls {
match input {
d::file_input(ref ifile) => {
let mut stdout = io::stdout();
d::list_metadata(sess, &(*ifile),
@mut io::stdout() as @mut io::Writer);
&mut stdout as &mut io::Writer);
}
d::str_input(_) => {
d::early_error(demitter, "can not list metadata for stdin");

View File

@ -1110,7 +1110,7 @@ fn get_attributes(md: ebml::Doc) -> ~[ast::Attribute] {
}
fn list_crate_attributes(intr: @ident_interner, md: ebml::Doc, hash: &str,
out: @mut io::Writer) {
out: &mut io::Writer) {
write!(out, "=Crate Attributes ({})=\n", hash);
let r = get_attributes(md);
@ -1153,7 +1153,7 @@ pub fn get_crate_deps(data: &[u8]) -> ~[CrateDep] {
return deps;
}
fn list_crate_deps(data: &[u8], out: @mut io::Writer) {
fn list_crate_deps(data: &[u8], out: &mut io::Writer) {
write!(out, "=External Dependencies=\n");
let r = get_crate_deps(data);
@ -1180,7 +1180,7 @@ pub fn get_crate_vers(data: &[u8]) -> @str {
}
pub fn list_crate_metadata(intr: @ident_interner, bytes: &[u8],
out: @mut io::Writer) {
out: &mut io::Writer) {
let hash = get_crate_hash(bytes);
let md = reader::Doc(bytes);
list_crate_attributes(intr, md, hash, out);

View File

@ -380,7 +380,7 @@ pub fn read_meta_section_name(os: Os) -> &'static str {
pub fn list_file_metadata(intr: @ident_interner,
os: Os,
path: &Path,
out: @mut io::Writer) {
out: &mut io::Writer) {
match get_metadata_section(os, path) {
option::Some(bytes) => decoder::list_crate_metadata(intr,
bytes.as_slice(),