|
11 | 11 | pub use self::AnnNode::*;
|
12 | 12 |
|
13 | 13 | use abi;
|
14 |
| -use ast::{FnUnboxedClosureKind, FnMutUnboxedClosureKind}; |
| 14 | +use ast::{mod, FnUnboxedClosureKind, FnMutUnboxedClosureKind}; |
15 | 15 | use ast::{FnOnceUnboxedClosureKind};
|
16 | 16 | use ast::{MethodImplItem, RegionTyParamBound, TraitTyParamBound};
|
17 | 17 | use ast::{RequiredMethod, ProvidedMethod, TypeImplItem, TypeTraitItem};
|
18 | 18 | use ast::{UnboxedClosureKind};
|
19 |
| -use ast; |
20 | 19 | use ast_util;
|
21 | 20 | use owned_slice::OwnedSlice;
|
22 | 21 | use attr::{AttrMetaMethods, AttributeMethods};
|
23 |
| -use codemap::{CodeMap, BytePos}; |
24 |
| -use codemap; |
| 22 | +use codemap::{mod, CodeMap, BytePos}; |
25 | 23 | use diagnostic;
|
26 |
| -use parse::token::{BinOpToken, Token}; |
27 |
| -use parse::token; |
| 24 | +use parse::token::{mod, BinOpToken, Token}; |
28 | 25 | use parse::lexer::comments;
|
29 | 26 | use parse;
|
30 |
| -use print::pp::{break_offset, word, space, zerobreak, hardbreak}; |
| 27 | +use print::pp::{mod, break_offset, word, space, zerobreak, hardbreak}; |
31 | 28 | use print::pp::{Breaks, Consistent, Inconsistent, eof};
|
32 |
| -use print::pp; |
33 | 29 | use ptr::P;
|
34 | 30 |
|
35 |
| -use std::ascii; |
36 |
| -use std::io::IoResult; |
37 |
| -use std::io; |
38 |
| -use std::mem; |
| 31 | +use std::{ascii, mem}; |
| 32 | +use std::io::{mod, IoResult}; |
39 | 33 |
|
40 | 34 | pub enum AnnNode<'a> {
|
41 | 35 | NodeIdent(&'a ast::Ident),
|
@@ -2164,21 +2158,22 @@ impl<'a> State<'a> {
|
2164 | 2158 | try!(self.print_pat(&**p));
|
2165 | 2159 | }
|
2166 | 2160 | try!(space(&mut self.s));
|
2167 |
| - match arm.guard { |
2168 |
| - Some(ref e) => { |
2169 |
| - try!(self.word_space("if")); |
2170 |
| - try!(self.print_expr(&**e)); |
2171 |
| - try!(space(&mut self.s)); |
2172 |
| - } |
2173 |
| - None => () |
| 2161 | + if let Some(ref e) = arm.guard { |
| 2162 | + try!(self.word_space("if")); |
| 2163 | + try!(self.print_expr(&**e)); |
| 2164 | + try!(space(&mut self.s)); |
2174 | 2165 | }
|
2175 | 2166 | try!(self.word_space("=>"));
|
2176 | 2167 |
|
2177 | 2168 | match arm.body.node {
|
2178 | 2169 | ast::ExprBlock(ref blk) => {
|
2179 | 2170 | // the block will close the pattern's ibox
|
2180 |
| - try!(self.print_block_unclosed_indent(&**blk, |
2181 |
| - indent_unit)); |
| 2171 | + try!(self.print_block_unclosed_indent(&**blk, indent_unit)); |
| 2172 | + |
| 2173 | + // If it is a user-provided unsafe block, print a comma after it |
| 2174 | + if let ast::UnsafeBlock(ast::UserProvided) = blk.rules { |
| 2175 | + try!(word(&mut self.s, ",")); |
| 2176 | + } |
2182 | 2177 | }
|
2183 | 2178 | _ => {
|
2184 | 2179 | try!(self.end()); // close the ibox for the pattern
|
|
0 commit comments