diff options
| author | bors <bors@rust-lang.org> | 2019-07-05 06:55:48 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-07-05 06:55:48 +0000 |
| commit | f119bf2761ab11ca577fac9881678c04d3e7fdb0 (patch) | |
| tree | f48f186557f8b204878001e23f7703c58908a063 /src/libsyntax/parse | |
| parent | baab1914ec9a9742776a8147780947b48fddf54d (diff) | |
| parent | d26c4b7bd6e5905280dd4441482331fb9fb65e07 (diff) | |
| download | rust-f119bf2761ab11ca577fac9881678c04d3e7fdb0.tar.gz rust-f119bf2761ab11ca577fac9881678c04d3e7fdb0.zip | |
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
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/diagnostics.rs | 12 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 18 |
2 files changed, 15 insertions, 15 deletions
diff --git a/src/libsyntax/parse/diagnostics.rs b/src/libsyntax/parse/diagnostics.rs index 0ea0b2a694d..edcdb18a037 100644 --- a/src/libsyntax/parse/diagnostics.rs +++ b/src/libsyntax/parse/diagnostics.rs @@ -613,12 +613,12 @@ impl<'a> Parser<'a> { let sum_with_parens = pprust::to_string(|s| { use crate::print::pprust::PrintState; - s.s.word("&")?; - s.print_opt_lifetime(lifetime)?; - s.print_mutability(mut_ty.mutbl)?; - s.popen()?; - s.print_type(&mut_ty.ty)?; - s.print_type_bounds(" +", &bounds)?; + s.s.word("&"); + s.print_opt_lifetime(lifetime); + s.print_mutability(mut_ty.mutbl); + s.popen(); + s.print_type(&mut_ty.ty); + s.print_type_bounds(" +", &bounds); s.pclose() }); err.span_suggestion( diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 9c179600093..cef14632e64 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -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( |
