]> git.lizzy.rs Git - rust.git/blobdiff - src/rewrite.rs
Change `print_diff` to output the correct line number.
[rust.git] / src / rewrite.rs
index 00c03a3c8791162868dbe2e5186c68b776bcaf88..f463732c0e497dbccd4fa9f4482fa592518c4b46 100644 (file)
@@ -10,8 +10,8 @@
 
 // A generic trait to abstract the rewriting of an element (of the AST).
 
-use syntax::codemap::{CodeMap, Span};
 use syntax::parse::ParseSess;
+use syntax::source_map::{SourceMap, Span};
 
 use config::{Config, IndentStyle};
 use shape::Shape;
@@ -28,7 +28,7 @@ pub trait Rewrite {
 #[derive(Clone)]
 pub struct RewriteContext<'a> {
     pub parse_session: &'a ParseSess,
-    pub codemap: &'a CodeMap,
+    pub source_map: &'a SourceMap,
     pub config: &'a Config,
     pub inside_macro: RefCell<bool>,
     // Force block indent style even if we are using visual indent style.
@@ -39,6 +39,8 @@ pub struct RewriteContext<'a> {
     // When rewriting chain, veto going multi line except the last element
     pub force_one_line_chain: RefCell<bool>,
     pub snippet_provider: &'a SnippetProvider<'a>,
+    // Used for `format_snippet`
+    pub(crate) macro_rewrite_failure: RefCell<bool>,
     pub(crate) report: FormatReport,
 }