Skip to content

Commit f119bf2

Browse files
committed
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
2 parents baab191 + d26c4b7 commit f119bf2

File tree

10 files changed

+2076
-2280
lines changed

10 files changed

+2076
-2280
lines changed

Diff for: src/librustc/hir/map/mod.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ use crate::hir::print::Nested;
2525
use crate::util::nodemap::FxHashMap;
2626
use crate::util::common::time;
2727

28-
use std::io;
2928
use std::result::Result::Err;
3029
use crate::ty::query::Providers;
3130

@@ -1187,7 +1186,7 @@ pub fn map_crate<'hir>(sess: &crate::session::Session,
11871186
/// Identical to the `PpAnn` implementation for `hir::Crate`,
11881187
/// except it avoids creating a dependency on the whole crate.
11891188
impl<'hir> print::PpAnn for Map<'hir> {
1190-
fn nested(&self, state: &mut print::State<'_>, nested: print::Nested) -> io::Result<()> {
1189+
fn nested(&self, state: &mut print::State<'_>, nested: print::Nested) {
11911190
match nested {
11921191
Nested::Item(id) => state.print_item(self.expect_item(id.id)),
11931192
Nested::TraitItem(id) => state.print_trait_item(self.trait_item(id)),
@@ -1199,7 +1198,7 @@ impl<'hir> print::PpAnn for Map<'hir> {
11991198
}
12001199

12011200
impl<'a> print::State<'a> {
1202-
pub fn print_node(&mut self, node: Node<'_>) -> io::Result<()> {
1201+
pub fn print_node(&mut self, node: Node<'_>) {
12031202
match node {
12041203
Node::Item(a) => self.print_item(&a),
12051204
Node::ForeignItem(a) => self.print_foreign_item(&a),
@@ -1219,9 +1218,9 @@ impl<'a> print::State<'a> {
12191218
use syntax::print::pprust::PrintState;
12201219

12211220
// containing cbox, will be closed by print-block at }
1222-
self.cbox(print::indent_unit)?;
1221+
self.cbox(print::indent_unit);
12231222
// head-ibox, will be closed by print-block after {
1224-
self.ibox(0)?;
1223+
self.ibox(0);
12251224
self.print_block(&a)
12261225
}
12271226
Node::Lifetime(a) => self.print_lifetime(&a),

0 commit comments

Comments
 (0)