rust-lang / rustfmt

Format Rust code
https://rust-lang.github.io/rustfmt/
Apache License 2.0
6.06k stars 892 forks source link

over-indented match arm #1197

Closed nrc closed 7 years ago

nrc commented 8 years ago

Looks like a straight-up bug and I don't see why it would happen.

     match (ppm, opt_uii) {
-        (PpmSource(s), _) => {
-            // Silently ignores an identified node.
-            let out: &mut Write = &mut out;
-            s.call_with_pp_support(sess, Some(ast_map), box out, |annotation, out| {
-                debug!("pretty printing source code {:?}", s);
-                let sess = annotation.sess();
-                pprust::print_crate(sess.codemap(),
-                                    sess.diagnostic(),
-                                    krate,
-                                    src_name.to_string(),
-                                    &mut rdr,
-                                    out,
-                                    annotation.pp_ann(),
-                                    true)
-            })
-        }
+            (PpmSource(s), _) => {
topecongiro commented 7 years ago

This is fixed in 0.8.3. Output:

    match (ppm, opt_uii) {
        (PpmSource(s), _) => {
            // Silently ignores an identified node.
            let out: &mut Write = &mut out;
            s.call_with_pp_support(sess, Some(ast_map), box out, |annotation, out| {
                debug!("pretty printing source code {:?}", s);
                let sess = annotation.sess();
                pprust::print_crate(sess.codemap(),
                                    sess.diagnostic(),
                                    krate,
                                    src_name.to_string(),
                                    &mut rdr,
                                    out,
                                    annotation.pp_ann(),
                                    true)
            })
        }
    }