|
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),
|
@@ -2150,21 +2144,22 @@ impl<'a> State<'a> {
|
2150 | 2144 | try!(self.print_pat(&**p));
|
2151 | 2145 | }
|
2152 | 2146 | try!(space(&mut self.s));
|
2153 |
| - match arm.guard { |
2154 |
| - Some(ref e) => { |
2155 |
| - try!(self.word_space("if")); |
2156 |
| - try!(self.print_expr(&**e)); |
2157 |
| - try!(space(&mut self.s)); |
2158 |
| - } |
2159 |
| - None => () |
| 2147 | + if let Some(ref e) = arm.guard { |
| 2148 | + try!(self.word_space("if")); |
| 2149 | + try!(self.print_expr(&**e)); |
| 2150 | + try!(space(&mut self.s)); |
2160 | 2151 | }
|
2161 | 2152 | try!(self.word_space("=>"));
|
2162 | 2153 |
|
2163 | 2154 | match arm.body.node {
|
2164 | 2155 | ast::ExprBlock(ref blk) => {
|
2165 | 2156 | // the block will close the pattern's ibox
|
2166 |
| - try!(self.print_block_unclosed_indent(&**blk, |
2167 |
| - indent_unit)); |
| 2157 | + try!(self.print_block_unclosed_indent(&**blk, indent_unit)); |
| 2158 | + |
| 2159 | + // If it is a user-provided unsafe block, print a comma after it |
| 2160 | + if let ast::UnsafeBlock(ast::UserProvided) = blk.rules { |
| 2161 | + try!(word(&mut self.s, ",")); |
| 2162 | + } |
2168 | 2163 | }
|
2169 | 2164 | _ => {
|
2170 | 2165 | try!(self.end()); // close the ibox for the pattern
|
|
0 commit comments