]> git.lizzy.rs Git - rust.git/blobdiff - src/formatting.rs
Merge pull request #3129 from otavio/issue-3104
[rust.git] / src / formatting.rs
index 90fb5899098218e33e2fc9c37e4d3f349ff74add..039276ba6e886b39a54b1581d3ef459ce30833f7 100644 (file)
@@ -173,6 +173,8 @@ fn format_file(
         if visitor.macro_rewrite_failure {
             self.report.add_macro_format_failure();
         }
+        self.report
+            .add_non_formatted_ranges(visitor.skipped_range.clone());
 
         self.handler
             .handle_formatted_file(path, visitor.buffer.to_owned(), &mut self.report)
@@ -240,7 +242,8 @@ pub(crate) fn from_span(
                     fl.file
                         .get_line(fl.lines[0].line_index)
                         .map(|l| l.into_owned())
-                }).unwrap_or_else(String::new),
+                })
+                .unwrap_or_else(String::new),
         }
     }
 
@@ -527,7 +530,8 @@ fn new_line(&mut self, kind: FullCodeCharKind) {
                 && !self.is_skipped_line()
                 && self.should_report_error(kind, &error_kind)
             {
-                self.push_err(error_kind, kind.is_comment(), self.is_string);
+                let is_string = self.is_string;
+                self.push_err(error_kind, kind.is_comment(), is_string);
             }
         }