]> git.lizzy.rs Git - rust.git/commitdiff
placate `make tidy`.
authorFelix S. Klock II <pnkfelix@pnkfx.org>
Wed, 22 Jul 2015 21:23:36 +0000 (23:23 +0200)
committerFelix S. Klock II <pnkfelix@pnkfx.org>
Wed, 22 Jul 2015 21:23:36 +0000 (23:23 +0200)
src/libcore/intrinsics.rs
src/libsyntax/parse/parser.rs

index a1d7867431be0776d098d8253485042f9fa6a360..1d466895f2cfbb826287d677017ebc5b0fc7413e 100644 (file)
     /// Drop glue is not run on the destination.
     pub fn move_val_init<T>(dst: *mut T, src: T);
 
-    // SNAP ba0e1cd
+    // SNAP d4432b3
     #[cfg(stage0)]
     /// Moves a value to an uninitialized memory location.
     ///
index 6c10d6efa50457197bfeef84d2ba828d7adce271..c229ac31fc029a21224dac62b625288d473c5ad4 100644 (file)
@@ -2638,7 +2638,7 @@ pub fn parse_prefix_expr(&mut self) -> PResult<P<Expr>> {
             // ... but for now: check for a place: `box(PLACE) EXPR`.
 
             if try!(self.eat(&token::OpenDelim(token::Paren)) ){
-                // SNAP ba0e1cd
+                // SNAP d4432b3
                 // Enable this warning after snapshot ...
                 //
                 // let box_span = mk_sp(lo, self.last_span.hi);
@@ -2659,9 +2659,15 @@ pub fn parse_prefix_expr(&mut self) -> PResult<P<Expr>> {
                         self.span_err(span,
                                       &format!("expected expression, found `{}`",
                                               this_token_to_string));
+
+                        // Spanning just keyword avoids constructing
+                        // printout of arg expression (which starts
+                        // with parenthesis, as established above).
+
                         let box_span = mk_sp(lo, keyword_hi);
-                        let new_expr = format!("box () {}", pprust::expr_to_string(&place));
-                        self.span_suggestion(box_span, "try using `box ()` instead:", new_expr);
+                        self.span_suggestion(box_span,
+                                             "try using `box ()` instead:",
+                                             format!("box ()"));
                         self.abort_if_errors();
                     }
                     let subexpression = try!(self.parse_prefix_expr());