Auto merge of #62099 - Mark-Simulacrum:syntax-print-clean-2, r=eddyb

Remove io::Result from syntax::print

Since we're now writing directly to the vector, there's no need to
thread results through the whole printing infrastructure
This commit is contained in:
bors
2019-07-05 06:55:48 +00:00
10 changed files with 2070 additions and 2274 deletions

View File

@@ -2572,12 +2572,12 @@ impl<'a> Parser<'a> {
};
let sugg = pprust::to_string(|s| {
use crate::print::pprust::PrintState;
s.popen()?;
s.print_expr(&e)?;
s.s.word( ".")?;
s.print_usize(float.trunc() as usize)?;
s.pclose()?;
s.s.word(".")?;
s.popen();
s.print_expr(&e);
s.s.word( ".");
s.print_usize(float.trunc() as usize);
s.pclose();
s.s.word(".");
s.s.word(fstr.splitn(2, ".").last().unwrap().to_string())
});
err.span_suggestion(
@@ -4583,9 +4583,9 @@ impl<'a> Parser<'a> {
}
let sugg = pprust::to_string(|s| {
use crate::print::pprust::{PrintState, INDENT_UNIT};
s.ibox(INDENT_UNIT)?;
s.bopen()?;
s.print_stmt(&stmt)?;
s.ibox(INDENT_UNIT);
s.bopen();
s.print_stmt(&stmt);
s.bclose_maybe_open(stmt.span, INDENT_UNIT, false)
});
e.span_suggestion(