mirror of
https://github.com/rust-lang/rust
synced 2024-10-02 14:54:35 +00:00
syntax: Pretty-print 'do' correctly
This commit is contained in:
parent
ba6f71f1b8
commit
8b2491160d
|
@ -879,6 +879,7 @@ fn print_field(s: ps, field: ast::field) {
|
|||
let blk_arg = vec::pop(base_args);
|
||||
alt blk_arg.node {
|
||||
ast::expr_loop_body(_) { word_nbsp(s, "for"); }
|
||||
ast::expr_do_body(_) { word_nbsp(s, "do"); }
|
||||
_ {}
|
||||
}
|
||||
some(blk_arg)
|
||||
|
|
7
src/test/pretty/do1.rs
Normal file
7
src/test/pretty/do1.rs
Normal file
|
@ -0,0 +1,7 @@
|
|||
// pretty-exact
|
||||
|
||||
fn f(f: fn@(int)) { f(10) }
|
||||
|
||||
fn main() {
|
||||
do f { |i| assert i == 10 }
|
||||
}
|
Loading…
Reference in a new issue