From 7d4e7f079552a524440d8b5fb656d52661592aee Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Tue, 16 Dec 2014 14:30:30 +0100 Subject: AST refactor: make the place in ExprBox an option. This is to allow us to migrate away from UnUniq in a followup commit, and thus unify the code paths related to all forms of `box`. --- src/libsyntax/print/pprust.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libsyntax/print/pprust.rs') diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index db122f271a9..4f45b69883b 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -1495,7 +1495,7 @@ impl<'a> State<'a> { ast::ExprBox(ref p, ref e) => { try!(word(&mut self.s, "box")); try!(word(&mut self.s, "(")); - try!(self.print_expr(&**p)); + try!(p.as_ref().map_or(Ok(()), |e|self.print_expr(&**e))); try!(self.word_space(")")); try!(self.print_expr(&**e)); } -- cgit 1.4.1-3-g733a5